Skip to content

Rezuanul-Islam-Fahim/Super-Shop-Management-System

Repository files navigation

🛒 Super Shop Management System

.NET Framework C# SQL Server Windows Forms

A comprehensive desktop application for managing retail shop operations with role-based access control.


📋 Table of Contents


📖 Overview

Super Shop Management System is a robust Windows Forms application built with C# and .NET Framework 4.7.2 designed to streamline retail shop operations. The system implements a comprehensive role-based access control (RBAC) mechanism supporting three distinct user types: Admin, Manager, and Cashier.

The application follows a layered architecture pattern with clear separation of concerns, implementing the Repository pattern for data access and Service layer for business logic encapsulation.


✨ Features

🔐 Authentication & Authorization

  • Secure user registration with email and password validation
  • SHA-256 password hashing for enhanced security
  • Role-based access control (Admin, Manager, Cashier)
  • User approval workflow for new registrations
  • Session management for logged-in users

📊 Dashboard Analytics

  • Admin Dashboard: System-wide sales overview, trending products/categories, revenue analytics
  • Manager Dashboard: Category-specific performance metrics, stock monitoring
  • Cashier Dashboard: Personal sales statistics, daily/weekly/monthly summaries

🛍️ Sales Management

  • Intuitive Point of Sale (POS) interface
  • Real-time cart management with quantity updates
  • Customer lookup by phone number
  • Automatic new customer registration
  • Discount application support
  • Payment processing with change calculation
  • Order history with detailed item breakdown

📦 Inventory Management

  • Complete product CRUD operations
  • Category-based product organization
  • Stock level monitoring and alerts
  • Stock request workflow (Cashier → Manager)
  • Price management (purchase & selling prices)
  • Unit-based inventory tracking

👥 User Management

  • User registration with role assignment
  • Pending user approval system
  • User profile management (Admin, Manager, Cashier profiles)
  • Shift management for cashiers

🏷️ Category & Supplier Management

  • Category creation and assignment to managers
  • Comprehensive supplier information tracking
  • Contact person and company details management

📋 Reporting & Orders

  • Filterable order history (Today, This Week, Last Week, This Month, All Time)
  • Cashier-specific order filtering for admins
  • Detailed order view with line items
  • Sales summary statistics

🏗️ System Architecture

The application follows a 3-Tier Architecture pattern:

┌─────────────────────────────────────────────────────────────────┐
│                     PRESENTATION LAYER                          │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────────┐│
│  │   Forms     │ │  Controls   │ │      Controllers            ││
│  │ - Login     │ │ - Dashboard │ │ - MainDashboardController   ││
│  │ - Register  │ │ - Products  │ │                             ││
│  │ - Main      │ │ - Sales     │ │                             ││
│  │ - Onboarding│ │ - Orders    │ │                             ││
│  └─────────────┘ └─────────────┘ └─────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      BUSINESS LAYER                             │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                       Services                               ││
│  │  - AuthService      - ProductService    - CustomerService   ││
│  │  - CategoryService  - SalesService      - SupplierService   ││
│  └─────────────────────────────────────────────────────────────┘│
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                       Common                                 ││
│  │  - Constants        - SessionManager    - Utilities         ││
│  └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                       DATA ACCESS LAYER                         │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                     Repositories                             ││
│  │  - UserRepository       - ProductRepository                 ││
│  │  - AdminRepository      - CategoryRepository                ││
│  │  - ManagerRepository    - SupplierRepository                ││
│  │  - CashierRepository    - SalesRepository                   ││
│  │  - CustomerRepository   - DashboardRepository               ││
│  │  - PurchaseDetailsRepository  - StockRequestRepository      ││
│  └─────────────────────────────────────────────────────────────┘│
│  ┌─────────────────────────────────────────────────────────────┐│
│  │                    DbConnection                              ││
│  │           SQL Server Database Connection Manager             ││
│  └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    SQL SERVER DATABASE                          │
│                       SuperShopDB                               │
└─────────────────────────────────────────────────────────────────┘

🛠️ Technology Stack

Component Technology
Framework .NET Framework 4.7.2
Language C#
UI Framework Windows Forms (WinForms)
Database Microsoft SQL Server / SQL Server Express
ORM ADO.NET (SqlClient)
Security SHA-256 Password Hashing
Architecture 3-Tier Architecture, Repository Pattern

🗄️ Database Schema

Core Tables

Table Description
Users Stores user authentication data (username, password hash, email, role, status)
Admins Admin profile information
Managers Manager profile with assigned categories
Cashiers Cashier profile including shift type and sales count
Categories Product categories with manager assignment
Products Product inventory with pricing and stock levels
Suppliers Supplier contact and company information
Customers Customer details for sales tracking
Sales Sales transactions with amounts and discounts
SalesDetails Line items for each sale
PurchaseDetails Purchase tracking linking cashier, customer, and sales
StockRequests Stock replenishment requests workflow

Entity Models

