|
|
||
|---|---|---|
| .vscode | ||
| BadgePrinterPlatforms/Windows | ||
| Components | ||
| Converters | ||
| Documentation | ||
| Libs/Zebra | ||
| Models | ||
| Platforms | ||
| Properties | ||
| Resources | ||
| Services | ||
| wwwroot | ||
| .gitignore | ||
| App.xaml | ||
| App.xaml.cs | ||
| App.xaml.cs.md | ||
| App.xaml.md | ||
| AppLogger.cs | ||
| AppShell.xaml | ||
| AppShell.xaml.cs | ||
| CompanyPage.xaml | ||
| CompanyPage.xaml.cs | ||
| EmployeeFormPage.xaml | ||
| EmployeeFormPage.xaml.cs | ||
| EmployeePage.xaml | ||
| EmployeePage.xaml.cs | ||
| FrymasterBadgeApp.csproj | ||
| MainPage.xaml | ||
| MainPage.xaml.cs | ||
| MauiProgram.cs | ||
| README.md | ||
| SettingsPage.xaml | ||
| SettingsPage.xaml.cs | ||
| app.js | ||
README.md
Frymaster Badge App
A cross-platform .NET MAUI application for managing employee records, generating customizable ID badges, handling company profiles, and printing via local desktop printers. Features dynamic tab navigation, photo capture/cropping, barcode generation, and robust file-based logging.
📋 Prerequisites
| Requirement | Details |
|---|---|
| SDK | .NET 8.0 or later |
| Workload | maui workload installed (dotnet workload install maui) |
| IDE | Visual Studio 2022 (v17.8+) with MAUI, or VS Code + C# Dev Kit |
| Database | SQL Server (2019/2022/Express/Azure SQL) |
| Platform | Windows 10/11 (recommended for printing & file pickers) |
⚠️ Note: Printer APIs (
System.Drawing.Printing) and folder/file pickers used in this app are desktop-optimized. Mobile targets may require platform-specific fallbacks.
🗄️ Database Setup
- Create a database named
Frymasterin your SQL Server instance. - Run the following schema to create the required tables (matches application queries):
CREATE TABLE dbo.Companies (
ID INT IDENTITY(1,1) PRIMARY KEY,
Name NVARCHAR(100) NOT NULL,
Address NVARCHAR(200),
City NVARCHAR(100),
State NVARCHAR(50),
Zip NVARCHAR(20),
Logo NVARCHAR(255)
);
CREATE TABLE dbo.tblData (
Data1 NVARCHAR(50) PRIMARY KEY, -- Employee Record Number
Data2 NVARCHAR(100), -- First Name
LastName NVARCHAR(100),
Data3 NVARCHAR(100), -- Display Name
Data4 NVARCHAR(100), -- Additional Info
Data5 DATETIME, -- Issue/Start Date
Data7 NVARCHAR(10), -- Medical Indicator 1 (True/False)
Data8 NVARCHAR(10), -- Medical Indicator 2 (1/0 or True/False)
Active NVARCHAR(10), -- YES/NO
Data9 NVARCHAR(50), -- Badge Number
picCode NVARCHAR(255), -- Photo filename reference
cropX FLOAT DEFAULT 0,
cropY FLOAT DEFAULT 0,
cropScale FLOAT DEFAULT 1.0,
BadgeType NVARCHAR(50) DEFAULT 'OFFICE', -- OFFICE, GUEST, PLANT, MAINTENANCE, VENDOR
ToPrint BIT DEFAULT 0,
CdsPrinted BIT DEFAULT 0
);
⚙️ Configuration
- Create
appsettings.jsoninsideResources/Raw/ - Set its Build Action to
MauiAsset - Add your connection string:
{
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1;Database=Frymaster;User Id=sa;Password=YourSecurePassword;TrustServerCertificate=True;"
}
}
🔒 Security Note: The app contains a hardcoded fallback connection string in
MauiProgram.cs. Never deploy to production without providingappsettings.json, as the fallback uses plain-text credentials and will log a warning.
🛠️ Building & Running
✅ Using CLI
# Restore dependencies
dotnet restore
# Build
dotnet build -c Release
# Run (Windows Desktop default)
dotnet run -f net8.0-windows10.0.19041.0
✅ Using Visual Studio
- Open
FrymasterBadgeApp.csprojor.sln - Select your target framework in the toolbar (e.g.,
net8.0-windows10.0.19041.0) - Press
F5or click ▶ Run - The app will automatically restore NuGet packages and launch.
🚀 First Run & Navigation Flow
- Initial Setup Tab: If no companies exist in the database, the app shows a
Setuptab. Click it to add your first company viaCompanyPage. - Dynamic Tabs: Once companies are added, each gets its own tab in the bottom
TabBar. Tabs are generated dynamically at runtime. - Employee Management: Click a company tab → select/search employees → view/edit badge preview → capture/update photos → print.
- Settings: Use the top-right
⚙️icon to configure storage paths (C:\FrymasterData\...defaults) and UI theme (System/Light/Dark). - Company Management: Use the
🏢icon inAppShellto manage company records and upload logos.
📂 Storage & Paths
| Setting | Default | Notes |
|---|---|---|
| Photos | C:\FrymasterData\photos |
Stores employee JPGs ({recordNum}_{ticks}.jpg) |
| Logos | C:\FrymasterData\logos |
Stores company logo images |
| Images | C:\FrymasterData\images |
Stores guest/default badge assets |
| Logs | %LOCALAPPDATA% |
Rotates daily, max 5MB/file, 30-day auto-cleanup |
🌍 Cross-Platform Note: The
C:\...defaults are Windows-specific. On macOS/Linux, change paths immediately via the Settings Page to avoidUnauthorizedAccessExceptionor missing directory errors.
🐛 Troubleshooting
| Issue | Solution |
|---|---|
SqlService connection fails |
Verify SQL Server is running, check appsettings.json, ensure TrustServerCertificate=True |
| App crashes on startup | Check FrymasterBadgeApp_*.log in %LOCALAPPDATA% for DI or XAML errors |
| Missing tabs / "Loading..." stuck | Ensure at least one company exists in dbo.Companies |
Print fails / PrinterSettings empty |
Ensure desktop target is selected. Mobile platforms don't expose InstalledPrinters |
FolderPicker or Toast crashes |
Wrapped in try/catch. Intentionally disables auto-navigation after save to prevent Shell crashes |
| Missing barcode font | Ensure LibreBarcode39-Regular.ttf is in Resources/Fonts with Build Action: MauiFont |
📜 Logging & Diagnostics
- Location:
%LOCALAPPDATA%\FrymasterBadgeApp_YYYY-MM-DD.log - Rotation: Files >5MB are renamed to
.old(previous.oldis deleted) - Cleanup:
AppLogger.CleanupOldLogs()deletes logs older than 30 days - Viewing: Open with any text editor or run:
Get-ChildItem $env:LOCALAPPDATA\FrymasterBadgeApp_*.log | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | Invoke-Item
📄 License
Property of Frymaster
💡 Tip: Run
dotnet workload restorebefore first build if you encounter missing MAUI SDK errors. Ensure your.csprojtargets a supported Windows SDK version (net8.0-windows10.0.19041.0or higher).