Skip to content

C# MVC application for a hair salon using a MySQL Database

Notifications You must be signed in to change notification settings

helen-lehrer/HairSalon.Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eau Claire's Hair Salon

An MVC Web Application

By Helen Lehrer

Description

An MVC application for a hair salon that manages salon employees (stylists) and their clients. The user is able to add a list of stylists working at the salon and assign clients to that stylist. The stylists have specific specialties, so each client can only see (belong to) a single stylist (A one-to-many relationship). This application includes:

  • A splash page with options to see all Stylists, all Clients, or search for a specific Stylist or Client
  • A Stylists page that contains a link to a page with a form to create a new Stylist
  • Clickable Stylist names that go to new page displaying the selected Stylist details and a dynamic list of their assigned Clients
  • A Clients page that contains a link to a page with a form to create a new Client
  • Clickable Client names that go to new page displaying the selected Client details
  • All submissions have Edit, Delete, and Search functionality

Features:

  • A splash page
  • One-to-many database relationship
  • Multiple controllers
  • Use of MySQL for database management
  • GET and POST requests
  • MVC routes follow RESTful conventions
  • Search functionalities

Technologies Used

  • .NET 5.0.401
  • C#
  • Git Bash
  • MySQL & MySQL Workbench 8.0.30
  • Entity Framework Core 5.0.0
  • LINQ queries

Setup/Installation Requirements

Enter this command into your terminal to clone the project:

$ git clone https://github.com/helen-lehrer/HairSalon.Solution

Navigate from the root directory of the repo into the production folder HairSalon:

$ cd HairSalon

Restore dependencies and tools:

$ dotnet restore

Compile the code:

$ dotnet build

Database Import/Configuration:

  • Download, install, and configure MySQL & MySQL Workbench

  • In MySQL Workbench, In the Navigator>Administration window, select "Data Import/Restore"

  • In Import Options, select "Import from Self-Contained File"

  • In the field next to this, navigate to or type "[directory repo was cloned into]/HairSalon.Solution/helen_lehrer.sql".

  • In 'Default Schema to be Imported To', create a new Default Target Schema name called helen_lehrer.

  • Navigate to the tab called Import Progress and click Start Import at the bottom right corner of the window.

After you are finished with the above steps, reopen the Navigator > Schemas tab. Right click and select Refresh All. The database helen_lehrer will appear. Next, you will create an appsettings.json file.

Navigate from the root directory of the repo into the production folder HairSalon:

$ cd HairSalon

Create a file called appsettings.json:

$ touch appsettings.json

Add the following code to the appsettings.json file:

{
    "ConnectionStrings": {
        "DefaultConnection": "Server=localhost;Port=3306;database=helen_lehrer;uid=[YOUR-USERNAME-HERE];pwd=[YOUR-PASSWORD-HERE];"
    }
}
  • Make sure to insert your MySQL username and password into the appsettings.json connection string

  • Note that the database will change based on the database you are connecting to and that uid and pwd may vary depending on your MySql configurations.


To run the application:

Navigate from the root directory of the repo into the folder HairSalon:

$ cd HairSalon

Run the application:

$ dotnet run

Known Bugs

  • The search functionality is case sensitive

License

License

© Copyright 2022 Helen Lehrer

About

C# MVC application for a hair salon using a MySQL Database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published