// Core entities in the system
UserUserId, UserName, Password, Email, Role, JoinDate, IsActive
Admin       → AdminId, UserId, FullName, Phone, Address
Manager     → ManagerId, UserId, FullName, Phone, Address
Cashier     → CashierId, UserId, FullName, Phone, ShiftType, TotalSalesCount
Product     → ProductId, ProductName, CategoryId, SupplierId, PurchasePrice, SellingPrice, Quantity, Unit
Category    → CategoryId, CategoryName, ManagerId
Supplier    → SupplierId, SupplierName, CompanyName, ContactPerson, Phone, Email, Address
Customer    → CustomerId, CustomerName, Phone, Address, AddDate
Sales       → SalesId, TotalAmount, Discount, NetAmount, PaidAmount, ChangeAmount
StockRequest→ RequestId, ProductId, RequestedQuantity, CashierId, ManagerId, Status, Notes

👤 User Roles & Permissions

🔴 Admin

Module Access
Dashboard ✅ Full analytics view
Users ✅ Create, Read, Update, Delete
Pending Users ✅ Approve/Reject registrations
Categories ✅ Full CRUD
Suppliers ✅ Full CRUD
Products ✅ Full CRUD
Customers ✅ View all customers
Orders/Reports ✅ View all orders with filtering

🟡 Manager

Module Access
Dashboard ✅ Category-specific analytics
Categories ✅ Manage assigned categories
Suppliers ✅ Full CRUD
Products ✅ Manage products in assigned categories
Stock Management ✅ Approve/Reject stock requests
Customers ✅ View all customers
Orders/Reports ✅ View all orders with filtering

🟢 Cashier

Module Access
Dashboard ✅ Personal sales statistics
New Sale ✅ Point of Sale interface
Products 📖 Read-only view
Customers ✅ View and create customers
Orders ✅ View own orders

📥 Installation

Prerequisites

  • Windows 10/11 (64-bit recommended)
  • Visual Studio 2019/2022 with .NET Desktop Development workload
  • SQL Server 2017+ or SQL Server Express
  • .NET Framework 4.7.2 Runtime

Step-by-Step Installation

  1. Clone the Repository

    git clone https://github.com/Rezuanul-Islam-Fahim/Super-Shop-Management-System.git
    cd Super-Shop-Management-System
  2. Database Setup

    Option A: Restore from Backup

    -- Open SQL Server Management Studio (SSMS)
    -- Right-click "Databases" → "Restore Database"
    -- Select "Device" → Browse → Select "SuperShopDB.bak"
    -- Click OK to restore

    Option B: Run SQL Scripts

    • Create a new database named SuperShopDB
    • Execute the queries in SqlQueries.sql to create tables and sample data
  3. Configure Connection String

    Update the connection string in SuperShopManagement/DataAccess/DbConnection.cs:

    private static readonly string _connectionString =
        "Data Source=.\\SQLEXPRESS;Initial Catalog=SuperShopDB;Integrated Security=True";

    Or in App.config:

    <connectionStrings>
        <add name="SuperShopDb"
             connectionString="Data Source=.;Initial Catalog=SuperShopDB;Integrated Security=True"
             providerName="System.Data.SqlClient" />
    </connectionStrings>
  4. Build and Run

    • Open SuperShopManagement.sln in Visual Studio
    • Build the solution (Ctrl+Shift+B)
    • Press F5 to run the application

⚙️ Configuration

Database Connection

The application supports two connection string formats:

Server Type Connection String
SQL Server Express (Local) Data Source=.\SQLEXPRESS;Initial Catalog=SuperShopDB;Integrated Security=True
SQL Server (Default Instance) Data Source=.;Initial Catalog=SuperShopDB;Integrated Security=True
SQL Server (Named Instance) Data Source=ServerName\InstanceName;Initial Catalog=SuperShopDB;Integrated Security=True
SQL Server (With Credentials) Data Source=.;Initial Catalog=SuperShopDB;User ID=sa;Password=YourPassword

Security Configuration

  • Passwords are hashed using SHA-256 before storage
  • Minimum password length: 6 characters
  • Email validation using regex pattern matching
  • Phone validation: 10-15 digits with optional formatting characters

📖 Usage Guide

First-Time Setup

  1. Launch the Application → Onboarding screen appears
  2. Register an Admin User → First user should be an Admin
  3. Login → Use registered credentials
  4. Approve Users → Admin must approve any new user registrations

Sales Workflow (Cashier)

  1. Navigate to New Sale module
  2. Search for existing customer by phone or enter new customer details
  3. Select products from dropdown and set quantity
  4. Click Add to Cart to add items
  5. Apply discount if applicable
  6. Enter paid amount
  7. Click Confirm Sale to complete transaction

Stock Request Workflow

  1. Cashier identifies low stock during sales
  2. Cashier submits stock request with quantity and notes
  3. Manager reviews pending requests in Stock Management
  4. Manager approves or rejects requests
  5. Approved requests automatically update product quantities

📁 Project Structure

