diff --git a/.idea/.idea.demofinish/.idea/.gitignore b/.idea/.idea.demofinish/.idea/.gitignore
new file mode 100644
index 0000000..03154e5
--- /dev/null
+++ b/.idea/.idea.demofinish/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/modules.xml
+/.idea.demofinish.iml
+/contentModel.xml
+/projectSettingsUpdater.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.demofinish/.idea/.name b/.idea/.idea.demofinish/.idea/.name
new file mode 100644
index 0000000..7d7cf72
--- /dev/null
+++ b/.idea/.idea.demofinish/.idea/.name
@@ -0,0 +1 @@
+demofinish
\ No newline at end of file
diff --git a/.idea/.idea.demofinish/.idea/avalonia.xml b/.idea/.idea.demofinish/.idea/avalonia.xml
new file mode 100644
index 0000000..fcc286d
--- /dev/null
+++ b/.idea/.idea.demofinish/.idea/avalonia.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.demofinish/.idea/indexLayout.xml b/.idea/.idea.demofinish/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/.idea/.idea.demofinish/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.demofinish/.idea/vcs.xml b/.idea/.idea.demofinish/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/.idea.demofinish/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demofinish/MainWindow.axaml b/demofinish/MainWindow.axaml
index be8f627..045389a 100644
--- a/demofinish/MainWindow.axaml
+++ b/demofinish/MainWindow.axaml
@@ -10,7 +10,14 @@
-
+
+
+
+
+
+
+
+
Наименование
Размер скидки
@@ -28,7 +35,7 @@
-
+
@@ -37,5 +44,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demofinish/MainWindow.axaml.cs b/demofinish/MainWindow.axaml.cs
index 82f4b78..578bcf5 100644
--- a/demofinish/MainWindow.axaml.cs
+++ b/demofinish/MainWindow.axaml.cs
@@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Avalonia.Controls;
+using Avalonia.Interactivity;
using Avalonia.Media.Imaging;
using demofinish.Models;
@@ -12,50 +13,147 @@ namespace demofinish
public partial class MainWindow : Window
{
private ObservableCollection agents = new ObservableCollection();
- private List agentsList = new List();
+ public List agentsList = new List();
+ private const int pageSize = 10;
+ private int currentPage = 1;
+ private int pageCount = 0;
public MainWindow()
{
InitializeComponent();
LoadAgents();
+ ComboboxPriority();
+ PriorityCombobox.SelectionChanged += PriorutyCombobox_SelectionChanged;
}
- private Bitmap? GetImage(string logo)
- {
- try
- {
- string absolutePath = Path.Combine(AppContext.BaseDirectory, logo);
- return new Bitmap(absolutePath);
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Ошибка загрузки изображения: {ex.Message}");
- return null;
- }
- }
+
- private void LoadAgents()
+ public class AgentPresenter : Agent
+ {
+ Bitmap? LogoImage
+ {
+ get
+ {
+ try
+ {
+ var absolutepass = Path.Combine(AppContext.BaseDirectory, Logo);
+ return new Bitmap(absolutepass);
+
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+ }
+
+ private void ComboboxPriority()
+ {
+ using var context = new User1Context();
+
+ var priorities = context.Agents
+ .Select(x => x.Priority)
+ .Distinct()
+ .OrderBy(x => x)
+ .ToList()
+ .Cast