# hitroxvn/quanlycuahanggiay architecture

> Architecture diagram of the GitHub repository hitroxvn/quanlycuahanggiay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hitroxvn/quanlycuahanggiay
- Repository: https://github.com/hitroxvn/quanlycuahanggiay

## Overview

1. **Project type and runtime**
   - This is a **C# Windows Forms desktop application** for shoe store management (`QuanLyCuaHangGiay`).
   - The solution is organized as a single application project, with `Program.cs` as the startup entrypoint and `App.config`/`packages.config` for runtime and package configuration.

2. **Overall architecture**
   - The code follows a simple **layered monolith** structure:
     - **View layer**: WinForms screens and controls.
     - **Controller layer**: business-use orchestration between UI and data access.
     - **Repository layer**: database operations.
     - **Model layer**: entity/data transfer classes.
     - **Utility layer**: auth, hashing, session, validation helpers.
   - The main flow is: **Form/UI → Controller → Repository → DBConnection → database**.

3. **UI / presentation subsystem**
   - The `view` folder contains the application screens:
     - Authentication and account screens: `flogin`, `fregister`, `faccount`, `fChangePasswords`
     - Store operations: `frmBanHang`, `frmKho`, `frmPhieuNhap`, `frmQuanLyDonHang`, `frmQuanLyKhachHang`, `frmNCC`, `F_Product`, `F_Category`
     - Dashboard/reporting: `frmMain`, `frmThongKe`, `frmReport`, `frmHoaDon`, `ucSanPham`
   - These forms are the primary interaction surface and likely host navigation between modules.

4. **Business/controller subsystem**
   - The `controller` folder contains one controller per business area:
     - `AuthController`, `UserController`
     - `ProductController`, `CategoryController`
     - `BanHangController`, `DonHangController`
     - `KhachHangController`, `NhaCungCapController`
     - `KhoController`, `PhieuNhapController`
     - `ThongKeController`
   - These controllers appear to encapsulate application rules and coordinate data access for each module, keeping forms thinner.

5. **Data access subsystem**
   - The `database/repository` folder contains repository classes for the same business domains:
     - `ProductRepository`, `CategoryRepository`
     - `BanHangRepository`, `DonHangRepository`
     - `KhachHangRepository`, `NhaCungCapRepository`
     - `KhoRepository`, `PhieuNhapRepository`
     - `ThongKeRepository`, `UserRepository`
   - `database/DBConnection.cs` is the shared connection layer, implying the repositories execute SQL against a central relational database.

6. **Domain/data model**
   - The `model` folder defines the core entities used across the app:
     - Product/catalog: `Products`, `SanPham`, `Categories`
     - Sales/order flow: `DonHang`, `ChiTietGioHang`
     - Business partners: `KhachHang`, `NhaCungCap`
     - Inventory and purchasing: `Kho`, `PhieuNhap`
     - Users/auth: `Users`
     - Reporting/statistics: `ThongKe`, `BieuDoThongKe`
   - These models are the shared data shape passed between UI, controllers, and repositories.

7. **Authentication and authorization boundary**
   - Security-related helpers live in `util`:
     - `HashPassword` for password handling
     - `ValidateUser` for login input/rules
     - `Authorization` and `Session` for user access control and current-user state
   - This suggests form access is gated by role/session state rather than a separate identity service.

8. **Reporting and analytics**
   - Reporting is a distinct subsystem:
     - `ReportPhieuNhap.rdlc`
     - `DataSetPhieuNhap*.cs/.xsd/.xsc/.xss`
     - `frmReport`, `frmThongKe`
   - The app likely generates purchase-receipt reports and store statistics using typed datasets plus RDLC report definitions.

9. **Sales, inventory, and procurement workflow**
   - The repository names show the core business processes:
     - **Selling**: `frmBanHang` / `BanHangController` / `BanHangRepository`
     - **Order management**: `frmQuanLyDonHang`
     - **Inventory**: `frmKho`
     - **Inbound purchasing**: `frmPhieuNhap` / `PhieuNhapController`
     - **Master data**: products, categories, customers, suppliers
   - The architecture is centered on maintaining product availability while recording sales and stock-in transactions.

