# thanhtin6008/accessdatabase architecture

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

- Interactive diagram: https://gitdiagram.com/thanhtin6008/accessdatabase
- Repository: https://github.com/thanhtin6008/accessdatabase

## Overview

This Windows Forms utility combines spreadsheet-to-SQL import with database-oriented code generation. The principal visible workflow starts at ImportData, where the user supplies a workbook, sheet, destination table, and connection details; Form2 also demonstrates reading Excel data, mapping ITEM_INFO records, and bulk-copying them to SQL. Form1 provides a separate schema/entity and mapping-code generation interface and can open Form2. ImportData.cs and several supporting files were not sampled, so links for their internal behavior are omitted where wiring cannot be confirmed.

Main entry points: [`Form1.cs`](https://github.com/thanhtin6008/accessdatabase/blob/master/Form1.cs) (Generator screen), [`Form2.cs`](https://github.com/thanhtin6008/accessdatabase/blob/master/Form2.cs) (Import dialog), [`ImportData.cs`](https://github.com/thanhtin6008/accessdatabase/blob/master/ImportData.cs) (Import screen), [`ExcelReader.cs`](https://github.com/thanhtin6008/accessdatabase/blob/master/ExcelReader.cs) (Excel reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Windows Forms UI"]
  node_program["Application entry<br/>[Program.cs]"]
  node_importdata["Import screen<br/>[ImportData.cs]"]
  node_form1["Generator screen<br/>[Form1.cs]"]
  node_form2["Import dialog<br/>[Form2.cs]"]
end

subgraph group_import["Spreadsheet Import"]
  node_excel["Excel reader<br/>[ExcelReader.cs]"]
end

subgraph group_generation["Code Generation"]
  node_mapping["Mapping metadata<br/>[MappingInfo.cs]"]
  node_tableinfo["Table metadata<br/>[TableInfo.cs]"]
  node_infocolumn["Column metadata<br/>[InfoColum.cs]"]
end

subgraph group_data["Data Access"]
  node_itemmodel["Item model"]
  node_helper["Shared helpers<br/>[Helper.cs]"]
end

node_user(("User"))
node_excelbook["Excel workbook"]
node_sqlserver[("SQL Server")]

node_user -->|"sets import inputs"| node_importdata
node_program -->|"launches"| node_importdata
node_user -->|"uses generator"| node_form1
node_form1 -->|"opens dialog"| node_form2
node_form2 -->|"reads workbook"| node_excel
node_excelbook -->|"provides sheets"| node_excel
node_form2 -->|"maps records"| node_itemmodel
node_form2 -->|"bulk copies"| node_sqlserver
node_form1 -->|"queries schema"| node_sqlserver
node_form1 -->|"uses mappings"| node_mapping
node_form1 -->|"uses table metadata"| node_tableinfo
node_form1 -->|"uses column metadata"| node_infocolumn

click node_program "https://github.com/thanhtin6008/accessdatabase/blob/master/Program.cs"
click node_importdata "https://github.com/thanhtin6008/accessdatabase/blob/master/ImportData.cs"
click node_form1 "https://github.com/thanhtin6008/accessdatabase/blob/master/Form1.cs"
click node_form2 "https://github.com/thanhtin6008/accessdatabase/blob/master/Form2.cs"
click node_excel "https://github.com/thanhtin6008/accessdatabase/blob/master/ExcelReader.cs"
click node_itemmodel "https://github.com/thanhtin6008/accessdatabase/blob/master/DataClasses1.designer.cs"
click node_mapping "https://github.com/thanhtin6008/accessdatabase/blob/master/MappingInfo.cs"
click node_tableinfo "https://github.com/thanhtin6008/accessdatabase/blob/master/TableInfo.cs"
click node_infocolumn "https://github.com/thanhtin6008/accessdatabase/blob/master/InfoColum.cs"
click node_helper "https://github.com/thanhtin6008/accessdatabase/blob/master/Helper.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_program,node_importdata,node_form1,node_form2,node_user toneBlue
class node_excel,node_sqlserver toneAmber
class node_mapping,node_tableinfo,node_infocolumn toneMint
class node_itemmodel,node_helper toneRose
class node_excelbook toneIndigo
```

## Components

### Windows Forms UI

- [Application entry](https://github.com/thanhtin6008/accessdatabase/blob/master/Program.cs): `Program.cs`
- [Import screen](https://github.com/thanhtin6008/accessdatabase/blob/master/ImportData.cs): `ImportData.cs`
- [Generator screen](https://github.com/thanhtin6008/accessdatabase/blob/master/Form1.cs): `Form1.cs`
- [Import dialog](https://github.com/thanhtin6008/accessdatabase/blob/master/Form2.cs): `Form2.cs`

### Spreadsheet Import

- [Excel reader](https://github.com/thanhtin6008/accessdatabase/blob/master/ExcelReader.cs): `ExcelReader.cs`

### Code Generation

- [Mapping metadata](https://github.com/thanhtin6008/accessdatabase/blob/master/MappingInfo.cs): `MappingInfo.cs`
- [Table metadata](https://github.com/thanhtin6008/accessdatabase/blob/master/TableInfo.cs): `TableInfo.cs`
- [Column metadata](https://github.com/thanhtin6008/accessdatabase/blob/master/InfoColum.cs): `InfoColum.cs`

### Data Access

- [Item model](https://github.com/thanhtin6008/accessdatabase/blob/master/DataClasses1.designer.cs): `DataClasses1.designer.cs`
- [Shared helpers](https://github.com/thanhtin6008/accessdatabase/blob/master/Helper.cs): `Helper.cs`

### Other components

- **User**
- **Excel workbook**
- **SQL Server**

## Connections

- User → Import screen: sets import inputs
- Application entry → Import screen: launches
- User → Generator screen: uses generator
- Generator screen → Import dialog: opens dialog
- Import dialog → Excel reader: reads workbook
- Excel workbook → Excel reader: provides sheets
- Import dialog → Item model: maps records
- Import dialog → SQL Server: bulk copies
- Generator screen → SQL Server: queries schema
- Generator screen → Mapping metadata: uses mappings
- Generator screen → Table metadata: uses table metadata
- Generator screen → Column metadata: uses column metadata
