commit b4c15f6f7f5a01908f88960e60598e7f40d67b57 Author: Syed Mustafa Ahmed Naqvi Date: Mon Aug 24 12:35:29 2026 +0500 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f0b6d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# Local development secrets +src/HikvisionAttendanceManager.App/appsettings.Development.json + +.vs/ +bin/ +obj/ + +*.user +*.suo +*.userosscache +*.sln.docstates + +Debug/ +Release/ + +*.log + +.env +.env.* \ No newline at end of file diff --git a/HikvisionAttendanceManager.sln b/HikvisionAttendanceManager.sln new file mode 100644 index 0000000..34a38d0 --- /dev/null +++ b/HikvisionAttendanceManager.sln @@ -0,0 +1,19 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HikvisionAttendanceManager.App", "src\HikvisionAttendanceManager.App\HikvisionAttendanceManager.App.csproj", "{7E70BA02-5D8E-4CB1-BB72-5FB4B167D120}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E70BA02-5D8E-4CB1-BB72-5FB4B167D120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E70BA02-5D8E-4CB1-BB72-5FB4B167D120}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E70BA02-5D8E-4CB1-BB72-5FB4B167D120}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E70BA02-5D8E-4CB1-BB72-5FB4B167D120}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/HikvisionAttendanceManager.App/.schema-test/Program.cs b/src/HikvisionAttendanceManager.App/.schema-test/Program.cs new file mode 100644 index 0000000..b48b37a --- /dev/null +++ b/src/HikvisionAttendanceManager.App/.schema-test/Program.cs @@ -0,0 +1,23 @@ +using HikvisionAttendanceManager.App.Services; + +var hrms = new HrmsEmployeeService(); +try +{ + var sites = await hrms.GetLocationSitesAsync(CancellationToken.None); + Console.WriteLine("Sites: " + sites.Count); + if (sites.Count > 0) + { + var site = sites[0]; + var deps = await hrms.GetActiveDepartmentsBySiteAsync(site.Id, CancellationToken.None); + Console.WriteLine("Departments for site " + site.Id + ": " + deps.Count); + var search = await hrms.SearchEmployeesAsync("1", site.Id, CancellationToken.None); + Console.WriteLine("Search results: " + search.Count); + if (search.Count > 0) + Console.WriteLine("First: " + search[0].SerialNumber + " - " + search[0].Name); + } +} +catch (Exception ex) +{ + Console.WriteLine("FAIL: " + ex.Message); + if (ex.InnerException is not null) Console.WriteLine(ex.InnerException.Message); +} diff --git a/src/HikvisionAttendanceManager.App/App.xaml b/src/HikvisionAttendanceManager.App/App.xaml new file mode 100644 index 0000000..4c1765b --- /dev/null +++ b/src/HikvisionAttendanceManager.App/App.xaml @@ -0,0 +1,65 @@ + + + #2563EB + #1D4ED8 + #F4F7FB + #E6EBF3 + + + + + + + + + + + diff --git a/src/HikvisionAttendanceManager.App/App.xaml.cs b/src/HikvisionAttendanceManager.App/App.xaml.cs new file mode 100644 index 0000000..acf2f4a --- /dev/null +++ b/src/HikvisionAttendanceManager.App/App.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows; +using HikvisionAttendanceManager.App.Services; + +namespace HikvisionAttendanceManager.App; + +public partial class App : Application +{ + public App() + { + AppLogger.Initialize(); + AppLogger.Info("[STARTUP] Application starting"); + AppLogger.Info("[STARTUP] Configuration loaded"); + DispatcherUnhandledException += (_, args) => AppLogger.Error("Unhandled UI exception.", args.Exception); + } +} diff --git a/src/HikvisionAttendanceManager.App/AttendanceSyncView.xaml b/src/HikvisionAttendanceManager.App/AttendanceSyncView.xaml new file mode 100644 index 0000000..155db89 --- /dev/null +++ b/src/HikvisionAttendanceManager.App/AttendanceSyncView.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +