diff --git a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.metadata.v9.bin b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.metadata.v9.bin index 4962b51..64b763a 100644 Binary files a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.metadata.v9.bin and b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.metadata.v9.bin differ diff --git a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.projects.v9.bin b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.projects.v9.bin index d2078e4..dc7756a 100644 Binary files a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.projects.v9.bin and b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.projects.v9.bin differ diff --git a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.strings.v9.bin b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.strings.v9.bin index 1674a38..d80efdc 100644 Binary files a/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.strings.v9.bin and b/demo_blagodat/.vs/ProjectEvaluation/demo_blagodat.strings.v9.bin differ diff --git a/demo_blagodat/.vs/demo_blagodat/DesignTimeBuild/.dtbcache.v2 b/demo_blagodat/.vs/demo_blagodat/DesignTimeBuild/.dtbcache.v2 index 28eaa69..102fa24 100644 Binary files a/demo_blagodat/.vs/demo_blagodat/DesignTimeBuild/.dtbcache.v2 and b/demo_blagodat/.vs/demo_blagodat/DesignTimeBuild/.dtbcache.v2 differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/2749711f-8b86-493c-a9c6-107ac2e2433a.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/2749711f-8b86-493c-a9c6-107ac2e2433a.vsidx new file mode 100644 index 0000000..0a9d29c Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/2749711f-8b86-493c-a9c6-107ac2e2433a.vsidx differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/3630d8dd-e9cb-4487-a37f-438a18f27253.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/3630d8dd-e9cb-4487-a37f-438a18f27253.vsidx deleted file mode 100644 index 49eb620..0000000 Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/3630d8dd-e9cb-4487-a37f-438a18f27253.vsidx and /dev/null differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/44ea562a-57c0-441f-ab91-5bf72939ec04.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/44ea562a-57c0-441f-ab91-5bf72939ec04.vsidx deleted file mode 100644 index 3325746..0000000 Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/44ea562a-57c0-441f-ab91-5bf72939ec04.vsidx and /dev/null differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/53ae9b3a-b2d3-498e-9833-cc7c83dd472c.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/53ae9b3a-b2d3-498e-9833-cc7c83dd472c.vsidx deleted file mode 100644 index e23201f..0000000 Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/53ae9b3a-b2d3-498e-9833-cc7c83dd472c.vsidx and /dev/null differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/6392012d-8ccb-4c4b-800b-66aaefaa85b4.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/6392012d-8ccb-4c4b-800b-66aaefaa85b4.vsidx new file mode 100644 index 0000000..68439dc Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/6392012d-8ccb-4c4b-800b-66aaefaa85b4.vsidx differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/69d9c51c-01e5-47c1-b95b-7338aa161825.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/69d9c51c-01e5-47c1-b95b-7338aa161825.vsidx new file mode 100644 index 0000000..4b12800 Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/69d9c51c-01e5-47c1-b95b-7338aa161825.vsidx differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e7a282a3-c154-46a6-8c5a-09215c2c4c60.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e7a282a3-c154-46a6-8c5a-09215c2c4c60.vsidx deleted file mode 100644 index a627a61..0000000 Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e7a282a3-c154-46a6-8c5a-09215c2c4c60.vsidx and /dev/null differ diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e8a518db-57ef-49db-ade3-3a005116752b.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e8a518db-57ef-49db-ade3-3a005116752b.vsidx new file mode 100644 index 0000000..96cd2fa Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e8a518db-57ef-49db-ade3-3a005116752b.vsidx differ diff --git a/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2 b/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2 index a6bc3e9..3704f23 100644 Binary files a/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2 and b/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2 differ diff --git a/demo_blagodat/.vs/demo_blagodat/v17/.suo b/demo_blagodat/.vs/demo_blagodat/v17/.suo index a66b568..1912c65 100644 Binary files a/demo_blagodat/.vs/demo_blagodat/v17/.suo and b/demo_blagodat/.vs/demo_blagodat/v17/.suo differ diff --git a/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json b/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json index ca07ea2..38b022e 100644 --- a/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json +++ b/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json @@ -1,12 +1,7 @@ { "Version": 1, "WorkspaceRootPath": "C:\\Users\\VivoBook 15X\\Desktop\\\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u043D\u044B\u0435 \u043C\u043E\u0434\u0443\u043B\u0438\\Demo_Blagodat\\demo_blagodat\\demo_blagodat\\", - "Documents": [ - { - "AbsoluteMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|c:\\users\\vivobook 15x\\desktop\\\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u043D\u044B\u0435 \u043C\u043E\u0434\u0443\u043B\u0438\\demo_blagodat\\demo_blagodat\\demo_blagodat\\admin.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:admin.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - } - ], + "Documents": [], "DocumentGroupContainers": [ { "Orientation": 0, @@ -14,7 +9,7 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 2, + "SelectedChildIndex": -1, "Children": [ { "$type": "Bookmark", @@ -23,19 +18,6 @@ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" - }, - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "Admin.axaml.cs", - "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u043D\u044B\u0435 \u043C\u043E\u0434\u0443\u043B\u0438\\Demo_Blagodat\\demo_blagodat\\demo_blagodat\\Admin.axaml.cs", - "RelativeDocumentMoniker": "Admin.axaml.cs", - "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u043D\u044B\u0435 \u043C\u043E\u0434\u0443\u043B\u0438\\Demo_Blagodat\\demo_blagodat\\demo_blagodat\\Admin.axaml.cs", - "RelativeToolTip": "Admin.axaml.cs", - "ViewState": "AgIAAA8AAAAAAAAAAAAAACcAAAAvAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-02-25T14:35:58.682Z", - "EditorCaption": "" } ] } diff --git a/demo_blagodat/Authorization.axaml.cs b/demo_blagodat/Authorization.axaml.cs index 7da1b38..5f12462 100644 --- a/demo_blagodat/Authorization.axaml.cs +++ b/demo_blagodat/Authorization.axaml.cs @@ -10,68 +10,77 @@ using System.Linq; namespace demo_blagodat; public partial class Authorization : Window -{ - string? Login; - string? password; - +{ public Authorization() { InitializeComponent(); } + private void RegisterClick_OnClick(object? sender, RoutedEventArgs e) { new Registration().Show(); - Close(); + Close(); // } private void MainOneClikc(object? sender, RoutedEventArgs e) { - Login = LoginTextBox.Text; - password = PasswordTextBox.Text; - - User11Context db = new User11Context(); - var corrUser = db.Employees.Where(x => x.EmployeesLogin == Login && x.EmployeesPassword == password).FirstOrDefault(); - if (corrUser == null) + try { - Mess.Text = " "; - } - else - { - try + using (User11Context db = new User11Context()) // { - corrUser.EmployeesEntrance = true; - corrUser.EmployeesDateHour = TimeOnly.FromDateTime(DateTime.Now); - corrUser.EmployeesDateDay = DateOnly.FromDateTime(DateTime.Now); - db.SaveChanges(); + string? Login = LoginTextBox.Text; // + string? password = PasswordTextBox.Text; // - switch (corrUser.EmployeesPosition) - { - case "": AdminOneClikc(corrUser); break; - case "": SellerOneClikc(corrUser); break; - case " ": ShiftSupervisorOneClikc(corrUser); break; + if (Login != null && password != null) { + + var corrUser = db.Employees.Where(x => x.EmployeesLogin == Login && x.EmployeesPassword == password).FirstOrDefault(); // + if (corrUser == null) + { + Mess.Text = " . \n "; // + } + else + { + corrUser.EmployeesEntrance = true; // "" False True + corrUser.EmployeesDateHour = TimeOnly.FromDateTime(DateTime.Now); // " " + corrUser.EmployeesDateDay = DateOnly.FromDateTime(DateTime.Now); // " " + + db.SaveChanges(); // + + switch (corrUser.EmployeesPosition) // + { + case "": AdminOneClikc(corrUser); break; + case "": SellerOneClikc(corrUser); break; + case " ": ShiftSupervisorOneClikc(corrUser); break; + } + } + } + else + { + // NULL + if (Login != null) { Mess.Text = " "; } + else { Mess.Text = " "; } } - Close(); - } - catch (Exception ex) - { - Console.WriteLine("{0} Exception caught", ex.Message); } } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } } private void SellerOneClikc(Employee corrUser) { new Seller(corrUser).Show(); - Close(); + Close(); // } private void AdminOneClikc(Employee corrUser) { new Admin(corrUser).Show(); - Close(); + Close(); // } private void ShiftSupervisorOneClikc(Employee corrUser) { new ShiftSupervisor(corrUser).Show(); - Close(); + Close(); // } } diff --git a/demo_blagodat/AddClient.axaml b/demo_blagodat/Functions/AddClient.axaml similarity index 65% rename from demo_blagodat/AddClient.axaml rename to demo_blagodat/Functions/AddClient.axaml index 6f0cbe2..05484ef 100644 --- a/demo_blagodat/AddClient.axaml +++ b/demo_blagodat/Functions/AddClient.axaml @@ -4,26 +4,26 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="700" x:Class="demo_blagodat.AddClient" - Title="AddClient"> + Title="Добавление клиентов"> - - + + - - + + - - + + - + - + - +