diff --git a/demo_hard/App.axaml.cs b/demo_hard/App.axaml.cs
index 6548ec4..632941b 100644
--- a/demo_hard/App.axaml.cs
+++ b/demo_hard/App.axaml.cs
@@ -16,6 +16,7 @@ public partial class App : Application
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
+
}
base.OnFrameworkInitializationCompleted();
diff --git a/demo_hard/BarcodeWindow.axaml b/demo_hard/BarcodeWindow.axaml
index c7e1c6f..e573461 100644
--- a/demo_hard/BarcodeWindow.axaml
+++ b/demo_hard/BarcodeWindow.axaml
@@ -6,7 +6,7 @@
-
+
diff --git a/demo_hard/SallerWindow.axaml b/demo_hard/SallerWindow.axaml
index c21bdb5..2f8860e 100644
--- a/demo_hard/SallerWindow.axaml
+++ b/demo_hard/SallerWindow.axaml
@@ -7,7 +7,7 @@
Height="600">
-
+
-
+
@@ -34,7 +34,7 @@
-
+
@@ -50,7 +50,7 @@
Padding="5"/>
-
+
-
+
-
+
-
+
(service.CostPerHour ?? 0) * (service.RentTime / 60m));
- Paragraph totalParagraph = new Paragraph($"Итого к оплате: {totalAmount:N2} ₽", headerFont);
- totalParagraph.Alignment = Element.ALIGN_RIGHT;
- document.Add(totalParagraph);
- }
-
- try
+
+ var svcTitle = new Paragraph("Services Rendered:", headerFont)
{
- Process.Start(new ProcessStartInfo
+ SpacingAfter = 10f
+ };
+ document.Add(svcTitle);
+
+ PdfPTable svcTable = new PdfPTable(3)
+ {
+ WidthPercentage = 100,
+ SpacingBefore = 5f,
+ SpacingAfter = 5f
+ };
+ svcTable.SetWidths(new float[] { 60f, 20f, 20f });
+
+
+ foreach (var hdr in new[] { "Service Name", "Rate/hour", "Duration (min)" })
+ {
+ svcTable.AddCell(new PdfPCell(new Phrase(hdr, headerFont))
{
- FileName = pdfFilePath,
- UseShellExecute = true
+ HorizontalAlignment = Element.ALIGN_CENTER,
+ BackgroundColor = BaseColor.LIGHT_GRAY,
+ Padding = 5f
});
}
- catch (Exception exception)
+
+
+ foreach (var svc in SelectedServices)
{
- StatusText.Text = $"Ошибка при открытии PDF: {exception.Message}";
+ svcTable.AddCell(new PdfPCell(new Phrase(svc.ServiceName, normalFont)) { Padding = 5f });
+ svcTable.AddCell(new PdfPCell(new Phrase($"{svc.CostPerHour:N2} ₽", normalFont))
+ {
+ HorizontalAlignment = Element.ALIGN_RIGHT,
+ Padding = 5f
+ });
+ svcTable.AddCell(new PdfPCell(new Phrase(svc.RentTime.ToString(), normalFont))
+ {
+ HorizontalAlignment = Element.ALIGN_RIGHT,
+ Padding = 5f
+ });
}
+
+ document.Add(svcTable);
+
+
+ decimal total = SelectedServices.Sum(s => (s.CostPerHour ?? 0) * (s.RentTime / 60m));
+ var totalPara = new Paragraph($"Total Due: {total:N2} ₽", headerFont)
+ {
+ Alignment = Element.ALIGN_RIGHT,
+ SpacingBefore = 10f
+ };
+ document.Add(totalPara);
}
- private void AddPdfTableRow(PdfPTable table, string label, string value, Font labelFont, Font valueFont)
+
+ try
{
- table.AddCell(new Phrase(label, labelFont));
- table.AddCell(new Phrase(value, valueFont));
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = pdfFilePath,
+ UseShellExecute = true
+ });
}
+ catch (Exception ex)
+ {
+ StatusText.Text = $"Error opening PDF: {ex.Message}";
+ }
+}
+
+
+private void AddCell(PdfPTable table, string label, string value, Font labelFont, Font valueFont)
+{
+ table.AddCell(new Phrase(label, labelFont));
+ table.AddCell(new Phrase(value, valueFont));
+}
+
}
\ No newline at end of file
diff --git a/demo_hard/bin/Debug/net9.0/demo_hard.dll b/demo_hard/bin/Debug/net9.0/demo_hard.dll
index a352a0c..00b443c 100644
Binary files a/demo_hard/bin/Debug/net9.0/demo_hard.dll and b/demo_hard/bin/Debug/net9.0/demo_hard.dll differ
diff --git a/demo_hard/bin/Debug/net9.0/demo_hard.exe b/demo_hard/bin/Debug/net9.0/demo_hard.exe
index 821fe87..ebd6497 100644
Binary files a/demo_hard/bin/Debug/net9.0/demo_hard.exe and b/demo_hard/bin/Debug/net9.0/demo_hard.exe differ
diff --git a/demo_hard/bin/Debug/net9.0/demo_hard.pdb b/demo_hard/bin/Debug/net9.0/demo_hard.pdb
index d5a0a90..7a319c0 100644
Binary files a/demo_hard/bin/Debug/net9.0/demo_hard.pdb and b/demo_hard/bin/Debug/net9.0/demo_hard.pdb differ
diff --git a/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.dll b/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.dll
index a352a0c..00b443c 100644
Binary files a/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.dll and b/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.dll differ
diff --git a/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.pdb b/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.pdb
index d5a0a90..7a319c0 100644
Binary files a/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.pdb and b/demo_hard/obj/Debug/net9.0/Avalonia/demo_hard.pdb differ
diff --git a/demo_hard/obj/Debug/net9.0/Avalonia/resources b/demo_hard/obj/Debug/net9.0/Avalonia/resources
index 7d556f2..3e75838 100644
Binary files a/demo_hard/obj/Debug/net9.0/Avalonia/resources and b/demo_hard/obj/Debug/net9.0/Avalonia/resources differ
diff --git a/demo_hard/obj/Debug/net9.0/apphost.exe b/demo_hard/obj/Debug/net9.0/apphost.exe
index 821fe87..ebd6497 100644
Binary files a/demo_hard/obj/Debug/net9.0/apphost.exe and b/demo_hard/obj/Debug/net9.0/apphost.exe differ
diff --git a/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfo.cs b/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfo.cs
index 80307ff..732f1fe 100644
--- a/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfo.cs
+++ b/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfo.cs
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("demo_hard")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+69fe9ea9bc91472e247d6c5d565068a4efb0a683")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+50e56467d7d10df36759130ef24997a8c6ea8a33")]
[assembly: System.Reflection.AssemblyProductAttribute("demo_hard")]
[assembly: System.Reflection.AssemblyTitleAttribute("demo_hard")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfoInputs.cache b/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfoInputs.cache
index 0ceefdd..d247535 100644
--- a/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfoInputs.cache
+++ b/demo_hard/obj/Debug/net9.0/demo_hard.AssemblyInfoInputs.cache
@@ -1 +1 @@
-b558e1c40e2637b7a5437875d3c594c1eda934e9d40f49c41e49dbf89f9df5f0
+d558e19871cd3b2b9f2f0170e2a01cb1d30cd37918ea9e521a55dc94c303ad3d
diff --git a/demo_hard/obj/Debug/net9.0/demo_hard.dll b/demo_hard/obj/Debug/net9.0/demo_hard.dll
index 68cdeca..0b0484a 100644
Binary files a/demo_hard/obj/Debug/net9.0/demo_hard.dll and b/demo_hard/obj/Debug/net9.0/demo_hard.dll differ
diff --git a/demo_hard/obj/Debug/net9.0/demo_hard.pdb b/demo_hard/obj/Debug/net9.0/demo_hard.pdb
index c2d304f..d5cfd05 100644
Binary files a/demo_hard/obj/Debug/net9.0/demo_hard.pdb and b/demo_hard/obj/Debug/net9.0/demo_hard.pdb differ
diff --git a/demo_hard/obj/Debug/net9.0/ref/demo_hard.dll b/demo_hard/obj/Debug/net9.0/ref/demo_hard.dll
index ab15331..5238671 100644
Binary files a/demo_hard/obj/Debug/net9.0/ref/demo_hard.dll and b/demo_hard/obj/Debug/net9.0/ref/demo_hard.dll differ
diff --git a/demo_hard/obj/Debug/net9.0/refint/Avalonia/demo_hard.dll b/demo_hard/obj/Debug/net9.0/refint/Avalonia/demo_hard.dll
index ab15331..5238671 100644
Binary files a/demo_hard/obj/Debug/net9.0/refint/Avalonia/demo_hard.dll and b/demo_hard/obj/Debug/net9.0/refint/Avalonia/demo_hard.dll differ
diff --git a/demo_hard/obj/Debug/net9.0/refint/demo_hard.dll b/demo_hard/obj/Debug/net9.0/refint/demo_hard.dll
index 92f01af..06bc7fc 100644
Binary files a/demo_hard/obj/Debug/net9.0/refint/demo_hard.dll and b/demo_hard/obj/Debug/net9.0/refint/demo_hard.dll differ