Project description:

This is a simple application to manage clients in the database. This application can perform CRUD operations to the clients saved in the database.


Technology used:

Using ASP.NET Core to create a web application, C# as the programming language, MySQL for the database.


Application features:
  • Create MySQL connection with the application
  • Create MySQL connection by adding a data source as the data provider, specify the server name, username, and password. Write a new query to create the Client table and insert some sample data in the table.


  • Get all clients' details in the database
  • In the clients index page, it will load all the saved clients in the database.


  • Create new client
  • In the create client page, the user needs to fill in the client details to create a new client. All the fields in the create client form are required, if a field is blank, it will appear an error message. The client's email must be unique, this is not allowed if someone tries to create a new client with the email address already exist in the database.


    If the create client form has passed the error checking, it will try to save the new client to the database. Using the database connection string to open the database connection, execute a SQL query to take the value of the form as the value of the client table fields.


    If the new client is been added successfully, the user will be redirected back to the index page where the user can see all clients including the newly added client.


  • Edit existing client
  • Click the edit button next to a client will take the user to the edit client page. This page will be getting the selected client 's details where the id is matched with the selected client's id from the database, and pre-filled the details to the input fields.


    All the fields are required before submitting, if any field is blank, an error message will appear. After the client's details are been edited, it will use a SQL query to update the client's details, it will take the value of each input field as the parameter value of each client detail field. If the client is been edited successfully, the user will be redirected to the index page where the user can see all clients and the edited client's details are been updated.


  • Delete client
  • Click on the delete button next to a client, the selected client will be deleted where the id is matched with the client id in the database. The index page will be reloaded, the user can see all clients in the database and the deleted client is no longer showed on the client list.