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
new file mode 100644
index 0000000..49eb620
Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/3630d8dd-e9cb-4487-a37f-438a18f27253.vsidx 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
new file mode 100644
index 0000000..3325746
Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/44ea562a-57c0-441f-ab91-5bf72939ec04.vsidx differ
diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/a9fbd7d7-92ad-4b03-b90d-2d14a7f34fa9.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/a9fbd7d7-92ad-4b03-b90d-2d14a7f34fa9.vsidx
deleted file mode 100644
index 7e3c036..0000000
Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/a9fbd7d7-92ad-4b03-b90d-2d14a7f34fa9.vsidx and /dev/null differ
diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/d9607881-6dcd-477e-b98e-955e2e109395.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/d9607881-6dcd-477e-b98e-955e2e109395.vsidx
deleted file mode 100644
index b6eb1cb..0000000
Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/d9607881-6dcd-477e-b98e-955e2e109395.vsidx and /dev/null 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
new file mode 100644
index 0000000..a627a61
Binary files /dev/null and b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/e7a282a3-c154-46a6-8c5a-09215c2c4c60.vsidx differ
diff --git a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/f3341305-258b-4759-8a9c-88a546190d3e.vsidx b/demo_blagodat/.vs/demo_blagodat/FileContentIndex/f3341305-258b-4759-8a9c-88a546190d3e.vsidx
deleted file mode 100644
index 3038644..0000000
Binary files a/demo_blagodat/.vs/demo_blagodat/FileContentIndex/f3341305-258b-4759-8a9c-88a546190d3e.vsidx and /dev/null differ
diff --git a/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2 b/demo_blagodat/.vs/demo_blagodat/v17/.futdcache.v2
index b69f732..a6bc3e9 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 cbbc390..a66b568 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 470031b..ca07ea2 100644
--- a/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json
+++ b/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.backup.json
@@ -3,16 +3,8 @@
"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\\addclient.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:addclient.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "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\\addclient.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:addclient.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
- },
- {
- "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\\models\\client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:models\\client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
+ "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}"
}
],
"DocumentGroupContainers": [
@@ -22,7 +14,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
- "SelectedChildIndex": 4,
+ "SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
@@ -32,42 +24,17 @@
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
- {
- "$type": "Document",
- "DocumentIndex": 1,
- "Title": "AddClient.axaml",
- "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\\AddClient.axaml",
- "RelativeDocumentMoniker": "AddClient.axaml",
- "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\\AddClient.axaml",
- "RelativeToolTip": "AddClient.axaml",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
- "WhenOpened": "2025-02-25T10:23:27.314Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 2,
- "Title": "Client.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\\Models\\Client.cs",
- "RelativeDocumentMoniker": "Models\\Client.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\\Models\\Client.cs",
- "RelativeToolTip": "Models\\Client.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-02-19T17:13:36.115Z",
- "EditorCaption": ""
- },
{
"$type": "Document",
"DocumentIndex": 0,
- "Title": "AddClient.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\\AddClient.axaml.cs",
- "RelativeDocumentMoniker": "AddClient.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\\AddClient.axaml.cs",
- "RelativeToolTip": "AddClient.axaml.cs",
- "ViewState": "AgIAAC0AAAAAAAAAAAAAAEEAAAAdAAAAAAAAAA==",
+ "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-19T17:00:34.941Z",
+ "WhenOpened": "2025-02-25T14:35:58.682Z",
"EditorCaption": ""
}
]
diff --git a/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.json b/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.json
index ae1d0ef..38b022e 100644
--- a/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.json
+++ b/demo_blagodat/.vs/demo_blagodat/v17/DocumentLayout.json
@@ -1,20 +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\\addclient.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:addclient.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "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\\addclient.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:addclient.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
- },
- {
- "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\\models\\client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{B40AB1D5-A904-4458-95A8-8CAE49BE0884}|demo_blagodat.csproj|solutionrelative:models\\client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- }
- ],
+ "Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
@@ -22,7 +9,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
- "SelectedChildIndex": 4,
+ "SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
@@ -31,44 +18,6 @@
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
- },
- {
- "$type": "Document",
- "DocumentIndex": 1,
- "Title": "AddClient.axaml",
- "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\\AddClient.axaml",
- "RelativeDocumentMoniker": "AddClient.axaml",
- "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\\AddClient.axaml",
- "RelativeToolTip": "AddClient.axaml",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
- "WhenOpened": "2025-02-25T10:23:27.314Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 2,
- "Title": "Client.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\\Models\\Client.cs",
- "RelativeDocumentMoniker": "Models\\Client.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\\Models\\Client.cs",
- "RelativeToolTip": "Models\\Client.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-02-19T17:13:36.115Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 0,
- "Title": "AddClient.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\\AddClient.axaml.cs",
- "RelativeDocumentMoniker": "AddClient.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\\AddClient.axaml.cs",
- "RelativeToolTip": "AddClient.axaml.cs",
- "ViewState": "AgIAADMAAAAAAAAAAAAAADoAAABrAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-02-19T17:00:34.941Z",
- "EditorCaption": ""
}
]
}
diff --git a/demo_blagodat/AddClient.axaml b/demo_blagodat/AddClient.axaml
index 136a2b4..6f0cbe2 100644
--- a/demo_blagodat/AddClient.axaml
+++ b/demo_blagodat/AddClient.axaml
@@ -26,7 +26,7 @@
-
+
diff --git a/demo_blagodat/AddClient.axaml.cs b/demo_blagodat/AddClient.axaml.cs
index 1447d2f..afbe5f1 100644
--- a/demo_blagodat/AddClient.axaml.cs
+++ b/demo_blagodat/AddClient.axaml.cs
@@ -11,18 +11,14 @@ namespace demo_blagodat;
public partial class AddClient : Window
{
- public AddClient()
+ public Employee User;
+ public AddClient(Employee user)
{
InitializeComponent();
+ User = user;
}
- public void ExitAddToSeller(object sender, RoutedEventArgs e)
- {
- new Seller().Show();
- Close();
- }
-
- public void addclient(object sender, RoutedEventArgs e)
+ private void addclient(object sender, RoutedEventArgs e)
{
try
{
@@ -66,5 +62,33 @@ public partial class AddClient : Window
MesAdd.Text = "";
MesAddError.Text = " ";
}
+
+ }
+
+ private void ExitClik(object sender, RoutedEventArgs e)
+ {
+ switch (User.EmployeesPosition)
+ {
+ case "": AdminOneClikc(User); break;
+ case "": SellerOneClikc(User); break;
+ case " ": ShiftSupervisorOneClikc(User); break;
+ }
+ Close();
+ }
+
+ private void SellerOneClikc(Employee User)
+ {
+ new Seller(User).Show();
+ Close();
+ }
+ private void AdminOneClikc(Employee User)
+ {
+ new Admin(User).Show();
+ Close();
+ }
+ private void ShiftSupervisorOneClikc(Employee User)
+ {
+ new ShiftSupervisor(User).Show();
+ Close();
}
}
diff --git a/demo_blagodat/Admin.axaml b/demo_blagodat/Admin.axaml
index 8d9da56..b4c12e1 100644
--- a/demo_blagodat/Admin.axaml
+++ b/demo_blagodat/Admin.axaml
@@ -6,7 +6,10 @@
x:Class="demo_blagodat.Admin"
Title="Администратор">
-
-
+
+
+
+
+
diff --git a/demo_blagodat/Admin.axaml.cs b/demo_blagodat/Admin.axaml.cs
index 5291afc..be94fab 100644
--- a/demo_blagodat/Admin.axaml.cs
+++ b/demo_blagodat/Admin.axaml.cs
@@ -6,19 +6,51 @@ using System.Runtime.ExceptionServices;
using System;
using demo_blagodat.Models;
using Microsoft.EntityFrameworkCore;
+using System.Linq;
namespace demo_blagodat;
public partial class Admin : Window
{
- public Admin()
+ public Employee User;
+ public Admin(Employee user)
{
InitializeComponent();
+ User = user;
+ HelloUser.Text = HelloUser.Text + User.EmployeesName;
}
- public void Exit(object sender, RoutedEventArgs e)
- {
+ private void ExitAuthorization(object sender, RoutedEventArgs e)
+ {
new Authorization().Show();
+ using (User11Context db = new User11Context())
+ {
+ var corrUser = db.Employees.Where(x => x.EmployeesLogin == User.EmployeesLogin).FirstOrDefault();
+ corrUser.EmployeesEntrance = false;
+ db.SaveChanges();
+ }
Close();
}
-}
\ No newline at end of file
+
+ private void Exit(object sender, RoutedEventArgs e)
+ {
+ using (User11Context db = new User11Context())
+ {
+ var corrUser = db.Employees.Where(x => x.EmployeesLogin == User.EmployeesLogin).FirstOrDefault();
+ corrUser.EmployeesEntrance = false;
+ db.SaveChanges();
+ }
+ Close();
+ }
+
+ private void createOrder(object sender, RoutedEventArgs e)
+ {
+ new CreateOrder(User).Show();
+ Close();
+ }
+ private void addClient(object sender, RoutedEventArgs e)
+ {
+ new AddClient(User).Show();
+ Close();
+ }
+}
diff --git a/demo_blagodat/Authorization.axaml.cs b/demo_blagodat/Authorization.axaml.cs
index e60fc40..7da1b38 100644
--- a/demo_blagodat/Authorization.axaml.cs
+++ b/demo_blagodat/Authorization.axaml.cs
@@ -4,6 +4,7 @@ using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using demo_blagodat.Models;
using Microsoft.EntityFrameworkCore;
+using System;
using System.Linq;
namespace demo_blagodat;
@@ -12,9 +13,7 @@ public partial class Authorization : Window
{
string? Login;
string? password;
- static User11Context db = new User11Context();
-
-
+
public Authorization()
{
InitializeComponent();
@@ -30,35 +29,49 @@ public partial class Authorization : Window
Login = LoginTextBox.Text;
password = PasswordTextBox.Text;
- var corrUser = db.Employees.FirstOrDefault(x => x.EmployeesLogin == Login && x.EmployeesPassword == password);
+ User11Context db = new User11Context();
+ var corrUser = db.Employees.Where(x => x.EmployeesLogin == Login && x.EmployeesPassword == password).FirstOrDefault();
if (corrUser == null)
{
Mess.Text = " ";
}
else
{
- switch (corrUser.EmployeesPosition)
+ try
{
- case "": AdminOneClikc(); break;
- case "": SellerOneClikc(); break;
- case " ": ShiftSupervisorOneClikc(); break;
+ corrUser.EmployeesEntrance = 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;
+ }
+ Close();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine("{0} Exception caught", ex.Message);
}
}
}
- private void SellerOneClikc()
+ private void SellerOneClikc(Employee corrUser)
{
- new Seller().Show();
+ new Seller(corrUser).Show();
Close();
}
- private void AdminOneClikc()
+ private void AdminOneClikc(Employee corrUser)
{
- new Admin().Show();
+ new Admin(corrUser).Show();
Close();
}
- private void ShiftSupervisorOneClikc()
+ private void ShiftSupervisorOneClikc(Employee corrUser)
{
- new ShiftSupervisor().Show();
+ new ShiftSupervisor(corrUser).Show();
Close();
}
}
diff --git a/demo_blagodat/CreateOrder.axaml b/demo_blagodat/CreateOrder.axaml
index 179f70b..da6671e 100644
--- a/demo_blagodat/CreateOrder.axaml
+++ b/demo_blagodat/CreateOrder.axaml
@@ -5,5 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo_blagodat.CreateOrder"
Title="CreateOrder">
- Welcome to Avalonia!
+
+
+
diff --git a/demo_blagodat/CreateOrder.axaml.cs b/demo_blagodat/CreateOrder.axaml.cs
index 2c04159..eb79d70 100644
--- a/demo_blagodat/CreateOrder.axaml.cs
+++ b/demo_blagodat/CreateOrder.axaml.cs
@@ -1,13 +1,43 @@
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
+using demo_blagodat.Models;
namespace demo_blagodat;
public partial class CreateOrder : Window
{
- public CreateOrder()
+ public Employee User;
+ public CreateOrder(Employee user)
{
InitializeComponent();
+ User = user;
+ }
+ private void ExitClik(object sender, RoutedEventArgs e)
+ {
+ switch (User.EmployeesPosition)
+ {
+ case "": AdminOneClikc(User); break;
+ case "": SellerOneClikc(User); break;
+ case " ": ShiftSupervisorOneClikc(User); break;
+ }
+ Close();
+ }
+
+ private void SellerOneClikc(Employee User)
+ {
+ new Seller(User).Show();
+ Close();
+ }
+ private void AdminOneClikc(Employee User)
+ {
+ new Admin(User).Show();
+ Close();
+ }
+ private void ShiftSupervisorOneClikc(Employee User)
+ {
+ new ShiftSupervisor(User).Show();
+ Close();
}
}
\ No newline at end of file
diff --git a/demo_blagodat/Registration.axaml b/demo_blagodat/Registration.axaml
index 64e1676..02d11f4 100644
--- a/demo_blagodat/Registration.axaml
+++ b/demo_blagodat/Registration.axaml
@@ -15,7 +15,7 @@
-
+
diff --git a/demo_blagodat/Registration.axaml.cs b/demo_blagodat/Registration.axaml.cs
index 7b3cb62..e1e024b 100644
--- a/demo_blagodat/Registration.axaml.cs
+++ b/demo_blagodat/Registration.axaml.cs
@@ -57,17 +57,14 @@ public partial class Registration : Window
};
db.Employees.Add(newUser);
db.SaveChanges();
+
+ switch (PositionUser)
+ {
+ case "": SellerOneClikc(newUser); break;
+ case " ": ShiftSupervisorOneClikc(newUser); break;
+ }
+ UserLogin = LoginTextBox.Text;
}
-
-
- switch (PositionUser)
- {
- case "": SellerOneClikc(); break;
- case " ": ShiftSupervisorOneClikc(); break;
- }
- UserLogin = LoginTextBox.Text;
-
-
}
catch (Exception ex)
{
@@ -75,15 +72,15 @@ public partial class Registration : Window
}
}
- private void SellerOneClikc()
+ private void SellerOneClikc(Employee newUser)
{
- new Seller().Show();
+ new Seller(newUser).Show();
Close();
}
- private void ShiftSupervisorOneClikc()
+ private void ShiftSupervisorOneClikc(Employee newUser)
{
- new ShiftSupervisor().Show();
+ new ShiftSupervisor(newUser).Show();
Close();
}
}
diff --git a/demo_blagodat/Seller.axaml b/demo_blagodat/Seller.axaml
index e582f63..476092a 100644
--- a/demo_blagodat/Seller.axaml
+++ b/demo_blagodat/Seller.axaml
@@ -6,7 +6,8 @@
x:Class="demo_blagodat.Seller"
Title="Продавец">
-
+
+
diff --git a/demo_blagodat/Seller.axaml.cs b/demo_blagodat/Seller.axaml.cs
index 76723a1..22455b9 100644
--- a/demo_blagodat/Seller.axaml.cs
+++ b/demo_blagodat/Seller.axaml.cs
@@ -4,38 +4,52 @@ using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using demo_blagodat.Models;
using System.Linq;
+using System;
+using System.Runtime.ExceptionServices;
+using Microsoft.EntityFrameworkCore.Diagnostics;
namespace demo_blagodat;
public partial class Seller : Window
{
- public Seller()
+ public Employee User;
+ public Seller(Employee user)
{
InitializeComponent();
+ User = user;
+ HelloUser.Text = HelloUser.Text + User.EmployeesName;
}
- public void ExitAuthorization(object sender, RoutedEventArgs e)
+ private void ExitAuthorization(object sender, RoutedEventArgs e)
{
new Authorization().Show();
- Close();
- }
- public void Exit(object sender, RoutedEventArgs e)
- {
- //using(User11Context db = new User11Context())
- //{
- // var name = db.Employees.Where(it => it.EmployeesLogin == ).FirstOrDefault();
- // name.EmployeesEntrance = false;
- //}
+ using(User11Context db = new User11Context())
+ {
+ var corrUser = db.Employees.Where(x => x.EmployeesLogin == User.EmployeesLogin).FirstOrDefault();
+ corrUser.EmployeesEntrance = false;
+ db.SaveChanges();
+ }
Close();
}
- public void createOrder(object sender, RoutedEventArgs e)
+ private void Exit(object sender, RoutedEventArgs e)
{
- new CreateOrder().Show();
+ using (User11Context db = new User11Context())
+ {
+ var corrUser = db.Employees.Where(x => x.EmployeesLogin == User.EmployeesLogin).FirstOrDefault();
+ corrUser.EmployeesEntrance = false;
+ db.SaveChanges();
+ }
Close();
}
- public void addClient(object sender, RoutedEventArgs e)
+
+ private void createOrder(object sender, RoutedEventArgs e)
{
- new AddClient().Show();
+ new CreateOrder(User).Show();
+ Close();
+ }
+ private void addClient(object sender, RoutedEventArgs e)
+ {
+ new AddClient(User).Show();
Close();
}
}
diff --git a/demo_blagodat/ShiftSupervisor.axaml.cs b/demo_blagodat/ShiftSupervisor.axaml.cs
index 4f59ab0..bbc10a6 100644
--- a/demo_blagodat/ShiftSupervisor.axaml.cs
+++ b/demo_blagodat/ShiftSupervisor.axaml.cs
@@ -2,14 +2,17 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
+using demo_blagodat.Models;
namespace demo_blagodat;
public partial class ShiftSupervisor : Window
{
- public ShiftSupervisor()
+ public Employee User;
+ public ShiftSupervisor(Employee user)
{
InitializeComponent();
+ User = user;
}
public void Exit(object sender, RoutedEventArgs e)
{
diff --git a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.dll b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.dll
index 670308a..b43bd3d 100644
Binary files a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.dll and b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.dll differ
diff --git a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.exe b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.exe
index f08ec91..a24c683 100644
Binary files a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.exe and b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.exe differ
diff --git a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.pdb b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.pdb
index e3cc18b..b586ff2 100644
Binary files a/demo_blagodat/bin/Debug/net8.0/demo_blagodat.pdb and b/demo_blagodat/bin/Debug/net8.0/demo_blagodat.pdb differ
diff --git a/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.dll b/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.dll
index 670308a..b43bd3d 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.dll and b/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.dll differ
diff --git a/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.pdb b/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.pdb
index e3cc18b..b586ff2 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.pdb and b/demo_blagodat/obj/Debug/net8.0/Avalonia/demo_blagodat.pdb differ
diff --git a/demo_blagodat/obj/Debug/net8.0/Avalonia/resources b/demo_blagodat/obj/Debug/net8.0/Avalonia/resources
index 029d0c6..25f9745 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/Avalonia/resources and b/demo_blagodat/obj/Debug/net8.0/Avalonia/resources differ
diff --git a/demo_blagodat/obj/Debug/net8.0/apphost.exe b/demo_blagodat/obj/Debug/net8.0/apphost.exe
index f08ec91..a24c683 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/apphost.exe and b/demo_blagodat/obj/Debug/net8.0/apphost.exe differ
diff --git a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfo.cs b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfo.cs
index e4555b8..f766387 100644
--- a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfo.cs
+++ b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("demo_blagodat")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0992c9fef8521c73a8735a7b8a16ba3d717b541f")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2e74cf1d5d3ba7d67ec5e1e7f82eb3dbc9049a33")]
[assembly: System.Reflection.AssemblyProductAttribute("demo_blagodat")]
[assembly: System.Reflection.AssemblyTitleAttribute("demo_blagodat")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfoInputs.cache b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfoInputs.cache
index 5287bb1..8acf4dc 100644
--- a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfoInputs.cache
+++ b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.AssemblyInfoInputs.cache
@@ -1 +1 @@
-f9304feeaf31782ee00227108fa34886bbd476af9833cb4c4a0379a527764c0b
+71985eb52f2155cee0fce6b8282760c334b0f233c9de818568a3939bfb7ab19c
diff --git a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.dll b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.dll
index 21d3841..1c6a281 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.dll and b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.dll differ
diff --git a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.pdb b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.pdb
index 215e814..2826a06 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/demo_blagodat.pdb and b/demo_blagodat/obj/Debug/net8.0/demo_blagodat.pdb differ
diff --git a/demo_blagodat/obj/Debug/net8.0/ref/demo_blagodat.dll b/demo_blagodat/obj/Debug/net8.0/ref/demo_blagodat.dll
index 402d8ce..79fccb1 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/ref/demo_blagodat.dll and b/demo_blagodat/obj/Debug/net8.0/ref/demo_blagodat.dll differ
diff --git a/demo_blagodat/obj/Debug/net8.0/refint/Avalonia/demo_blagodat.dll b/demo_blagodat/obj/Debug/net8.0/refint/Avalonia/demo_blagodat.dll
index 402d8ce..79fccb1 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/refint/Avalonia/demo_blagodat.dll and b/demo_blagodat/obj/Debug/net8.0/refint/Avalonia/demo_blagodat.dll differ
diff --git a/demo_blagodat/obj/Debug/net8.0/refint/demo_blagodat.dll b/demo_blagodat/obj/Debug/net8.0/refint/demo_blagodat.dll
index c3aa9e0..369970c 100644
Binary files a/demo_blagodat/obj/Debug/net8.0/refint/demo_blagodat.dll and b/demo_blagodat/obj/Debug/net8.0/refint/demo_blagodat.dll differ