diff --git a/.vs/Agents/DesignTimeBuild/.dtbcache.v2 b/.vs/Agents/DesignTimeBuild/.dtbcache.v2
index e9c339e..99705cc 100644
Binary files a/.vs/Agents/DesignTimeBuild/.dtbcache.v2 and b/.vs/Agents/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/Agents/FileContentIndex/0e2a3a81-72ee-47c9-b98e-cb6cc68081b5.vsidx b/.vs/Agents/FileContentIndex/0e2a3a81-72ee-47c9-b98e-cb6cc68081b5.vsidx
deleted file mode 100644
index 62a9085..0000000
Binary files a/.vs/Agents/FileContentIndex/0e2a3a81-72ee-47c9-b98e-cb6cc68081b5.vsidx and /dev/null differ
diff --git a/.vs/Agents/FileContentIndex/16d45c88-3fcc-405d-b8d2-0e7ea0a07290.vsidx b/.vs/Agents/FileContentIndex/16d45c88-3fcc-405d-b8d2-0e7ea0a07290.vsidx
new file mode 100644
index 0000000..c4c20c9
Binary files /dev/null and b/.vs/Agents/FileContentIndex/16d45c88-3fcc-405d-b8d2-0e7ea0a07290.vsidx differ
diff --git a/.vs/Agents/FileContentIndex/23e7424a-6170-401a-b57b-186f418ed294.vsidx b/.vs/Agents/FileContentIndex/23e7424a-6170-401a-b57b-186f418ed294.vsidx
deleted file mode 100644
index 70aef67..0000000
Binary files a/.vs/Agents/FileContentIndex/23e7424a-6170-401a-b57b-186f418ed294.vsidx and /dev/null differ
diff --git a/.vs/Agents/FileContentIndex/c5326d1f-4a42-4b3d-acb3-568220a1eeb7.vsidx b/.vs/Agents/FileContentIndex/4f1e1217-2f24-4044-832f-610126933b49.vsidx
similarity index 99%
rename from .vs/Agents/FileContentIndex/c5326d1f-4a42-4b3d-acb3-568220a1eeb7.vsidx
rename to .vs/Agents/FileContentIndex/4f1e1217-2f24-4044-832f-610126933b49.vsidx
index e011d95..3b8e409 100644
Binary files a/.vs/Agents/FileContentIndex/c5326d1f-4a42-4b3d-acb3-568220a1eeb7.vsidx and b/.vs/Agents/FileContentIndex/4f1e1217-2f24-4044-832f-610126933b49.vsidx differ
diff --git a/.vs/Agents/FileContentIndex/5d712f01-4824-4d10-9f5c-4dea9e49c10b.vsidx b/.vs/Agents/FileContentIndex/5d712f01-4824-4d10-9f5c-4dea9e49c10b.vsidx
deleted file mode 100644
index 70aef67..0000000
Binary files a/.vs/Agents/FileContentIndex/5d712f01-4824-4d10-9f5c-4dea9e49c10b.vsidx and /dev/null differ
diff --git a/.vs/Agents/FileContentIndex/5f3d1b10-a437-4d8e-98b8-eeab778e0d2b.vsidx b/.vs/Agents/FileContentIndex/5f3d1b10-a437-4d8e-98b8-eeab778e0d2b.vsidx
new file mode 100644
index 0000000..99391ac
Binary files /dev/null and b/.vs/Agents/FileContentIndex/5f3d1b10-a437-4d8e-98b8-eeab778e0d2b.vsidx differ
diff --git a/.vs/Agents/FileContentIndex/7ff65c3d-1788-41b2-9adc-5b8c55af1274.vsidx b/.vs/Agents/FileContentIndex/7ff65c3d-1788-41b2-9adc-5b8c55af1274.vsidx
new file mode 100644
index 0000000..2cff458
Binary files /dev/null and b/.vs/Agents/FileContentIndex/7ff65c3d-1788-41b2-9adc-5b8c55af1274.vsidx differ
diff --git a/.vs/Agents/FileContentIndex/8ec3dd5e-e653-48cc-9e9a-0325adccd242.vsidx b/.vs/Agents/FileContentIndex/8ec3dd5e-e653-48cc-9e9a-0325adccd242.vsidx
deleted file mode 100644
index 7d059fd..0000000
Binary files a/.vs/Agents/FileContentIndex/8ec3dd5e-e653-48cc-9e9a-0325adccd242.vsidx and /dev/null differ
diff --git a/.vs/Agents/FileContentIndex/d2d07d62-f1a3-4de3-9f14-21ac12f57312.vsidx b/.vs/Agents/FileContentIndex/d2d07d62-f1a3-4de3-9f14-21ac12f57312.vsidx
new file mode 100644
index 0000000..01497fd
Binary files /dev/null and b/.vs/Agents/FileContentIndex/d2d07d62-f1a3-4de3-9f14-21ac12f57312.vsidx differ
diff --git a/.vs/Agents/v17/.futdcache.v2 b/.vs/Agents/v17/.futdcache.v2
index ed82414..4123c6b 100644
Binary files a/.vs/Agents/v17/.futdcache.v2 and b/.vs/Agents/v17/.futdcache.v2 differ
diff --git a/.vs/Agents/v17/.suo b/.vs/Agents/v17/.suo
index 6b7e7cb..d37c07c 100644
Binary files a/.vs/Agents/v17/.suo and b/.vs/Agents/v17/.suo differ
diff --git a/.vs/Agents/v17/DocumentLayout.backup.json b/.vs/Agents/v17/DocumentLayout.backup.json
index 1689621..cac2043 100644
--- a/.vs/Agents/v17/DocumentLayout.backup.json
+++ b/.vs/Agents/v17/DocumentLayout.backup.json
@@ -3,24 +3,8 @@
"WorkspaceRootPath": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\",
"Documents": [
{
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\productsale.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\productsale.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
+ "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
+ "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
}
],
"DocumentGroupContainers": [
@@ -30,74 +14,22 @@
"DocumentGroups": [
{
"DockedWidth": 200,
- "SelectedChildIndex": 5,
+ "SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
- {
- "$type": "Document",
- "DocumentIndex": 3,
- "Title": "Productsale.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Productsale.cs",
- "RelativeDocumentMoniker": "Models\\Productsale.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Productsale.cs",
- "RelativeToolTip": "Models\\Productsale.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAcAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T07:39:36.75Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 2,
- "Title": "Product.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Product.cs",
- "RelativeDocumentMoniker": "Models\\Product.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Product.cs",
- "RelativeToolTip": "Models\\Product.cs",
- "ViewState": "AgIAAAMAAAAAAAAAAAAgwA0AAAAfAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T07:18:40.508Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 4,
- "Title": "Agent.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
- "RelativeDocumentMoniker": "Models\\Agent.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
- "RelativeToolTip": "Models\\Agent.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAaAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T06:30:30.068Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 1,
- "Title": "MainWindow.axaml.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
- "RelativeDocumentMoniker": "MainWindow.axaml.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
- "RelativeToolTip": "MainWindow.axaml.cs",
- "ViewState": "AgIAACQAAAAAAAAAAAAcwDAAAAAhAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T06:24:34.479Z",
- "EditorCaption": ""
- },
{
"$type": "Document",
"DocumentIndex": 0,
- "Title": "MainWindow.axaml",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
- "RelativeDocumentMoniker": "MainWindow.axaml",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
- "RelativeToolTip": "MainWindow.axaml",
+ "Title": "AddProduct.axaml",
+ "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
+ "RelativeDocumentMoniker": "Functions\\AddProduct.axaml",
+ "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
+ "RelativeToolTip": "Functions\\AddProduct.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
- "WhenOpened": "2025-03-24T06:24:32.359Z",
+ "WhenOpened": "2025-03-25T20:22:51.155Z",
"EditorCaption": ""
}
]
diff --git a/.vs/Agents/v17/DocumentLayout.json b/.vs/Agents/v17/DocumentLayout.json
index 1689621..cac2043 100644
--- a/.vs/Agents/v17/DocumentLayout.json
+++ b/.vs/Agents/v17/DocumentLayout.json
@@ -3,24 +3,8 @@
"WorkspaceRootPath": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\",
"Documents": [
{
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\productsale.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\productsale.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
- },
- {
- "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
- "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
+ "AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
+ "RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
}
],
"DocumentGroupContainers": [
@@ -30,74 +14,22 @@
"DocumentGroups": [
{
"DockedWidth": 200,
- "SelectedChildIndex": 5,
+ "SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
- {
- "$type": "Document",
- "DocumentIndex": 3,
- "Title": "Productsale.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Productsale.cs",
- "RelativeDocumentMoniker": "Models\\Productsale.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Productsale.cs",
- "RelativeToolTip": "Models\\Productsale.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAcAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T07:39:36.75Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 2,
- "Title": "Product.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Product.cs",
- "RelativeDocumentMoniker": "Models\\Product.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Product.cs",
- "RelativeToolTip": "Models\\Product.cs",
- "ViewState": "AgIAAAMAAAAAAAAAAAAgwA0AAAAfAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T07:18:40.508Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 4,
- "Title": "Agent.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
- "RelativeDocumentMoniker": "Models\\Agent.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
- "RelativeToolTip": "Models\\Agent.cs",
- "ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAaAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T06:30:30.068Z",
- "EditorCaption": ""
- },
- {
- "$type": "Document",
- "DocumentIndex": 1,
- "Title": "MainWindow.axaml.cs",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
- "RelativeDocumentMoniker": "MainWindow.axaml.cs",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
- "RelativeToolTip": "MainWindow.axaml.cs",
- "ViewState": "AgIAACQAAAAAAAAAAAAcwDAAAAAhAAAAAAAAAA==",
- "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
- "WhenOpened": "2025-03-24T06:24:34.479Z",
- "EditorCaption": ""
- },
{
"$type": "Document",
"DocumentIndex": 0,
- "Title": "MainWindow.axaml",
- "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
- "RelativeDocumentMoniker": "MainWindow.axaml",
- "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
- "RelativeToolTip": "MainWindow.axaml",
+ "Title": "AddProduct.axaml",
+ "DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
+ "RelativeDocumentMoniker": "Functions\\AddProduct.axaml",
+ "ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
+ "RelativeToolTip": "Functions\\AddProduct.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
- "WhenOpened": "2025-03-24T06:24:32.359Z",
+ "WhenOpened": "2025-03-25T20:22:51.155Z",
"EditorCaption": ""
}
]
diff --git a/.vs/ProjectEvaluation/agents.metadata.v9.bin b/.vs/ProjectEvaluation/agents.metadata.v9.bin
index 6c4406c..7a1c8e3 100644
Binary files a/.vs/ProjectEvaluation/agents.metadata.v9.bin and b/.vs/ProjectEvaluation/agents.metadata.v9.bin differ
diff --git a/.vs/ProjectEvaluation/agents.projects.v9.bin b/.vs/ProjectEvaluation/agents.projects.v9.bin
index bc41a8e..4f115b8 100644
Binary files a/.vs/ProjectEvaluation/agents.projects.v9.bin and b/.vs/ProjectEvaluation/agents.projects.v9.bin differ
diff --git a/.vs/ProjectEvaluation/agents.strings.v9.bin b/.vs/ProjectEvaluation/agents.strings.v9.bin
index eb1de36..6564aac 100644
Binary files a/.vs/ProjectEvaluation/agents.strings.v9.bin and b/.vs/ProjectEvaluation/agents.strings.v9.bin differ
diff --git a/Agents.csproj b/Agents.csproj
index 6c4cfa2..df4c31d 100644
--- a/Agents.csproj
+++ b/Agents.csproj
@@ -25,8 +25,4 @@
-
-
-
-
diff --git a/Functions/AddProduct.axaml b/Functions/AddProduct.axaml
new file mode 100644
index 0000000..a5d2e1b
--- /dev/null
+++ b/Functions/AddProduct.axaml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Functions/AddProduct.axaml.cs b/Functions/AddProduct.axaml.cs
new file mode 100644
index 0000000..f348f56
--- /dev/null
+++ b/Functions/AddProduct.axaml.cs
@@ -0,0 +1,124 @@
+using Agents.Models;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using Avalonia.Media;
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+
+namespace Agents;
+
+public partial class AddProduct : Window
+{
+ static User11Context db = new User11Context();
+ ObservableCollection ProductsitemSource = new ObservableCollection(db.Products.OrderByDescending(it=>it.Id));
+ ObservableCollection ProducttypesitemSource = new ObservableCollection(db.Producttypes);
+ public AddProduct()
+ {
+ InitializeComponent();
+ ListProducts.ItemsSource = ProductsitemSource;
+ ListProductType.ItemsSource = ProducttypesitemSource;
+ }
+ void Addproduct(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ float? i = float.Parse(TextNewCount.Text);
+ int? count = Convert.ToInt32(i);
+
+
+ decimal? min = Convert.ToDecimal(TextNewMincostforagent.Text);
+
+ Producttype? t = db.Producttypes.Where(it => it == ListProductType.SelectedItem).FirstOrDefault();
+ if(t != null)
+ {
+ if (TextNewTitle.Text != "" && TextNewArticlenumber.Text != "" && count != null && min != null)
+ {
+ if (TextNewArticlenumber.Text != "")
+ {
+ if (count != null)
+ {
+ if (min != null)
+ {
+ Product product = new Product()
+ {
+ Title = TextNewTitle.Text,
+ Producttypeid = t.Id,
+ Articlenumber = TextNewArticlenumber.Text,
+ Productionpersoncount = count,
+ Mincostforagent = (decimal)min,
+
+ };
+ db.Products.Add(product);
+ db.SaveChanges();
+
+ Update();
+
+ Status.Foreground = Brushes.Green;
+ Status.Text = " ";
+ }
+ else
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+ else
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+ else
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+ else
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+ else
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+ catch
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+ }
+
+ void DeleteProduct(object sender, RoutedEventArgs e)
+ {
+ if (ListProducts.SelectedItem != null)
+ {
+ Product product = db.Products.Where(it => it == ListProducts.SelectedItem).FirstOrDefault();
+ db.Products.Remove(product);
+ db.SaveChanges();
+
+ Update();
+
+ Status.Foreground = Brushes.Green;
+ Status.Text = " ";
+ }
+ }
+
+ void Update()
+ {
+ ProductsitemSource = new ObservableCollection(db.Products.OrderByDescending(it => it.Id));
+ ListProducts.ItemsSource = ProductsitemSource;
+ }
+ void Exit(object sender, RoutedEventArgs e)
+ {
+ new MainWindow().Show();
+ Close();
+ }
+}
diff --git a/Functions/AgentEidtor.axaml b/Functions/AgentEidtor.axaml
new file mode 100644
index 0000000..5e8e832
--- /dev/null
+++ b/Functions/AgentEidtor.axaml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Functions/AgentEidtor.axaml.cs b/Functions/AgentEidtor.axaml.cs
new file mode 100644
index 0000000..3c06cf8
--- /dev/null
+++ b/Functions/AgentEidtor.axaml.cs
@@ -0,0 +1,73 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Media.Imaging;
+using Avalonia.Platform;
+using System.Reflection;
+using System;
+using Agents.Models;
+using System.Collections.ObjectModel;
+using Avalonia.Interactivity;
+using System.Linq;
+using System.Runtime.ExceptionServices;
+using Avalonia.Media;
+
+namespace Agents;
+
+public partial class AgentEidtor : Window
+{
+ static User11Context db = new User11Context();
+ ObservableCollection AgentsitemSource = new ObservableCollection(db.Agents.OrderBy(it => it.Title));
+ public AgentEidtor()
+ {
+ InitializeComponent();
+ ListAgents.ItemsSource = AgentsitemSource;
+ }
+
+ private void ComboBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
+ {
+ if (sender != null)
+ {
+ Agent agent = db.Agents.Where(it => it == ListAgents.SelectedItem).FirstOrDefault();
+ TextNewPriority.Text = agent.Priority.ToString();
+ TextNewInn.Text = agent.Inn;
+ TextNewKPP.Text = agent.Kpp;
+ TextNewAddress.Text = agent.Address;
+ TextNewDirectorname.Text = agent.Directorname;
+ TextNewEmail.Text = agent.Email;
+ }
+ }
+
+ private void ButtonUpdate(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ Agent agent = db.Agents.Where(it => it == ListAgents.SelectedItem).First();
+
+ float a = float.Parse(TextNewPriority.Text);
+ agent.Priority = Convert.ToInt32(a);
+
+ agent.Inn = TextNewInn.Text;
+ agent.Kpp = TextNewKPP.Text;
+ agent.Directorname = TextNewDirectorname.Text;
+ agent.Address = TextNewAddress.Text;
+ agent.Email = TextNewEmail.Text;
+
+ db.SaveChanges();
+
+ Status.Foreground = Brushes.Green;
+ Status.Text = " ";
+ }
+ catch
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+
+ }
+
+ void Exit(object sender, RoutedEventArgs e)
+ {
+ new MainWindow().Show();
+ Close();
+ }
+}
\ No newline at end of file
diff --git a/Functions/ProductEditor.axaml b/Functions/ProductEditor.axaml
new file mode 100644
index 0000000..9e111ac
--- /dev/null
+++ b/Functions/ProductEditor.axaml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Functions/ProductEditor.axaml.cs b/Functions/ProductEditor.axaml.cs
new file mode 100644
index 0000000..85db41a
--- /dev/null
+++ b/Functions/ProductEditor.axaml.cs
@@ -0,0 +1,61 @@
+using Agents.Models;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using Avalonia.Media;
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+
+namespace Agents;
+
+public partial class ProductEditor : Window
+{
+ static User11Context db = new User11Context();
+ ObservableCollection products = new ObservableCollection(db.Products);
+ public ProductEditor()
+ {
+ InitializeComponent();
+ ListProducts.ItemsSource = products;
+ }
+ private void ComboBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
+ {
+ Product product = db.Products.Where(it=>it == ListProducts.SelectedItem).FirstOrDefault();
+ TextNewProductionpersoncount.Text = product.Productionpersoncount.ToString();
+ TextNewArticlenumber.Text = product.Articlenumber.ToString();
+ TextNewMincostforagent.Text = product.Mincostforagent.ToString();
+ }
+
+ private void ButtonUpdate(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ Product product = db.Products.Where(it => it == ListProducts.SelectedItem).First();
+
+ float a = float.Parse(TextNewProductionpersoncount.Text);
+ product.Productionpersoncount = Convert.ToInt32(a);
+
+ product.Articlenumber = TextNewArticlenumber.Text;
+
+ float i = float.Parse(TextNewMincostforagent.Text);
+ product.Mincostforagent = Convert.ToInt32(i);
+ db.SaveChanges();
+
+ Status.Foreground = Brushes.Green;
+ Status.Text = " ";
+ }
+ catch
+ {
+ Status.Foreground = Brushes.Red;
+ Status.Text = " ";
+ }
+
+ }
+
+ void Exit(object sender, RoutedEventArgs e)
+ {
+ new MainWindow().Show();
+ Close();
+ }
+}
\ No newline at end of file
diff --git a/MainWindow.axaml b/MainWindow.axaml
index 44457c5..230ff23 100644
--- a/MainWindow.axaml
+++ b/MainWindow.axaml
@@ -134,11 +134,13 @@
Margin="20"
Height="80"
>
-
+
-
-
+
+
+
+
diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs
index 19a8166..52b82e8 100644
--- a/MainWindow.axaml.cs
+++ b/MainWindow.axaml.cs
@@ -25,17 +25,16 @@ namespace Agents
{
if(sender != null)
{
- using (User11Context db = new User11Context())
+
+ try
{
- try
- {
- UpdateInfo();
- }
- catch (Exception ex)
- {
- ExceptionDispatchInfo.Capture(ex).Throw();
- }
+ UpdateInfo();
}
+ catch (Exception ex)
+ {
+ ExceptionDispatchInfo.Capture(ex).Throw();
+ }
+
}
}
private void ListBox_SelectionChanged1(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
@@ -53,10 +52,10 @@ namespace Agents
private void UpdateInfo()
{
- Agent agent = db.Agents.Where(it => it == ListAgents.SelectedItem).FirstOrDefault();
- Productsale? PS = db.Productsales.Where(it => it.Agentid == agent.Id).FirstOrDefault();
- if (PS != null)
+ Agent? agent = db.Agents.Where(it => it == ListAgents.SelectedItem).FirstOrDefault();
+ if (agent != null)
{
+ Productsale? PS = db.Productsales.Where(it => it.Agentid == agent.Id).FirstOrDefault();
var prods = db.Productsales
.Where(PWS => PWS.Agentid == agent.Id)
.Select(PWS => new Product
@@ -81,5 +80,22 @@ namespace Agents
ListProducts.ItemsSource = new ObservableCollection(prods);
}
}
+ private void ButtonAgentEidtor(object sender, RoutedEventArgs e)
+ {
+ new AgentEidtor().Show();
+ Close();
+ }
+ private void ButtonProductEidtor(object sender, RoutedEventArgs e)
+ {
+ new ProductEditor().Show();
+ Close();
+ }
+
+ private void ButtonAddProduct(object sender, RoutedEventArgs e)
+ {
+ new AddProduct().Show();
+ Close();
+ }
+
}
-}
\ No newline at end of file
+}
diff --git a/bin/Debug/net8.0/Agents.dll b/bin/Debug/net8.0/Agents.dll
index 5a7a974..c28e460 100644
Binary files a/bin/Debug/net8.0/Agents.dll and b/bin/Debug/net8.0/Agents.dll differ
diff --git a/bin/Debug/net8.0/Agents.exe b/bin/Debug/net8.0/Agents.exe
index d780da5..d26bb07 100644
Binary files a/bin/Debug/net8.0/Agents.exe and b/bin/Debug/net8.0/Agents.exe differ
diff --git a/bin/Debug/net8.0/Agents.pdb b/bin/Debug/net8.0/Agents.pdb
index b7920e3..a2659aa 100644
Binary files a/bin/Debug/net8.0/Agents.pdb and b/bin/Debug/net8.0/Agents.pdb differ
diff --git a/obj/Debug/net8.0/Agents.AssemblyInfo.cs b/obj/Debug/net8.0/Agents.AssemblyInfo.cs
index 36fef74..d581c48 100644
--- a/obj/Debug/net8.0/Agents.AssemblyInfo.cs
+++ b/obj/Debug/net8.0/Agents.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Agents")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+18a2fd7bc37cf902fa084ca75d9b11bc046836b6")]
[assembly: System.Reflection.AssemblyProductAttribute("Agents")]
[assembly: System.Reflection.AssemblyTitleAttribute("Agents")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/obj/Debug/net8.0/Agents.AssemblyInfoInputs.cache b/obj/Debug/net8.0/Agents.AssemblyInfoInputs.cache
index 78d2d2f..dd21a1f 100644
--- a/obj/Debug/net8.0/Agents.AssemblyInfoInputs.cache
+++ b/obj/Debug/net8.0/Agents.AssemblyInfoInputs.cache
@@ -1 +1 @@
-49b7bb7a45c8f76bcb00f3dde7736a990df1fa7f8dccd1478c97c85435bf6700
+b9c09ae530f91552353b8e651705dc9b1ec333a7de7dd684b4a3e2132a51a386
diff --git a/obj/Debug/net8.0/Agents.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net8.0/Agents.GeneratedMSBuildEditorConfig.editorconfig
index bd18027..875b80e 100644
--- a/obj/Debug/net8.0/Agents.GeneratedMSBuildEditorConfig.editorconfig
+++ b/obj/Debug/net8.0/Agents.GeneratedMSBuildEditorConfig.editorconfig
@@ -24,5 +24,14 @@ build_property.EnableCodeStyleSeverity =
[C:/Users/VivoBook 15X/Desktop/Task21_03/Agents/App.axaml]
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+[C:/Users/VivoBook 15X/Desktop/Task21_03/Agents/Functions/AddProduct.axaml]
+build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+
+[C:/Users/VivoBook 15X/Desktop/Task21_03/Agents/Functions/AgentEidtor.axaml]
+build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+
+[C:/Users/VivoBook 15X/Desktop/Task21_03/Agents/Functions/ProductEditor.axaml]
+build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+
[C:/Users/VivoBook 15X/Desktop/Task21_03/Agents/MainWindow.axaml]
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
diff --git a/obj/Debug/net8.0/Agents.csproj.CoreCompileInputs.cache b/obj/Debug/net8.0/Agents.csproj.CoreCompileInputs.cache
index caf330c..5cc4aa3 100644
--- a/obj/Debug/net8.0/Agents.csproj.CoreCompileInputs.cache
+++ b/obj/Debug/net8.0/Agents.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-464ac82623e4b9e05843eb98aedb09dd6babfe26ebf9c613e4e8c31f52746fee
+291fde3fd23923f8bcf8b73c387a7e6152f5ad6f6bade5fec7a8c02a30a13f72
diff --git a/obj/Debug/net8.0/Agents.dll b/obj/Debug/net8.0/Agents.dll
index 2d32c37..ede8ab0 100644
Binary files a/obj/Debug/net8.0/Agents.dll and b/obj/Debug/net8.0/Agents.dll differ
diff --git a/obj/Debug/net8.0/Agents.pdb b/obj/Debug/net8.0/Agents.pdb
index 918d090..9bca8c8 100644
Binary files a/obj/Debug/net8.0/Agents.pdb and b/obj/Debug/net8.0/Agents.pdb differ
diff --git a/obj/Debug/net8.0/Avalonia/Agents.dll b/obj/Debug/net8.0/Avalonia/Agents.dll
index 5a7a974..c28e460 100644
Binary files a/obj/Debug/net8.0/Avalonia/Agents.dll and b/obj/Debug/net8.0/Avalonia/Agents.dll differ
diff --git a/obj/Debug/net8.0/Avalonia/Agents.pdb b/obj/Debug/net8.0/Avalonia/Agents.pdb
index b7920e3..a2659aa 100644
Binary files a/obj/Debug/net8.0/Avalonia/Agents.pdb and b/obj/Debug/net8.0/Avalonia/Agents.pdb differ
diff --git a/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache b/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
index a82e3ec..907ead3 100644
--- a/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
+++ b/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
@@ -1 +1 @@
-52101edfc7686cbd8f0c2993fb23a494a97b9211833fbf2a416c552f1624b79e
+cdb2d27bf7fe9c7d1d6b3a43ac185a1f4cee0196d1cda531d59b718a7c0544a9
diff --git a/obj/Debug/net8.0/Avalonia/resources b/obj/Debug/net8.0/Avalonia/resources
index 6c522ac..6a7ff18 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/apphost.exe b/obj/Debug/net8.0/apphost.exe
index d780da5..d26bb07 100644
Binary files a/obj/Debug/net8.0/apphost.exe and b/obj/Debug/net8.0/apphost.exe differ
diff --git a/obj/Debug/net8.0/ref/Agents.dll b/obj/Debug/net8.0/ref/Agents.dll
index 84ffabd..59a87fe 100644
Binary files a/obj/Debug/net8.0/ref/Agents.dll and b/obj/Debug/net8.0/ref/Agents.dll differ
diff --git a/obj/Debug/net8.0/refint/Agents.dll b/obj/Debug/net8.0/refint/Agents.dll
index fe55729..d6e2b00 100644
Binary files a/obj/Debug/net8.0/refint/Agents.dll and b/obj/Debug/net8.0/refint/Agents.dll differ
diff --git a/obj/Debug/net8.0/refint/Avalonia/Agents.dll b/obj/Debug/net8.0/refint/Avalonia/Agents.dll
index 84ffabd..59a87fe 100644
Binary files a/obj/Debug/net8.0/refint/Avalonia/Agents.dll and b/obj/Debug/net8.0/refint/Avalonia/Agents.dll differ