# nguyenquocan5432-bot/lab_at_oosd architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenquocan5432-bot/lab_at_oosd
- Repository: https://github.com/nguyenquocan5432-bot/lab_at_oosd

## Overview

This tree contains two WinForms business applications: a library system and hotel-management implementations in LAB3 and an earlier LAB test variant. The user workflow is desktop navigation into domain forms, which delegate business operations to services that query or update SQL-backed records. The graph preserves the library circulation and catalog branches, plus hotel booking, amenities, service usage, checkout/payment, reporting, and reference-data capabilities. Some forms and service implementations were not sampled, so their links are omitted where caller evidence is unavailable.

Main entry points: [`LAB3/QuanLyKhachSan/Data/Db.cs`](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Data/Db.cs) (Hotel DB access), [`LAB3/QuanLyKhachSan/Forms/FrmMain.cs`](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmMain.cs) (Hotel navigation), [`LAB2/Quan_Ly_Thu_Vien/Forms/FrmMain.cs`](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmMain.cs) (Library navigation), [`LAB test/Data/Db.cs`](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Data/Db.cs) (Test DB access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library system"]
  node_lib_main["Library navigation<br/>[FrmMain.cs]"]
  node_lib_readers_ui["Reader records<br/>[FrmDocGia.cs]"]
  node_lib_readers["Reader service<br/>[DocGiaService.cs]"]
  node_lib_books_ui["Book catalog<br/>[FrmSach.cs]"]
  node_lib_books["Book service<br/>[SachService.cs]"]
  node_lib_loans_ui["Loans and returns<br/>[FrmMuonTra.cs]"]
  node_lib_loans["Circulation service<br/>[MuonTraService.cs]"]
  node_lib_categories["Library categories<br/>[DanhMucService.cs]"]
  node_lib_stats["Library reports<br/>[ThongKeService.cs]"]
  node_lib_stats_ui["Report screen<br/>[FrmThongKe.cs]"]
end

subgraph group_hotel["Hotel management"]
  node_hotel_main["Hotel navigation<br/>[FrmMain.cs]"]
  node_hotel_booking_ui["Room booking<br/>[FrmDatPhong.cs]"]
  node_hotel_booking["Booking service<br/>[DatPhongService.cs]"]
  node_hotel_services_ui["Service usage<br/>[FrmDichVu.cs]"]
  node_hotel_services["Service charges<br/>[DichVuService.cs]"]
  node_hotel_amenities_ui["Rooms and amenities"]
  node_hotel_amenities["Amenity service"]
  node_hotel_checkout_ui["Checkout and payment<br/>[FrmTraPhong.cs]"]
  node_hotel_checkout["Checkout service<br/>[TraPhongService.cs]"]
  node_hotel_categories["Hotel reference data<br/>[DanhMucService.cs]"]
  node_hotel_stats_ui["Hotel reports<br/>[FrmThongKe.cs]"]
  node_hotel_stats["Reporting service<br/>[ThongKeService.cs]"]
end

subgraph group_hotel_proto["Hotel test variant"]
  node_test_booking["Test booking service<br/>[Datphongservice.cs]"]
  node_test_checkout["Test checkout service<br/>[Traphong.cs]"]
  node_test_services["Test service usage<br/>[Dichvuservice.cs]"]
  node_test_amenities["Test amenities"]
end

subgraph group_shared["Persistence layer"]
  node_lib_db["Library DB access<br/>[Db.cs]"]
  node_hotel_db["Hotel DB access<br/>[Db.cs]"]
  node_test_db["Test DB access<br/>[Db.cs]"]
end

node_staff(("Staff user"))
node_sql_store[("SQL database")]

node_staff -.->|"opens"| node_lib_main
node_lib_main -.->|"opens"| node_lib_readers_ui
node_lib_main -.->|"opens"| node_lib_books_ui
node_lib_main -.->|"opens"| node_lib_loans_ui
node_lib_main -.->|"opens"| node_lib_stats_ui
node_lib_readers_ui -->|"calls"| node_lib_readers
node_lib_books_ui -->|"calls"| node_lib_books
node_lib_loans_ui -->|"calls"| node_lib_loans
node_lib_loans_ui -->|"calls"| node_lib_books
node_lib_loans_ui -->|"calls"| node_lib_readers
node_lib_readers -->|"queries"| node_lib_db
node_lib_books -->|"queries"| node_lib_db
node_lib_loans -->|"queries"| node_lib_db
node_lib_stats_ui -.->|"calls"| node_lib_stats
node_lib_categories -.->|"uses"| node_lib_db
node_lib_stats -.->|"uses"| node_lib_db
node_staff -.->|"opens"| node_hotel_main
node_hotel_main -.->|"opens"| node_hotel_booking_ui
node_hotel_main -.->|"opens"| node_hotel_services_ui
node_hotel_main -.->|"opens"| node_hotel_amenities_ui
node_hotel_main -.->|"opens"| node_hotel_checkout_ui
node_hotel_main -.->|"opens"| node_hotel_stats_ui
node_hotel_booking_ui -->|"calls"| node_hotel_booking
node_hotel_services_ui -->|"calls"| node_hotel_services
node_hotel_amenities_ui -->|"calls"| node_hotel_amenities
node_hotel_checkout_ui -->|"calls"| node_hotel_checkout
node_hotel_checkout_ui -->|"calls"| node_hotel_categories
node_hotel_booking -->|"queries"| node_hotel_db
node_hotel_services -->|"queries"| node_hotel_db
node_hotel_amenities -->|"queries"| node_hotel_db
node_hotel_checkout -->|"queries"| node_hotel_db
node_hotel_stats_ui -.->|"calls"| node_hotel_stats
node_hotel_categories -.->|"uses"| node_hotel_db
node_hotel_stats -.->|"uses"| node_hotel_db
node_hotel_db -.->|"queries"| node_sql_store
node_test_booking -->|"queries"| node_test_db
node_test_checkout -.->|"queries"| node_test_db
node_test_services -->|"queries"| node_test_db
node_test_amenities -->|"queries"| node_test_db
node_test_db -.->|"queries"| node_sql_store

click node_lib_main "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmMain.cs"
click node_lib_readers_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmDocGia.cs"
click node_lib_readers "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/DocGiaService.cs"
click node_lib_books_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmSach.cs"
click node_lib_books "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/SachService.cs"
click node_lib_loans_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs"
click node_lib_loans "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/MuonTraService.cs"
click node_lib_categories "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/DanhMucService.cs"
click node_lib_stats "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/ThongKeService.cs"
click node_lib_stats_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmThongKe.cs"
click node_hotel_main "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmMain.cs"
click node_hotel_booking_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmDatPhong.cs"
click node_hotel_booking "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DatPhongService.cs"
click node_hotel_services_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmDichVu.cs"
click node_hotel_services "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DichVuService.cs"
click node_hotel_amenities_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmPhongTienNghi.cs"
click node_hotel_amenities "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/PhongTienNghiService.cs"
click node_hotel_checkout_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmTraPhong.cs"
click node_hotel_checkout "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/TraPhongService.cs"
click node_hotel_categories "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DanhMucService.cs"
click node_hotel_stats_ui "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmThongKe.cs"
click node_hotel_stats "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/ThongKeService.cs"
click node_test_booking "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Datphongservice.cs"
click node_test_checkout "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Traphong.cs"
click node_test_services "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Dichvuservice.cs"
click node_test_amenities "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Phongtiennghiservice.cs"
click node_lib_db "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Data/Db.cs"
click node_hotel_db "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Data/Db.cs"
click node_test_db "https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Data/Db.cs"

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_lib_main,node_lib_readers_ui,node_lib_readers,node_lib_books_ui,node_lib_books,node_lib_loans_ui,node_lib_loans,node_lib_categories,node_lib_stats,node_lib_stats_ui,node_staff toneBlue
class node_hotel_main,node_hotel_booking_ui,node_hotel_booking,node_hotel_services_ui,node_hotel_services,node_hotel_amenities_ui,node_hotel_amenities,node_hotel_checkout_ui,node_hotel_checkout,node_hotel_categories,node_hotel_stats_ui,node_hotel_stats,node_sql_store toneAmber
class node_test_booking,node_test_checkout,node_test_services,node_test_amenities toneMint
class node_lib_db,node_hotel_db,node_test_db toneRose
```

## Components

### Library system

- [Library navigation](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmMain.cs): `LAB2/Quan_Ly_Thu_Vien/Forms/FrmMain.cs`
- [Reader records](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmDocGia.cs): `LAB2/Quan_Ly_Thu_Vien/Forms/FrmDocGia.cs`
- [Reader service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/DocGiaService.cs): `LAB2/Quan_Ly_Thu_Vien/Services/DocGiaService.cs`
- [Book catalog](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmSach.cs): `LAB2/Quan_Ly_Thu_Vien/Forms/FrmSach.cs`
- [Book service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/SachService.cs): `LAB2/Quan_Ly_Thu_Vien/Services/SachService.cs`
- [Loans and returns](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs): `LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs`
- [Circulation service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/MuonTraService.cs): `LAB2/Quan_Ly_Thu_Vien/Services/MuonTraService.cs`
- [Library categories](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/DanhMucService.cs): `LAB2/Quan_Ly_Thu_Vien/Services/DanhMucService.cs`
- [Library reports](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Services/ThongKeService.cs): `LAB2/Quan_Ly_Thu_Vien/Services/ThongKeService.cs`
- [Report screen](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Forms/FrmThongKe.cs): `LAB2/Quan_Ly_Thu_Vien/Forms/FrmThongKe.cs`

### Hotel management

- [Hotel navigation](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmMain.cs): `LAB3/QuanLyKhachSan/Forms/FrmMain.cs`
- [Room booking](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmDatPhong.cs): `LAB3/QuanLyKhachSan/Forms/FrmDatPhong.cs`
- [Booking service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DatPhongService.cs): `LAB3/QuanLyKhachSan/Services/DatPhongService.cs`
- [Service usage](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmDichVu.cs): `LAB3/QuanLyKhachSan/Forms/FrmDichVu.cs`
- [Service charges](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DichVuService.cs): `LAB3/QuanLyKhachSan/Services/DichVuService.cs`
- [Rooms and amenities](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmPhongTienNghi.cs): `LAB3/QuanLyKhachSan/Forms/FrmPhongTienNghi.cs`
- [Amenity service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/PhongTienNghiService.cs): `LAB3/QuanLyKhachSan/Services/PhongTienNghiService.cs`
- [Checkout and payment](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmTraPhong.cs): `LAB3/QuanLyKhachSan/Forms/FrmTraPhong.cs`
- [Checkout service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/TraPhongService.cs): `LAB3/QuanLyKhachSan/Services/TraPhongService.cs`
- [Hotel reference data](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/DanhMucService.cs): `LAB3/QuanLyKhachSan/Services/DanhMucService.cs`
- [Hotel reports](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Forms/FrmThongKe.cs): `LAB3/QuanLyKhachSan/Forms/FrmThongKe.cs`
- [Reporting service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Services/ThongKeService.cs): `LAB3/QuanLyKhachSan/Services/ThongKeService.cs`

### Hotel test variant

- [Test booking service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Datphongservice.cs): `LAB test/Services/Datphongservice.cs`
- [Test checkout service](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Traphong.cs): `LAB test/Services/Traphong.cs`
- [Test service usage](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Dichvuservice.cs): `LAB test/Services/Dichvuservice.cs`
- [Test amenities](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Services/Phongtiennghiservice.cs): `LAB test/Services/Phongtiennghiservice.cs`

### Persistence layer

- [Library DB access](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB2/Quan_Ly_Thu_Vien/Data/Db.cs): `LAB2/Quan_Ly_Thu_Vien/Data/Db.cs`
- [Hotel DB access](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB3/QuanLyKhachSan/Data/Db.cs): `LAB3/QuanLyKhachSan/Data/Db.cs`
- [Test DB access](https://github.com/nguyenquocan5432-bot/lab_at_oosd/blob/main/LAB%20test/Data/Db.cs): `LAB test/Data/Db.cs`

### Other components

- **Staff user**
- **SQL database**

## Connections

- Staff user → Library navigation: opens
- Library navigation → Reader records: opens
- Library navigation → Book catalog: opens
- Library navigation → Loans and returns: opens
- Library navigation → Report screen: opens
- Reader records → Reader service: calls (evidence: `LAB2/Quan_Ly_Thu_Vien/Forms/FrmDocGia.cs`)
- Book catalog → Book service: calls (evidence: `LAB2/Quan_Ly_Thu_Vien/Forms/FrmSach.cs`)
- Loans and returns → Circulation service: calls (evidence: `LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs`)
- Loans and returns → Book service: calls (evidence: `LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs`)
- Loans and returns → Reader service: calls (evidence: `LAB2/Quan_Ly_Thu_Vien/Forms/FrmMuonTra.cs`)
- Reader service → Library DB access: queries (evidence: `LAB2/Quan_Ly_Thu_Vien/Services/DocGiaService.cs`)
- Book service → Library DB access: queries (evidence: `LAB2/Quan_Ly_Thu_Vien/Services/SachService.cs`)
- Circulation service → Library DB access: queries (evidence: `LAB2/Quan_Ly_Thu_Vien/Services/MuonTraService.cs`)
- Report screen → Library reports: calls
- Library categories → Library DB access: uses
- Library reports → Library DB access: uses
- Staff user → Hotel navigation: opens
- Hotel navigation → Room booking: opens
- Hotel navigation → Service usage: opens
- Hotel navigation → Rooms and amenities: opens
- Hotel navigation → Checkout and payment: opens
- Hotel navigation → Hotel reports: opens
- Room booking → Booking service: calls (evidence: `LAB3/QuanLyKhachSan/Forms/FrmDatPhong.cs`)
- Service usage → Service charges: calls (evidence: `LAB3/QuanLyKhachSan/Forms/FrmDichVu.cs`)
- Rooms and amenities → Amenity service: calls (evidence: `LAB3/QuanLyKhachSan/Forms/FrmPhongTienNghi.cs`)
- Checkout and payment → Checkout service: calls (evidence: `LAB3/QuanLyKhachSan/Forms/FrmTraPhong.cs`)
- Checkout and payment → Hotel reference data: calls (evidence: `LAB3/QuanLyKhachSan/Forms/FrmTraPhong.cs`)
- Booking service → Hotel DB access: queries (evidence: `LAB3/QuanLyKhachSan/Services/DatPhongService.cs`)
- Service charges → Hotel DB access: queries (evidence: `LAB3/QuanLyKhachSan/Services/DichVuService.cs`)
- Amenity service → Hotel DB access: queries (evidence: `LAB3/QuanLyKhachSan/Services/PhongTienNghiService.cs`)
- Checkout service → Hotel DB access: queries (evidence: `LAB3/QuanLyKhachSan/Services/TraPhongService.cs`)
- Hotel reports → Reporting service: calls
- Hotel reference data → Hotel DB access: uses
- Reporting service → Hotel DB access: uses
- Hotel DB access → SQL database: queries
- Test booking service → Test DB access: queries (evidence: `LAB test/Services/Datphongservice.cs`)
- Test checkout service → Test DB access: queries
- Test service usage → Test DB access: queries (evidence: `LAB test/Services/Dichvuservice.cs`)
- Test amenities → Test DB access: queries (evidence: `LAB test/Services/Phongtiennghiservice.cs`)
- Test DB access → SQL database: queries
