Skip to content

the-khiem7/ProductManagement.AspNetMVC

Repository files navigation

Product Management System

A .NET Core MVC application for product management.

Project Structure

  • BusinessObjects: Contains entity models (Product, Category, AccountMember)
  • DataAccessObjects: Database context and data access layer
  • Repositories: Repository pattern implementation
  • Services: Business logic services
  • ProductManagementASPNETCoreMVC: MVC web application

Application Flow

sequenceDiagram
    actor User
    participant AC as AccountController
    participant PC as ProductsController
    participant PS as ProductService
    participant PR as ProductRepository
    participant PDAO as ProductDAO
    participant DB as Database
    
    User->>AC: Login with credentials
    AC->>User: Redirects to Products page
    
    User->>PC: Request Products Index
    PC->>PS: GetProducts()
    PS->>PR: GetProducts()
    PR->>PDAO: GetProducts()
    PDAO->>DB: SQL Query
    DB->>PDAO: Product Data
    PDAO->>PR: Product List
    PR->>PS: Product List
    PS->>PC: Product List
    PC->>User: Display Products View
    
    User->>PC: Create/Edit/Delete Product
    PC->>PS: SaveProduct/UpdateProduct/DeleteProduct
    PS->>PR: SaveProduct/UpdateProduct/DeleteProduct
    PR->>PDAO: SaveProduct/UpdateProduct/DeleteProduct
    PDAO->>DB: SQL Commands
    DB->>PDAO: Confirmation
    PDAO->>PR: Result
    PR->>PS: Result
    PS->>PC: Result
    PC->>User: Redirect to Products Index
Loading

Running the Project from Command Line

Prerequisites

  • .NET SDK 8.0 or later
  • SQL Server with a database named "MyStore"

Steps to Run the Project

  1. Open Command Prompt: Open a command prompt window (cmd) or PowerShell.

  2. Navigate to Project Directory: Navigate to the main project directory:

    cd d:\ASP\SEM7\ProductManagement.Razor\ProductManagementASPNETCoreMVC
    
  3. Restore Dependencies: Restore all the NuGet packages:

    dotnet restore
    
  4. Build the Project:

    dotnet build
    
  5. Run the Application:

    dotnet run
    
  6. Access the Application: Once running, the application should be accessible at:

    (The exact ports may vary based on your configuration)

  7. Login: The application will start at the login page since the default route is set to the Account/Login page.

Additional Options

  • Run with specific environment:

    dotnet run --environment Development
    
  • Run with a specific port:

    dotnet run --urls="http://localhost:8080"
    
  • Run in Watch mode (automatically recompiles when code changes):

    dotnet watch run
    

Notes

  • The application uses Entity Framework Core and expects a SQL Server database called "MyStore" to be available.
  • Make sure the connection string in the appsettings.json file is configured correctly for your environment.

About

Product management web application demonstrating ASP.NET Core MVC best practices and clean architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors