From 004e3901f27c44edf209db14d313934d858a5ed1 Mon Sep 17 00:00:00 2001 From: Mikan <72257910+Mikan-DS@users.noreply.github.com> Date: Thu, 22 May 2025 20:26:15 +0300 Subject: [PATCH] base auth --- OfficeFlow/App.xaml | 27 +++- OfficeFlow/MainWindow.xaml.cs | 15 +-- OfficeFlow/OfficeFlow.csproj | 29 +++++ .../Pages/EmployeePages/NewEmployeePage.xaml | 14 ++ .../EmployeePages/NewEmployeePage.xaml.cs | 28 ++++ .../Pages/EmployeePages/NewUserPage.xaml | 14 ++ .../Pages/EmployeePages/NewUserPage.xaml.cs | 28 ++++ OfficeFlow/Pages/LoginPage.xaml | 46 +++++++ OfficeFlow/Pages/LoginPage.xaml.cs | 59 +++++++++ OfficeFlow/Pages/MainPage.xaml | 55 ++++++++ OfficeFlow/Pages/MainPage.xaml.cs | 64 +++++++++ .../StartupPages/CreateAdministratorPage.xaml | 50 +++++++- .../CreateAdministratorPage.xaml.cs | 101 ++++++++++++++- .../StartupPages/InitializeDataPage.xaml | 4 +- OfficeFlow/Utils/Session.cs | 121 ++++++++++++++++++ 15 files changed, 638 insertions(+), 17 deletions(-) create mode 100644 OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml create mode 100644 OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml.cs create mode 100644 OfficeFlow/Pages/EmployeePages/NewUserPage.xaml create mode 100644 OfficeFlow/Pages/EmployeePages/NewUserPage.xaml.cs create mode 100644 OfficeFlow/Pages/LoginPage.xaml create mode 100644 OfficeFlow/Pages/LoginPage.xaml.cs create mode 100644 OfficeFlow/Pages/MainPage.xaml create mode 100644 OfficeFlow/Pages/MainPage.xaml.cs create mode 100644 OfficeFlow/Utils/Session.cs diff --git a/OfficeFlow/App.xaml b/OfficeFlow/App.xaml index 54dfc52..5e82c02 100644 --- a/OfficeFlow/App.xaml +++ b/OfficeFlow/App.xaml @@ -4,6 +4,31 @@ xmlns:local="clr-namespace:OfficeFlow" StartupUri="MainWindow.xaml"> - + + + + diff --git a/OfficeFlow/MainWindow.xaml.cs b/OfficeFlow/MainWindow.xaml.cs index 2e6e4ba..3b4a610 100644 --- a/OfficeFlow/MainWindow.xaml.cs +++ b/OfficeFlow/MainWindow.xaml.cs @@ -1,17 +1,8 @@ -using System; -using System.Collections.Generic; +using OfficeFlow.Pages; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; using System.Windows.Navigation; -using System.Windows.Shapes; namespace OfficeFlow { @@ -28,6 +19,10 @@ namespace OfficeFlow { MainFrame.Navigate(new Pages.StartupPages.InitializeDataPage()); } + else + { + MainFrame.Navigate(new MainPage()); + } } diff --git a/OfficeFlow/OfficeFlow.csproj b/OfficeFlow/OfficeFlow.csproj index 9eb9bf1..d129894 100644 --- a/OfficeFlow/OfficeFlow.csproj +++ b/OfficeFlow/OfficeFlow.csproj @@ -64,6 +64,19 @@ MSBuild:Compile Designer + + NewEmployeePage.xaml + + + NewUserPage.xaml + + + LoginPage.xaml + + + MainPage.xaml + + MSBuild:Compile Designer @@ -76,6 +89,22 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml b/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml new file mode 100644 index 0000000..bf92057 --- /dev/null +++ b/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml.cs b/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml.cs new file mode 100644 index 0000000..6beb91d --- /dev/null +++ b/OfficeFlow/Pages/EmployeePages/NewEmployeePage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace OfficeFlow.Pages.EmployeePages +{ + /// + /// Interaction logic for NewEmployeePage.xaml + /// + public partial class NewEmployeePage : Page + { + public NewEmployeePage() + { + InitializeComponent(); + } + } +} diff --git a/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml b/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml new file mode 100644 index 0000000..28ca236 --- /dev/null +++ b/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml.cs b/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml.cs new file mode 100644 index 0000000..fe0caa2 --- /dev/null +++ b/OfficeFlow/Pages/EmployeePages/NewUserPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace OfficeFlow.Pages.EmployeePages +{ + /// + /// Interaction logic for NewUserPage.xaml + /// + public partial class NewUserPage : Page + { + public NewUserPage() + { + InitializeComponent(); + } + } +} diff --git a/OfficeFlow/Pages/LoginPage.xaml b/OfficeFlow/Pages/LoginPage.xaml new file mode 100644 index 0000000..662e3d5 --- /dev/null +++ b/OfficeFlow/Pages/LoginPage.xaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +