# doitsuminh/cuahangmypham architecture

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

- Interactive diagram: https://gitdiagram.com/doitsuminh/cuahangmypham
- Repository: https://github.com/doitsuminh/cuahangmypham

## Overview

#### Purpose and Runtime
This is a Windows desktop cosmetics-store management application (`cuahangmypham.sln`), built as a C# WinForms executable. It supports login, product/inventory operations, sales, billing, company data, and reporting. The runnable entry is `cuahangmypham/Program.cs`; project dependencies and build target are defined in `cuahangmypham/cuahangmypham.csproj`.

#### Application Shell and Navigation
`cuahangmypham/Main.cs` is the primary post-login shell and likely coordinates access to operational forms. `cuahangmypham/Login.cs` is the authentication boundary that precedes access to the main UI. Each form is split into code-behind and WinForms designer/resource files, e.g. `cuahangmypham/Main.Designer.cs` and `cuahangmypham/Main.resx`.

#### Product and Inventory Management
Product catalog management is represented by `cuahangmypham/ProductForm.cs`. Stock intake is a distinct workflow in `cuahangmypham/ProductIn.cs`, separating inbound inventory from product definition/maintenance. These forms are likely invoked from the main shell and persist against the configured store database.

#### Sales and Billing Workflow
`cuahangmypham/Sell.cs` is the transaction-entry UI for selling products. `cuahangmypham/Bill.cs` represents the resulting bill/invoice workflow, forming the core flow: select products → create sale → produce bill. This is the principal operational boundary where product availability, transaction data, and customer-facing output meet.

#### Reporting and Printed Output
`cuahangmypham/Report.cs` provides the reporting UI. Reports are backed by a typed dataset at `cuahangmypham/DataSet1.xsd` and a Crystal Reports definition at `cuahangmypham/CrystalReport1.rpt`; `cuahangmypham/CrystalReport1.cs` is the generated report binding. This creates a reporting boundary between transactional/store data and formatted output.

#### Company Data
`cuahangmypham/Company.cs` provides a dedicated company-information form. It likely supplies store identity/details used in administration and invoice/report presentation, while remaining separate from sales and inventory workflows.

#### Infrastructure and External Dependencies
Runtime configuration is centralized in `cuahangmypham/App.config`, including the likely database connection settings. A database backup is present at `MyphamStore.bak`, indicating Microsoft SQL Server-compatible backup data. The Debug output includes DevExpress 19.1 libraries and Crystal Reports artifacts, indicating third-party desktop UI/reporting dependencies; the application is distributed as `cuahangmypham/bin/Debug/cuahangmypham.exe`.

Main entry points: [`cuahangmypham/Main.cs`](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Main.cs) (Main shell), [`MyphamStore.bak`](https://github.com/doitsuminh/cuahangmypham/blob/master/MyphamStore.bak) (Store database), [`cuahangmypham/Program.cs`](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Program.cs) (Application entry), [`cuahangmypham/Sell.cs`](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Sell.cs) (Sales entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["WinForms UI"]
  node_entry["Application entry<br/>startup<br/>[Program.cs]"]
  node_login["Login<br/>authentication form<br/>[Login.cs]"]
  node_main["Main shell<br/>navigation form<br/>[Main.cs]"]
  node_products["Product catalog<br/>product form<br/>[ProductForm.cs]"]
  node_stock_in["Stock intake<br/>inventory form<br/>[ProductIn.cs]"]
  node_sell["Sales entry<br/>sales form<br/>[Sell.cs]"]
  node_bill["Billing<br/>invoice form<br/>[Bill.cs]"]
  node_company["Company data<br/>administration form<br/>[Company.cs]"]
end

subgraph group_reporting["Reporting"]
  node_report_ui["Reporting UI<br/>report form<br/>[Report.cs]"]
  node_dataset["Report dataset<br/>typed dataset<br/>[DataSet1.xsd]"]
  node_crystal_binding["Crystal report binding<br/>generated binding<br/>[CrystalReport1.cs]"]
  node_crystal_report["Crystal report template<br/>report definition<br/>[CrystalReport1.rpt]"]
end

subgraph group_data["Data &amp; Runtime"]
  node_app_config["Runtime configuration<br/>application config<br/>[App.config]"]
  node_store_db[("Store database<br/>SQL Server data<br/>[MyphamStore.bak]")]
end

node_project["WinForms project<br/>C&#35; project"]
node_desktop_exe["Desktop executable<br/>WinForms executable<br/>[cuahangmypham.exe]"]

node_project -->|"builds"| node_desktop_exe
node_entry -->|"opens"| node_login
node_login -->|"authenticated access"| node_main
node_main -->|"navigates to"| node_products
node_main -->|"navigates to"| node_stock_in
node_main -->|"navigates to"| node_sell
node_main -->|"navigates to"| node_bill
node_main -->|"navigates to"| node_company
node_main -->|"navigates to"| node_report_ui
node_products -->|"maintains products"| node_store_db
node_stock_in -->|"records inventory"| node_store_db
node_sell -->|"records sales"| node_store_db
node_sell -->|"creates sale bill"| node_bill
node_bill -->|"uses transaction data"| node_store_db
node_company -->|"maintains company data"| node_store_db
node_report_ui -->|"uses"| node_dataset
node_dataset -->|"sources data"| node_store_db
node_report_ui -->|"renders through"| node_crystal_binding
node_crystal_binding -->|"loads"| node_crystal_report
node_app_config -.->|"connection settings"| node_store_db
node_project -->|"defines startup build"| node_entry
node_entry -.->|"loads settings"| node_app_config

click node_project "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/cuahangmypham.csproj"
click node_entry "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Program.cs"
click node_login "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Login.cs"
click node_main "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Main.cs"
click node_products "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/ProductForm.cs"
click node_stock_in "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/ProductIn.cs"
click node_sell "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Sell.cs"
click node_bill "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Bill.cs"
click node_company "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Company.cs"
click node_report_ui "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Report.cs"
click node_dataset "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/DataSet1.xsd"
click node_crystal_binding "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/CrystalReport1.cs"
click node_crystal_report "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/CrystalReport1.rpt"
click node_app_config "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/App.config"
click node_store_db "https://github.com/doitsuminh/cuahangmypham/blob/master/MyphamStore.bak"
click node_desktop_exe "https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/bin/Debug/cuahangmypham.exe"

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_entry,node_login,node_main,node_products,node_stock_in,node_sell,node_bill,node_company toneBlue
class node_report_ui,node_dataset,node_crystal_binding,node_crystal_report toneAmber
class node_app_config,node_store_db toneMint
class node_project,node_desktop_exe toneNeutral
```

## Components

### WinForms UI

Desktop forms for store operations.

- [Application entry](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Program.cs): startup · Launches the desktop application. · `cuahangmypham/Program.cs`
- [Login](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Login.cs): authentication form · Authentication boundary before store access. · `cuahangmypham/Login.cs`
- [Main shell](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Main.cs): navigation form · Post-login navigation to operational forms. · `cuahangmypham/Main.cs`
- [Product catalog](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/ProductForm.cs): product form · Maintains product definitions. · `cuahangmypham/ProductForm.cs`
- [Stock intake](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/ProductIn.cs): inventory form · Records inbound inventory. · `cuahangmypham/ProductIn.cs`
- [Sales entry](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Sell.cs): sales form · Selects products and creates sales. · `cuahangmypham/Sell.cs`
- [Billing](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Bill.cs): invoice form · Produces sale bills and invoices. · `cuahangmypham/Bill.cs`
- [Company data](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Company.cs): administration form · Maintains store identity and details. · `cuahangmypham/Company.cs`

### Reporting

Typed data and Crystal Reports output.

- [Reporting UI](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/Report.cs): report form · Presents store reports. · `cuahangmypham/Report.cs`
- [Report dataset](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/DataSet1.xsd): typed dataset · Structured report data contract. · `cuahangmypham/DataSet1.xsd`
- [Crystal report binding](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/CrystalReport1.cs): generated binding · Binds application reporting to the report definition. · `cuahangmypham/CrystalReport1.cs`
- [Crystal report template](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/CrystalReport1.rpt): report definition · Formatted printable report output. · `cuahangmypham/CrystalReport1.rpt`

### Data & Runtime

Configured SQL Server-compatible store data.

- [Runtime configuration](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/App.config): application config · Centralizes runtime and database connection settings. · `cuahangmypham/App.config`
- [Store database](https://github.com/doitsuminh/cuahangmypham/blob/master/MyphamStore.bak): SQL Server data · Persistent products, inventory, sales, and company data. · `MyphamStore.bak`

### Other components

- [WinForms project](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/cuahangmypham.csproj): C# project · Build target and package dependencies. · `cuahangmypham/cuahangmypham.csproj`
- [Desktop executable](https://github.com/doitsuminh/cuahangmypham/blob/master/cuahangmypham/bin/Debug/cuahangmypham.exe): WinForms executable · Distributed Debug application output. · `cuahangmypham/bin/Debug/cuahangmypham.exe`

## Connections

- WinForms project → Desktop executable: builds
- Application entry → Login: opens
- Login → Main shell: authenticated access
- Main shell → Product catalog: navigates to
- Main shell → Stock intake: navigates to
- Main shell → Sales entry: navigates to
- Main shell → Billing: navigates to
- Main shell → Company data: navigates to
- Main shell → Reporting UI: navigates to
- Product catalog → Store database: maintains products
- Stock intake → Store database: records inventory
- Sales entry → Store database: records sales
- Sales entry → Billing: creates sale bill
- Billing → Store database: uses transaction data
- Company data → Store database: maintains company data
- Reporting UI → Report dataset: uses
- Report dataset → Store database: sources data
- Reporting UI → Crystal report binding: renders through
- Crystal report binding → Crystal report template: loads
- Runtime configuration → Store database: connection settings
- WinForms project → Application entry: defines startup build
- Application entry → Runtime configuration: loads settings