Super-Shop-Management-System/
├── 📄 README.md                          # Project documentation
├── 📄 SuperShopManagement.sln            # Visual Studio solution file
├── 📄 SqlQueries.sql                     # Database scripts reference
├── 📄 SuperShopDB.bak                    # Database backup file
├── 📁 Screenshots/                       # Application screenshots
│
└── 📁 SuperShopManagement/               # Main project folder
    ├── 📄 App.config                     # Application configuration
    ├── 📄 Program.cs                     # Application entry point
    ├── 📄 SuperShopManagement.csproj     # Project file
    │
    ├── 📁 Common/                        # Shared utilities
    │   ├── 📄 Constants.cs               # Application constants & messages
    │   ├── 📄 SessionManager.cs          # User session management
    │   └── 📄 Utilities.cs               # Helper functions (hashing, validation)
    │
    ├── 📁 DataAccess/                    # Data access layer
    │   ├── 📄 DbConnection.cs            # Database connection manager
    │   └── 📁 Repositories/              # Repository pattern implementations
    │       ├── 📄 AdminRepository.cs
    │       ├── 📄 CashierRepository.cs
    │       ├── 📄 CategoryRepository.cs
    │       ├── 📄 CustomerRepository.cs
    │       ├── 📄 DashboardRepository.cs
    │       ├── 📄 ManagerRepository.cs
    │       ├── 📄 ProductRepository.cs
    │       ├── 📄 PurchaseDetailsRepository.cs
    │       ├── 📄 SalesRepository.cs
    │       ├── 📄 StockRequestRepository.cs
    │       ├── 📄 SupplierRepository.cs
    │       └── 📄 UserRepository.cs
    │
    ├── 📁 Models/                        # Entity models
    │   ├── 📄 Admin.cs
    │   ├── 📄 Cashier.cs
    │   ├── 📄 Category.cs
    │   ├── 📄 Customer.cs
    │   ├── 📄 Manager.cs
    │   ├── 📄 Product.cs
    │   ├── 📄 PurchaseDetails.cs
    │   ├── 📄 Sales.cs
    │   ├── 📄 SalesDetails.cs
    │   ├── 📄 StockRequest.cs
    │   ├── 📄 Supplier.cs
    │   └── 📄 User.cs
    │
    ├── 📁 Services/                      # Business logic layer
    │   ├── 📄 AuthService.cs             # Authentication & registration
    │   ├── 📄 CategoryService.cs
    │   ├── 📄 CustomerService.cs
    │   ├── 📄 ProductService.cs
    │   ├── 📄 SalesService.cs
    │   └── 📄 SupplierService.cs
    │
    ├── 📁 UI/                            # User interface layer
    │   ├── 📁 Controllers/
    │   │   └── 📄 MainDashboardController.cs  # Navigation controller
    │   │
    │   └── 📁 Forms/                     # Windows Forms
    │       ├── 📄 LoginForm.cs
    │       ├── 📄 RegisterForm.cs
    │       ├── 📄 OnboardingForm.cs
    │       ├── 📄 MainDashboardForm.cs
    │       ├── 📄 OrderDetailForm.cs
    │       ├── 📄 CreateUpdateCategory.cs
    │       ├── 📄 CreateUpdateProduct.cs
    │       ├── 📄 CreateUpdateSupplier.cs
    │       │
    │       └── 📁 Controls/              # User controls
    │           ├── 📁 admin/
    │           │   ├── 📄 AdminDashboardControl.cs
    │           │   ├── 📄 AdminUserControl.cs
    │           │   └── 📄 PendingUsersControl.cs
    │           ├── 📁 manager/
    │           │   ├── 📄 ManagerDashboardControl.cs
    │           │   └── 📄 ProductStockControl.cs
    │           ├── 📁 cashier/
    │           │   ├── 📄 CashierDashboardControl.cs
    │           │   └── 📄 NewSaleControl.cs
    │           └── 📁 common/
    │               ├── 📄 CategoryManagementControl.cs
    │               ├── 📄 CustomerUserControl.cs
    │               ├── 📄 OrdersControl.cs
    │               ├── 📄 ProductUserControl.cs
    │               └── 📄 SupplierUserControl.cs
    │
    └── 📁 Properties/                    # Assembly information
        ├── 📄 AssemblyInfo.cs
        ├── 📄 Resources.resx
        └── 📄 Settings.settings

📸 Screenshots

🧾 Cashier Dashboard

🛒 New Sale

📦 Orders

🏷️ Product Management

👤 User Management

🗂️ Category & Supplier Management

⏳ Pending Users


🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Coding Standards

  • Follow C# naming conventions
  • Use meaningful variable and method names
  • Add XML documentation for public methods
  • Write unit tests for new features

📄 License

This project is open source and available under the MIT License.


👨‍💻 Contributors

Rezuanul Islam Fahim

M. Shahriar Hasan Limon


⭐ Star this repository if you find it helpful! ⭐

Packages

 
 
 

Contributors

Languages