diff --git a/.idea/.idea.Demka_Snova_1/.idea/avalonia.xml b/.idea/.idea.Demka_Snova_1/.idea/avalonia.xml index 3da0de7..c8cfb4a 100644 --- a/.idea/.idea.Demka_Snova_1/.idea/avalonia.xml +++ b/.idea/.idea.Demka_Snova_1/.idea/avalonia.xml @@ -3,9 +3,13 @@ diff --git a/FunctionalWindow.axaml b/AdminWindow.axaml similarity index 81% rename from FunctionalWindow.axaml rename to AdminWindow.axaml index 08df357..adab3fd 100644 --- a/FunctionalWindow.axaml +++ b/AdminWindow.axaml @@ -3,7 +3,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="Demka_Snova_1.FunctionalWindow" - Title="FunctionalWindow"> + x:Class="Demka_Snova_1.AdminWindow" + Title="AdminWindow"> Welcome to Avalonia! diff --git a/FunctionalWindow.axaml.cs b/AdminWindow.axaml.cs similarity index 64% rename from FunctionalWindow.axaml.cs rename to AdminWindow.axaml.cs index 7b44b24..e06661d 100644 --- a/FunctionalWindow.axaml.cs +++ b/AdminWindow.axaml.cs @@ -4,9 +4,9 @@ using Avalonia.Markup.Xaml; namespace Demka_Snova_1; -public partial class FunctionalWindow : Window +public partial class AdminWindow : Window { - public FunctionalWindow() + public AdminWindow() { InitializeComponent(); } diff --git a/Demka_Snova_1.csproj b/Demka_Snova_1.csproj index ca8f47a..b8d173e 100644 --- a/Demka_Snova_1.csproj +++ b/Demka_Snova_1.csproj @@ -24,7 +24,10 @@ - + + + + diff --git a/Hardik/Conect/Dao/SotrudnikDao.cs b/Hardik/Conect/Dao/SotrudnikDao.cs index cf231b0..0c33496 100644 --- a/Hardik/Conect/Dao/SotrudnikDao.cs +++ b/Hardik/Conect/Dao/SotrudnikDao.cs @@ -5,7 +5,7 @@ namespace Demka_Snova_1.Hardik.Conect.Dao; public class SotrudnikDao { public int ID {get;set;} - public string Pozition {get;set;} + public static string Pozition {get;set;} public string Fio {get;set;} public static string Login {get;set;} public static string Pass {get;set;} diff --git a/Hardik/Date/Dostup.cs b/Hardik/Date/Dostup.cs new file mode 100644 index 0000000..8f2b4f5 --- /dev/null +++ b/Hardik/Date/Dostup.cs @@ -0,0 +1,20 @@ +namespace Demka_Snova_1.Hardik.Date; + +public interface ISeller + { + void CreateOrder(); + } + + public interface IStarshiy + { + void CreateOrder(); + void AcceptGoods(); + + } + + public interface IAdmin + { + void GenerateReports(); + void MonitorLoginHistory(); + void ManageMaterials(); + } diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs index 431e4d4..87297aa 100644 --- a/MainWindow.axaml.cs +++ b/MainWindow.axaml.cs @@ -7,52 +7,71 @@ namespace Demka_Snova_1; public partial class MainWindow : Window { private bool _isPasswordVisible = false; + private void InitializeComponent() - { + { AvaloniaXamlLoader.Load(this); } + public MainWindow() { InitializeComponent(); } + private void TogglePasswordButton_Click(object sender, RoutedEventArgs e) { _isPasswordVisible = !_isPasswordVisible; PasswordTextBox.PasswordChar = _isPasswordVisible ? '\0' : '*'; } - private void LoginButton_Click(object sender, RoutedEventArgs e) + + private void LoginButton_Click(object sender, RoutedEventArgs e) { string username = UsernameTextBox.Text; string password = PasswordTextBox.Text; - if (IsValidUser(username, password)) { - var funcWindow = new FunctionalWindow(); - funcWindow.Show(); + Window nextWindow = null; + switch (SotrudnikDao.Pozition) + { + case "Продавец": + nextWindow = new SellerWindow(); + break; + case "Старший смены": + nextWindow = new StarshiyWindow(); + break; + case "Администратор": + nextWindow = new AdminWindow(); + break; + default: + ShowErrorDialog("Неизвестная роль пользователя"); + return; + } + + nextWindow.Show(); this.Close(); } else - { - ShowErrorDialog(); - } - } - - private async void ShowErrorDialog() - { - var dialog = new Window { - Title = "Ошибка", - Content = "Неверный логин или пароль", - Width = 300, - Height = 200 - }; - await dialog.ShowDialog(this); - } + ShowErrorDialog("Неверный логин или пароль"); + } + + async void ShowErrorDialog(string mes) + { + var dialog = new Window + { + Title = "Ошибка", + Content = mes, + Width = 300, + Height = 200 + }; + await dialog.ShowDialog(this); + } + + bool IsValidUser(string username, string password) + { + return username == SotrudnikDao.Login && password == SotrudnikDao.Pass; + } + - private bool IsValidUser(string username, string password) - { - return username == SotrudnikDao.Login && password == SotrudnikDao.Pass; } - - } \ No newline at end of file diff --git a/SellerWindow.axaml b/SellerWindow.axaml new file mode 100644 index 0000000..c5299d2 --- /dev/null +++ b/SellerWindow.axaml @@ -0,0 +1,9 @@ + + Welcome to Avalonia! + diff --git a/SellerWindow.axaml.cs b/SellerWindow.axaml.cs new file mode 100644 index 0000000..8bb3ffc --- /dev/null +++ b/SellerWindow.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Demka_Snova_1; + +public partial class SellerWindow : Window +{ + public SellerWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/StarshiyWindow.axaml b/StarshiyWindow.axaml new file mode 100644 index 0000000..17a7bf8 --- /dev/null +++ b/StarshiyWindow.axaml @@ -0,0 +1,8 @@ + + diff --git a/StarshiyWindow.axaml.cs b/StarshiyWindow.axaml.cs new file mode 100644 index 0000000..851b382 --- /dev/null +++ b/StarshiyWindow.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Demka_Snova_1; + +public partial class StarshiyWindow : Window +{ + public StarshiyWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/bin/Debug/net8.0/Demka_Snova_1.dll b/bin/Debug/net8.0/Demka_Snova_1.dll index 6e79f9a..697b509 100644 Binary files a/bin/Debug/net8.0/Demka_Snova_1.dll and b/bin/Debug/net8.0/Demka_Snova_1.dll differ diff --git a/bin/Debug/net8.0/Demka_Snova_1.pdb b/bin/Debug/net8.0/Demka_Snova_1.pdb index 63a2243..09a7c6b 100644 Binary files a/bin/Debug/net8.0/Demka_Snova_1.pdb and b/bin/Debug/net8.0/Demka_Snova_1.pdb differ diff --git a/obj/Debug/net8.0/Avalonia/Demka_Snova_1.dll b/obj/Debug/net8.0/Avalonia/Demka_Snova_1.dll index 6e79f9a..697b509 100644 Binary files a/obj/Debug/net8.0/Avalonia/Demka_Snova_1.dll and b/obj/Debug/net8.0/Avalonia/Demka_Snova_1.dll differ diff --git a/obj/Debug/net8.0/Avalonia/Demka_Snova_1.pdb b/obj/Debug/net8.0/Avalonia/Demka_Snova_1.pdb index 63a2243..09a7c6b 100644 Binary files a/obj/Debug/net8.0/Avalonia/Demka_Snova_1.pdb and b/obj/Debug/net8.0/Avalonia/Demka_Snova_1.pdb differ diff --git a/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache b/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache index f6b6c50..b8a6ec8 100644 --- a/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache +++ b/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache @@ -1 +1 @@ -ee6d23eda34c1cfc781068f6657ce3dec5e9426b09f041f9aef45af723067c58 +29745a75820841542fa2c2c5a9d6b6beaa6ec9a89ad0c6c1c9d046e48bfc80e4 diff --git a/obj/Debug/net8.0/Avalonia/resources b/obj/Debug/net8.0/Avalonia/resources index 3f98737..0ae8121 100644 Binary files a/obj/Debug/net8.0/Avalonia/resources and b/obj/Debug/net8.0/Avalonia/resources differ diff --git a/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfo.cs b/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfo.cs index 9949736..5dfdcf2 100644 --- a/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfo.cs +++ b/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Demka_Snova_1")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+eb9909704e777a27e1fecb9dd0bd78be53a34c31")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b6d029f0b54073e0ebf25932bb61b695c248c8a2")] [assembly: System.Reflection.AssemblyProductAttribute("Demka_Snova_1")] [assembly: System.Reflection.AssemblyTitleAttribute("Demka_Snova_1")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfoInputs.cache b/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfoInputs.cache index 0aab154..dd6c302 100644 --- a/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/Demka_Snova_1.AssemblyInfoInputs.cache @@ -1 +1 @@ -3813d61eab3435d17a2006f3552a671fa68f357f222a9c200aca02797526040e +085bcc2aa465297637c4e04dda495e07ced23a12a13e81e25b3c1d74901d7cc6 diff --git a/obj/Debug/net8.0/Demka_Snova_1.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net8.0/Demka_Snova_1.GeneratedMSBuildEditorConfig.editorconfig index ab4554c..e532ae6 100644 --- a/obj/Debug/net8.0/Demka_Snova_1.GeneratedMSBuildEditorConfig.editorconfig +++ b/obj/Debug/net8.0/Demka_Snova_1.GeneratedMSBuildEditorConfig.editorconfig @@ -19,11 +19,17 @@ build_property.ProjectDir = /home/class_student/RiderProjects/Demka_Snova_1/ build_property.EnableComHosting = build_property.EnableGeneratedComInterfaceComImportInterop = -[/home/class_student/RiderProjects/Demka_Snova_1/App.axaml] +[/home/class_student/RiderProjects/Demka_Snova_1/AdminWindow.axaml] build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml -[/home/class_student/RiderProjects/Demka_Snova_1/FunctionalWindow.axaml] +[/home/class_student/RiderProjects/Demka_Snova_1/App.axaml] build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml [/home/class_student/RiderProjects/Demka_Snova_1/MainWindow.axaml] build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml + +[/home/class_student/RiderProjects/Demka_Snova_1/SellerWindow.axaml] +build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml + +[/home/class_student/RiderProjects/Demka_Snova_1/StarshiyWindow.axaml] +build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml diff --git a/obj/Debug/net8.0/Demka_Snova_1.dll b/obj/Debug/net8.0/Demka_Snova_1.dll index d5218fa..d5a02d2 100644 Binary files a/obj/Debug/net8.0/Demka_Snova_1.dll and b/obj/Debug/net8.0/Demka_Snova_1.dll differ diff --git a/obj/Debug/net8.0/Demka_Snova_1.pdb b/obj/Debug/net8.0/Demka_Snova_1.pdb index 00feb97..c5eab43 100644 Binary files a/obj/Debug/net8.0/Demka_Snova_1.pdb and b/obj/Debug/net8.0/Demka_Snova_1.pdb differ diff --git a/obj/Debug/net8.0/ref/Demka_Snova_1.dll b/obj/Debug/net8.0/ref/Demka_Snova_1.dll index 2aea209..b7a943c 100644 Binary files a/obj/Debug/net8.0/ref/Demka_Snova_1.dll and b/obj/Debug/net8.0/ref/Demka_Snova_1.dll differ diff --git a/obj/Debug/net8.0/refint/Avalonia/Demka_Snova_1.dll b/obj/Debug/net8.0/refint/Avalonia/Demka_Snova_1.dll index 2aea209..b7a943c 100644 Binary files a/obj/Debug/net8.0/refint/Avalonia/Demka_Snova_1.dll and b/obj/Debug/net8.0/refint/Avalonia/Demka_Snova_1.dll differ diff --git a/obj/Debug/net8.0/refint/Demka_Snova_1.dll b/obj/Debug/net8.0/refint/Demka_Snova_1.dll index 151e6e3..e755f64 100644 Binary files a/obj/Debug/net8.0/refint/Demka_Snova_1.dll and b/obj/Debug/net8.0/refint/Demka_Snova_1.dll differ diff --git a/obj/rider.project.model.nuget.info b/obj/rider.project.model.nuget.info index 094dcbc..0fa95da 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17386686056158970 \ No newline at end of file +17386687920300443 \ No newline at end of file