This ASP.NET MVC application is designed to manage clients in an MSSQL database, allowing CRUD operations (Create, Read, Update, Delete) on the "Cliente" entity. The application includes three main views: Index, Nuevo (New), and Editar (Edit).
Before running the application, ensure that your MSSQL database is configured and update the connection string in the web.config
file.
<connectionStrings>
<add name="lab2Entities" connectionString="YourConnectionString" providerName="System.Data.SqlClient" />
</connectionStrings>
- Models: Contains model classes for the Cliente entity and the view model used in the Index view.
- Views/Cliente: Contains the Index, Nuevo, and Editar views.
- Controllers: Contains the
ClienteController
controller that manages CRUD operations. - Scripts: Contains jQuery scripts for datepicker functionality.
- Content: Contains CSS style files.
The main view displaying a table with the list of clients. Allows editing and deletion operations.
Enables adding new clients through a form. Includes data validation using Data Annotations and a jQuery datepicker for selecting birthdates.
Similar to Nuevo.cshtml, but designed for editing existing clients.
public class ClienteViewModel
{
// Properties of the Cliente model
// ...
}
public class ListClienteViewModel
{
// Properties of the ListClienteViewModel model
// ...
}
The ClienteController
controller handles CRUD operations for the Cliente entity. Some key actions include:
- Index: Displays the list of clients.
- Nuevo: Allows adding a new client.
- Editar: Allows editing an existing client.
- Eliminar: Allows deleting a client.
The application uses an MSSQL database named lab2Entities
. Ensure that the cliente
table with the necessary fields is created. You can use Entity Framework Code First Migrations to manage database migrations.
We hope this application proves useful! If you encounter any issues or have suggestions for improvement, feel free to contribute to the project. Thank you for using this ASP.NET MVC application!