diff --git a/demo5/FormOrderWindow.axaml b/demo5/FormOrderWindow.axaml
index 890aa69..a76281d 100644
--- a/demo5/FormOrderWindow.axaml
+++ b/demo5/FormOrderWindow.axaml
@@ -11,13 +11,16 @@
-
+
-
+
-
+
+
+
+
diff --git a/demo5/FormOrderWindow.axaml.cs b/demo5/FormOrderWindow.axaml.cs
index 0130933..0636fb9 100644
--- a/demo5/FormOrderWindow.axaml.cs
+++ b/demo5/FormOrderWindow.axaml.cs
@@ -154,4 +154,10 @@ public partial class FormOrderWindow : Window
document.Save(filePath);
Console.WriteLine($"PDF сохранен: {filePath}");
}
+
+ private void OrdersWindowButton_OnClick(object? sender, RoutedEventArgs e)
+ {
+ OrdersWindow ordersWindow = new OrdersWindow();
+ ordersWindow.ShowDialog(this);
+ }
}
\ No newline at end of file
diff --git a/demo5/OrdersWindow.axaml b/demo5/OrdersWindow.axaml
new file mode 100644
index 0000000..55d3305
--- /dev/null
+++ b/demo5/OrdersWindow.axaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo5/OrdersWindow.axaml.cs b/demo5/OrdersWindow.axaml.cs
new file mode 100644
index 0000000..d2dc41b
--- /dev/null
+++ b/demo5/OrdersWindow.axaml.cs
@@ -0,0 +1,134 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using demo5.Models;
+using PdfSharpCore.Drawing;
+using PdfSharpCore.Pdf;
+
+namespace demo5;
+
+public partial class OrdersWindow : Window
+{
+ ObservableCollection Orders = new();
+ List dataSourceServices;
+ List dataSourceOrders;
+ public OrdersWindow()
+ {
+ InitializeComponent();
+ using var context = new Demo5Context();
+ dataSourceOrders = context.Orders.Select(order => new OrderPresenter
+ {
+ Id = order.Id,
+ CodeOrder = order.CodeOrder,
+ Date = order.Date,
+ Time = order.Time,
+ CodeClient = order.CodeClient,
+ Status = order.Status,
+ Period = order.Period,
+ Services = order.OrdersServices.Select(os => os.Service).ToList(),
+ UserFio = context.Clients.FirstOrDefault(u => u.Id == order.CodeClient).Fio,
+
+ ServicesNames = new ObservableCollection(
+ order.OrdersServices.Select(os => os.Service.Name).ToList()
+ )
+ }).ToList();
+
+ dataSourceServices = context.Services.Select(order => new Service()).ToList();
+
+ ListBoxHistory.ItemsSource = Orders;
+ FilterComboboxUsers.ItemsSource = context.Clients.Select(client => client.Fio).ToList();
+ FilterComboboxServices.ItemsSource = context.Services.Select(service => service.Name).ToList();
+ DisplayServices();
+ }
+
+ public class OrderPresenter() : Order
+ {
+ public List Services { get; set; } = new();
+ public String UserFio;
+ public ObservableCollection ServicesNames { get; set; } = new();
+ }
+
+ public void DisplayServices()
+ {
+ var temp = dataSourceOrders;
+
+ Orders.Clear();
+
+ if (FilterComboboxUsers.SelectedItem is string selectedUser)
+ {
+ temp = temp.Where(u => u.UserFio == selectedUser).ToList();
+ }
+
+ if (FilterComboboxServices.SelectedItem is string selectedServiceName)
+ {
+ temp = temp.Where(o => o.Services.Any(s => s.Name == selectedServiceName)).ToList();
+ }
+
+ foreach (var item in temp)
+ {
+ Orders.Add(item);
+ }
+ }
+
+ private void FilterComboboxUsers_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
+ {
+ DisplayServices();
+ }
+
+ private void FilterComboboxServices_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
+ {
+ DisplayServices();
+ }
+
+ private void FormOrder_OnClick(object? sender, RoutedEventArgs e)
+ {
+ if (ListBoxHistory.SelectedItem is OrderPresenter selectedOrder)
+ {
+ var resultSum = 0;
+ var serviceNames = "";
+
+ using var document = new PdfDocument();
+ var page = document.AddPage();
+ var gfx = XGraphics.FromPdfPage(page);
+
+ var font = new XFont("Arial", 14, XFontStyle.Regular);
+
+ foreach (var service in selectedOrder.Services)
+ {
+ resultSum += service.Price;
+ serviceNames += service.Name + " ";
+ }
+
+ var lines = new List
+ {
+ $"Дата заказа: {selectedOrder.Date}",
+ $"ID пользователя: {selectedOrder.CodeClient}",
+ $"Код заказа: {selectedOrder.CodeOrder}",
+ $"ФИО пользователя: {selectedOrder.UserFio}",
+ $"Время заказа: {selectedOrder.Time}",
+ $"Услуги: {serviceNames}",
+ $"Итоговая сумма: {resultSum}"
+ };
+
+ double x = 50, y = 50;
+ double lineHeight = 20;
+
+ foreach (var line in lines)
+ {
+ gfx.DrawString(line, font, XBrushes.Black, new XPoint(x, y));
+ y += lineHeight;
+ }
+
+ string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), $"Order_{selectedOrder.Id}.pdf");
+ document.Save(filePath);
+
+ Console.WriteLine($"PDF сохранен: {filePath}");
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo5/bin/Debug/net8.0/demo5.dll b/demo5/bin/Debug/net8.0/demo5.dll
index 95e39b4..4270b90 100644
Binary files a/demo5/bin/Debug/net8.0/demo5.dll and b/demo5/bin/Debug/net8.0/demo5.dll differ
diff --git a/demo5/bin/Debug/net8.0/demo5.pdb b/demo5/bin/Debug/net8.0/demo5.pdb
index 41f84d2..e98b089 100644
Binary files a/demo5/bin/Debug/net8.0/demo5.pdb and b/demo5/bin/Debug/net8.0/demo5.pdb differ
diff --git a/demo5/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache b/demo5/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
index 6a5b235..29a16af 100644
--- a/demo5/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
+++ b/demo5/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
@@ -1 +1 @@
-93564d7a355513ce17cceef7285f1bf6959e7179c7ddbf1cdc1dfedf53dd240c
+8fcd9272f6074b94482d587f28ea2f08a467c551daf15e3e7b13cdad335e7d33
diff --git a/demo5/obj/Debug/net8.0/Avalonia/demo5.dll b/demo5/obj/Debug/net8.0/Avalonia/demo5.dll
index 95e39b4..4270b90 100644
Binary files a/demo5/obj/Debug/net8.0/Avalonia/demo5.dll and b/demo5/obj/Debug/net8.0/Avalonia/demo5.dll differ
diff --git a/demo5/obj/Debug/net8.0/Avalonia/demo5.pdb b/demo5/obj/Debug/net8.0/Avalonia/demo5.pdb
index 41f84d2..e98b089 100644
Binary files a/demo5/obj/Debug/net8.0/Avalonia/demo5.pdb and b/demo5/obj/Debug/net8.0/Avalonia/demo5.pdb differ
diff --git a/demo5/obj/Debug/net8.0/Avalonia/resources b/demo5/obj/Debug/net8.0/Avalonia/resources
index de37b61..1f09040 100644
Binary files a/demo5/obj/Debug/net8.0/Avalonia/resources and b/demo5/obj/Debug/net8.0/Avalonia/resources differ
diff --git a/demo5/obj/Debug/net8.0/demo5.AssemblyInfo.cs b/demo5/obj/Debug/net8.0/demo5.AssemblyInfo.cs
index be187ff..90bb4d2 100644
--- a/demo5/obj/Debug/net8.0/demo5.AssemblyInfo.cs
+++ b/demo5/obj/Debug/net8.0/demo5.AssemblyInfo.cs
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("demo5")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+48d3d6134087a826b42053bbd898787bf97406e3")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+55a685a735b4f753ad1488bece58878a705226b4")]
[assembly: System.Reflection.AssemblyProductAttribute("demo5")]
[assembly: System.Reflection.AssemblyTitleAttribute("demo5")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/demo5/obj/Debug/net8.0/demo5.AssemblyInfoInputs.cache b/demo5/obj/Debug/net8.0/demo5.AssemblyInfoInputs.cache
index 539bfc2..b8094f1 100644
--- a/demo5/obj/Debug/net8.0/demo5.AssemblyInfoInputs.cache
+++ b/demo5/obj/Debug/net8.0/demo5.AssemblyInfoInputs.cache
@@ -1 +1 @@
-624c9ee094ad8117fe475f6857cdac298825ad77cd8458b95d7a220842734076
+53f1e2c11d77af3ebd2f1e3b74513ae6600c7dcd5e4b1ac5ec7db17074af1ffb
diff --git a/demo5/obj/Debug/net8.0/demo5.GeneratedMSBuildEditorConfig.editorconfig b/demo5/obj/Debug/net8.0/demo5.GeneratedMSBuildEditorConfig.editorconfig
index fcae422..fb34b26 100644
--- a/demo5/obj/Debug/net8.0/demo5.GeneratedMSBuildEditorConfig.editorconfig
+++ b/demo5/obj/Debug/net8.0/demo5.GeneratedMSBuildEditorConfig.editorconfig
@@ -40,6 +40,9 @@ build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
[/Users/feitanportor/dev/C\#/demo5/demo5/MegaSellerWindow.axaml]
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+[/Users/feitanportor/dev/C\#/demo5/demo5/OrdersWindow.axaml]
+build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
+
[/Users/feitanportor/dev/C\#/demo5/demo5/SellerWindow.axaml]
build_metadata.AdditionalFiles.SourceItemGroup = AvaloniaXaml
diff --git a/demo5/obj/Debug/net8.0/demo5.csproj.CoreCompileInputs.cache b/demo5/obj/Debug/net8.0/demo5.csproj.CoreCompileInputs.cache
index 76e578c..b6b7a66 100644
--- a/demo5/obj/Debug/net8.0/demo5.csproj.CoreCompileInputs.cache
+++ b/demo5/obj/Debug/net8.0/demo5.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-7b1684c65de78606aa7ea64895ae3a2ad483be67b2e9ce6ed03a5de7e6dfa344
+a511ea1a3ed65b095c1d748fc193b27899ade7424b6b93ff1de641a1727cfdfd
diff --git a/demo5/obj/Debug/net8.0/demo5.dll b/demo5/obj/Debug/net8.0/demo5.dll
index bdd355c..801d472 100644
Binary files a/demo5/obj/Debug/net8.0/demo5.dll and b/demo5/obj/Debug/net8.0/demo5.dll differ
diff --git a/demo5/obj/Debug/net8.0/demo5.pdb b/demo5/obj/Debug/net8.0/demo5.pdb
index b78cc75..417d2b9 100644
Binary files a/demo5/obj/Debug/net8.0/demo5.pdb and b/demo5/obj/Debug/net8.0/demo5.pdb differ
diff --git a/demo5/obj/Debug/net8.0/ref/demo5.dll b/demo5/obj/Debug/net8.0/ref/demo5.dll
index 25d1de5..be7aa8d 100644
Binary files a/demo5/obj/Debug/net8.0/ref/demo5.dll and b/demo5/obj/Debug/net8.0/ref/demo5.dll differ
diff --git a/demo5/obj/Debug/net8.0/refint/Avalonia/demo5.dll b/demo5/obj/Debug/net8.0/refint/Avalonia/demo5.dll
index 25d1de5..be7aa8d 100644
Binary files a/demo5/obj/Debug/net8.0/refint/Avalonia/demo5.dll and b/demo5/obj/Debug/net8.0/refint/Avalonia/demo5.dll differ
diff --git a/demo5/obj/Debug/net8.0/refint/demo5.dll b/demo5/obj/Debug/net8.0/refint/demo5.dll
index 69eba14..7282eb0 100644
Binary files a/demo5/obj/Debug/net8.0/refint/demo5.dll and b/demo5/obj/Debug/net8.0/refint/demo5.dll differ
diff --git a/demo5/obj/rider.project.model.nuget.info b/demo5/obj/rider.project.model.nuget.info
index 0d3d228..dc21e67 100644
--- a/demo5/obj/rider.project.model.nuget.info
+++ b/demo5/obj/rider.project.model.nuget.info
@@ -1 +1 @@
-17407744351431374
\ No newline at end of file
+17407744605768101
\ No newline at end of file