10. **Navigation and shared UI structure**
    - `frmMain` likely acts as the main shell/menu for opening feature screens.
    - `IBaseForm` suggests a common interface for forms or embedded views, which helps standardize navigation or lifecycle behavior.
    - `ucSanPham` is a reusable user control, indicating some parts of the UI are componentized rather than purely form-based.

11. **Persistence and external dependency boundary**
    - The app depends on a local/central relational database accessed through repository classes, but no separate backend service is present.
    - All persistence logic is embedded in the desktop app, so the application is a **thick client** with direct database access.

12. **Diagram-friendly summary**
    - A good architecture diagram should show:
      - **WinForms screens** at the top
      - **Controllers** in the middle
      - **Repositories + DBConnection** beneath them
      - **Database** at the bottom
      - Side services for **auth/session/validation** and **reports/datasets**
    - The key bounded contexts are: **authentication**, **catalog management**, **sales/orders**, **inventory/procurement**, **customer/supplier management**, and **reporting/statistics**.

Main entry points: [`QuanLyCuaHangGiay/view/frmMain.cs`](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmMain.cs) (Main shell), [`QuanLyCuaHangGiay/database/DBConnection.cs`](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/DBConnection.cs) (DB connection), [`QuanLyCuaHangGiay/view/frmThongKe.cs`](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmThongKe.cs) (Statistics), [`QuanLyCuaHangGiay/controller/AuthController.cs`](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/AuthController.cs) (Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["WinForms UI"]
  node_main_form["Main shell<br/>winform<br/>[frmMain.cs]"]
  node_login_form["Login<br/>winform<br/>[flogin.cs]"]
  node_product_form["Products<br/>winform<br/>[F_Product.cs]"]
  node_sales_form["Sales<br/>winform<br/>[frmBanHang.cs]"]
  node_inventory_form["Inventory<br/>winform<br/>[frmKho.cs]"]
  node_purchase_form["Inbound<br/>winform<br/>[frmPhieuNhap.cs]"]
  node_orders_form["Orders<br/>winform"]
  node_customers_form["Customers<br/>winform"]
  node_suppliers_form["Suppliers<br/>winform<br/>[frmNCC.cs]"]
  node_stats_form["Statistics<br/>winform<br/>[frmThongKe.cs]"]
end

subgraph group_application["Controllers"]
  node_auth_ctrl["Auth<br/>controller<br/>[AuthController.cs]"]
  node_sales_ctrl["Sales ctrl<br/>controller"]
  node_catalog_ctrl["Catalog ctrl<br/>controller"]
  node_inventory_ctrl["Inventory ctrl<br/>controller<br/>[KhoController.cs]"]
  node_order_ctrl["Orders ctrl<br/>controller"]
  node_partner_ctrl["Partners ctrl<br/>controller"]
  node_stats_ctrl["Stats ctrl<br/>controller"]
end

subgraph group_data["Data access"]
  node_dbconn[("DB connection<br/>db gateway<br/>[DBConnection.cs]")]
  node_product_repo["Products repo"]
  node_sales_repo["Sales repo"]
  node_inventory_repo["Stock repo<br/>[KhoRepository.cs]"]
  node_stats_repo["Stats repo"]
end

subgraph group_domain["Domain models"]
  node_users_model["Users<br/>model<br/>[Users.cs]"]
  node_product_model["Products<br/>model<br/>[Products.cs]"]
  node_order_model["Orders<br/>model<br/>[DonHang.cs]"]
  node_partner_model["Partners<br/>model<br/>[KhachHang.cs]"]
end

subgraph group_shared["Shared utilities"]
  node_auth_util{{"Auth utils<br/>security<br/>[Authorization.cs]"}}
  node_validate_util{{"Validation<br/>security<br/>[ValidateUser.cs]"}}
end

subgraph group_reporting["Reports"]
  node_report_dataset["Receipt dataset<br/>report asset"]
  node_report_def["Receipt report<br/>rdlc report"]
end

node_program["Program<br/>startup<br/>[Program.cs]"]

node_program -->|"starts"| node_main_form
node_main_form -->|"opens"| node_login_form
node_login_form -->|"uses"| node_auth_ctrl
node_auth_ctrl -->|"checks"| node_auth_util
node_auth_ctrl -->|"reads"| node_dbconn
node_main_form -->|"navigates"| node_product_form
node_main_form -->|"navigates"| node_sales_form
node_main_form -->|"navigates"| node_inventory_form
node_main_form -->|"navigates"| node_purchase_form
node_main_form -->|"navigates"| node_orders_form
node_main_form -->|"navigates"| node_customers_form
node_main_form -->|"navigates"| node_suppliers_form
node_main_form -->|"navigates"| node_stats_form
node_product_form -->|"uses"| node_catalog_ctrl
node_sales_form -->|"uses"| node_sales_ctrl
node_inventory_form -->|"uses"| node_inventory_ctrl
node_purchase_form -->|"uses"| node_inventory_ctrl
node_orders_form -->|"uses"| node_order_ctrl
node_customers_form -->|"uses"| node_partner_ctrl
node_suppliers_form -->|"uses"| node_partner_ctrl
node_stats_form -->|"uses"| node_stats_ctrl
node_catalog_ctrl -->|"calls"| node_product_repo
node_sales_ctrl -->|"calls"| node_sales_repo
node_inventory_ctrl -->|"calls"| node_inventory_repo
node_stats_ctrl -->|"calls"| node_stats_repo
node_product_repo -->|"uses"| node_dbconn
node_sales_repo -->|"uses"| node_dbconn
node_inventory_repo -->|"uses"| node_dbconn
node_stats_repo -->|"uses"| node_dbconn
node_dbconn -->|"stores"| node_product_model
node_dbconn -->|"stores"| node_order_model
node_dbconn -->|"stores"| node_partner_model
node_dbconn -->|"stores"| node_users_model
node_stats_ctrl -->|"feeds"| node_report_dataset
node_stats_form -->|"renders"| node_report_def

click node_program "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/Program.cs"
click node_main_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmMain.cs"
click node_login_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/flogin.cs"
click node_product_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/F_Product.cs"
click node_sales_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmBanHang.cs"
click node_inventory_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmKho.cs"
click node_purchase_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmPhieuNhap.cs"
click node_orders_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmQuanLyDonHang.cs"
click node_customers_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmQuanLyKhachHang.cs"
click node_suppliers_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmNCC.cs"
click node_stats_form "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmThongKe.cs"
click node_auth_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/AuthController.cs"
click node_sales_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/BanHangController.cs"
click node_catalog_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/ProductController.cs"
click node_inventory_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/KhoController.cs"
click node_order_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/DonHangController.cs"
click node_partner_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/KhachHangController.cs"
click node_stats_ctrl "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/ThongKeController.cs"
click node_dbconn "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/DBConnection.cs"
click node_product_repo "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/ProductRepository.cs"
click node_sales_repo "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/BanHangRepository.cs"
click node_inventory_repo "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/KhoRepository.cs"
click node_stats_repo "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/ThongKeRepository.cs"
click node_users_model "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/Users.cs"
click node_product_model "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/Products.cs"
click node_order_model "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/DonHang.cs"
click node_partner_model "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/KhachHang.cs"
click node_auth_util "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/util/Authorization.cs"
click node_validate_util "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/util/ValidateUser.cs"
click node_report_dataset "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/DataSetPhieuNhap.xsd"
click node_report_def "https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/ReportPhieuNhap.rdlc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_form,node_login_form,node_product_form,node_sales_form,node_inventory_form,node_purchase_form,node_orders_form,node_customers_form,node_suppliers_form,node_stats_form toneBlue
class node_auth_ctrl,node_sales_ctrl,node_catalog_ctrl,node_inventory_ctrl,node_order_ctrl,node_partner_ctrl,node_stats_ctrl toneAmber
class node_dbconn,node_product_repo,node_sales_repo,node_inventory_repo,node_stats_repo toneMint
class node_users_model,node_product_model,node_order_model,node_partner_model toneRose
class node_auth_util,node_validate_util toneIndigo
class node_report_dataset,node_report_def toneTeal
class node_program toneNeutral
```

## Components

### WinForms UI

Desktop screens and reusable controls.

- [Main shell](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmMain.cs): winform · Primary navigation window. · `QuanLyCuaHangGiay/view/frmMain.cs`
- [Login](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/flogin.cs): winform · Authentication screen. · `QuanLyCuaHangGiay/view/flogin.cs`
- [Products](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/F_Product.cs): winform · Catalog management screen. · `QuanLyCuaHangGiay/view/F_Product.cs`
- [Sales](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmBanHang.cs): winform · Point-of-sale workflow. · `QuanLyCuaHangGiay/view/frmBanHang.cs`
- [Inventory](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmKho.cs): winform · Stock management screen. · `QuanLyCuaHangGiay/view/frmKho.cs`
- [Inbound](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmPhieuNhap.cs): winform · Purchase receipt workflow. · `QuanLyCuaHangGiay/view/frmPhieuNhap.cs`
- [Orders](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmQuanLyDonHang.cs): winform · Order management screen. · `QuanLyCuaHangGiay/view/frmQuanLyDonHang.cs`
- [Customers](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmQuanLyKhachHang.cs): winform · Customer management screen. · `QuanLyCuaHangGiay/view/frmQuanLyKhachHang.cs`
- [Suppliers](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmNCC.cs): winform · Supplier management screen. · `QuanLyCuaHangGiay/view/frmNCC.cs`
- [Statistics](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/view/frmThongKe.cs): winform · Reporting and analytics screen. · `QuanLyCuaHangGiay/view/frmThongKe.cs`

### Controllers

Business orchestration between forms and persistence.

- [Auth](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/AuthController.cs): controller · Login and account workflows. · `QuanLyCuaHangGiay/controller/AuthController.cs`
- [Sales ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/BanHangController.cs): controller · Sales transaction orchestration. · `QuanLyCuaHangGiay/controller/BanHangController.cs`
- [Catalog ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/ProductController.cs): controller · Product and category operations. · `QuanLyCuaHangGiay/controller/ProductController.cs`
- [Inventory ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/KhoController.cs): controller · Stock and inbound purchasing logic. · `QuanLyCuaHangGiay/controller/KhoController.cs`
- [Orders ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/DonHangController.cs): controller · Order lifecycle management. · `QuanLyCuaHangGiay/controller/DonHangController.cs`
- [Partners ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/KhachHangController.cs): controller · Customer and supplier management. · `QuanLyCuaHangGiay/controller/KhachHangController.cs`
- [Stats ctrl](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/controller/ThongKeController.cs): controller · Statistics and report queries. · `QuanLyCuaHangGiay/controller/ThongKeController.cs`

### Data access

Repositories and shared database connection.

- [DB connection](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/DBConnection.cs): db gateway · Shared relational database connection. · `QuanLyCuaHangGiay/database/DBConnection.cs`
- [Products repo](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/ProductRepository.cs): repository · Product persistence operations. · `QuanLyCuaHangGiay/database/repository/ProductRepository.cs`
- [Sales repo](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/BanHangRepository.cs): repository · Sales transaction persistence. · `QuanLyCuaHangGiay/database/repository/BanHangRepository.cs`
- [Stock repo](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/KhoRepository.cs): repository · Inventory and purchase persistence. · `QuanLyCuaHangGiay/database/repository/KhoRepository.cs`
- [Stats repo](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/database/repository/ThongKeRepository.cs): repository · Reporting and analytics queries. · `QuanLyCuaHangGiay/database/repository/ThongKeRepository.cs`

### Domain models

Shared entities and DTO-style models.

- [Users](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/Users.cs): model · User/account entity. · `QuanLyCuaHangGiay/model/Users.cs`
- [Products](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/Products.cs): model · Product and category data shapes. · `QuanLyCuaHangGiay/model/Products.cs`
- [Orders](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/DonHang.cs): model · Order and cart data shapes. · `QuanLyCuaHangGiay/model/DonHang.cs`
- [Partners](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/model/KhachHang.cs): model · Customer and supplier entities. · `QuanLyCuaHangGiay/model/KhachHang.cs`

### Shared utilities

Authentication, session, and validation helpers.

- [Auth utils](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/util/Authorization.cs): security · Password hashing, authorization, and session state. · `QuanLyCuaHangGiay/util/Authorization.cs`
- [Validation](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/util/ValidateUser.cs): security · Login and user input checks. · `QuanLyCuaHangGiay/util/ValidateUser.cs`

### Reports

RDLC report assets and typed datasets.

- [Receipt dataset](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/DataSetPhieuNhap.xsd): report asset · Typed dataset for purchase receipt reports. · `QuanLyCuaHangGiay/DataSetPhieuNhap.xsd`
- [Receipt report](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/ReportPhieuNhap.rdlc): rdlc report · RDLC definition for purchase receipt output. · `QuanLyCuaHangGiay/ReportPhieuNhap.rdlc`

### Other components

- [Program](https://github.com/hitroxvn/quanlycuahanggiay/blob/master/QuanLyCuaHangGiay/Program.cs): startup · Application entrypoint. · `QuanLyCuaHangGiay/Program.cs`

## Connections

- Program → Main shell: starts · Launches the main shell.
- Main shell → Login: opens · Routes users into authentication.
- Login → Auth: uses · Submits login and account actions.
- Auth → Auth utils: checks · Validates credentials and session rules.
- Auth → DB connection: reads · Loads users and account state.
- Main shell → Products: navigates · Opens catalog management.
- Main shell → Sales: navigates · Opens point-of-sale workflow.
- Main shell → Inventory: navigates · Opens stock management.
- Main shell → Inbound: navigates · Opens inbound purchasing.
- Main shell → Orders: navigates · Opens order management.
- Main shell → Customers: navigates · Opens customer management.
- Main shell → Suppliers: navigates · Opens supplier management.
- Main shell → Statistics: navigates · Opens reporting and analytics.
- Products → Catalog ctrl: uses · Delegates product operations.
- Sales → Sales ctrl: uses · Delegates sale creation and checkout.
- Inventory → Inventory ctrl: uses · Delegates stock actions.
- Inbound → Inventory ctrl: uses · Reuses stock/purchase logic.
- Orders → Orders ctrl: uses · Delegates order lifecycle operations.
- Customers → Partners ctrl: uses · Delegates customer management.
- Suppliers → Partners ctrl: uses · Delegates supplier management.
- Statistics → Stats ctrl: uses · Requests analytics and report data.
- Catalog ctrl → Products repo: calls · Persists catalog changes.
- Sales ctrl → Sales repo: calls · Writes sales transactions.
- Inventory ctrl → Stock repo: calls · Reads and updates stock records.
- Stats ctrl → Stats repo: calls · Fetches reporting aggregates.
- Products repo → DB connection: uses · Executes database operations through shared connection.
- Sales repo → DB connection: uses · Executes database operations through shared connection.
- Stock repo → DB connection: uses · Executes database operations through shared connection.
- Stats repo → DB connection: uses · Executes database operations through shared connection.
- DB connection → Products: stores · Backs catalog persistence.
- DB connection → Orders: stores · Backs order and cart persistence.
- DB connection → Partners: stores · Backs customer and supplier persistence.
- DB connection → Users: stores · Backs user/account persistence.
- Stats ctrl → Receipt dataset: feeds · Populates typed dataset for reporting.
- Statistics → Receipt report: renders · Displays the RDLC receipt report.
