From c4a17d6300d6e4c7c86195a50e20f3adbef517c1 Mon Sep 17 00:00:00 2001 From: tellsense Date: Thu, 25 Apr 2024 22:19:15 +0400 Subject: [PATCH] =?UTF-8?q?=D1=8D=D1=85=D1=85=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBar/SushiBarBusinessLogic/AbstractSaveToPdf.cs | 2 +- .../SushiBarBusinessLogic/PdfParagraphAlignmentType.cs | 2 +- SushiBar/SushiBarBusinessLogic/SaveToPdf.cs | 4 ++-- SushiBar/SushiBarDatabaseImplement/OrderStorage.cs | 7 +++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/SushiBar/SushiBarBusinessLogic/AbstractSaveToPdf.cs b/SushiBar/SushiBarBusinessLogic/AbstractSaveToPdf.cs index 129065d..b205e48 100644 --- a/SushiBar/SushiBarBusinessLogic/AbstractSaveToPdf.cs +++ b/SushiBar/SushiBarBusinessLogic/AbstractSaveToPdf.cs @@ -38,7 +38,7 @@ namespace SushiBarBusinessLogic.OfficePackage { Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t", Style = "Normal", - ParagraphAlignment = PdfParagraphAlignmentType.Rigth + ParagraphAlignment = PdfParagraphAlignmentType.Right }); SavePdf(info); } diff --git a/SushiBar/SushiBarBusinessLogic/PdfParagraphAlignmentType.cs b/SushiBar/SushiBarBusinessLogic/PdfParagraphAlignmentType.cs index 9a0a40c..2b7c934 100644 --- a/SushiBar/SushiBarBusinessLogic/PdfParagraphAlignmentType.cs +++ b/SushiBar/SushiBarBusinessLogic/PdfParagraphAlignmentType.cs @@ -4,6 +4,6 @@ { Center, Left, - Rigth + Right } } \ No newline at end of file diff --git a/SushiBar/SushiBarBusinessLogic/SaveToPdf.cs b/SushiBar/SushiBarBusinessLogic/SaveToPdf.cs index 2db420e..0061fd5 100644 --- a/SushiBar/SushiBarBusinessLogic/SaveToPdf.cs +++ b/SushiBar/SushiBarBusinessLogic/SaveToPdf.cs @@ -16,7 +16,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements { PdfParagraphAlignmentType.Center => ParagraphAlignment.Center, PdfParagraphAlignmentType.Left => ParagraphAlignment.Left, - PdfParagraphAlignmentType.Rigth => ParagraphAlignment.Right, + PdfParagraphAlignmentType.Right => ParagraphAlignment.Right, _ => ParagraphAlignment.Justify, }; } @@ -27,7 +27,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements private static void DefineStyles(Document document) { var style = document.Styles["Normal"]; - style.Font.Name = "Times New Roman"; + style.Font.Name = "Arial"; style.Font.Size = 14; style = document.Styles.AddStyle("NormalTitle", "Normal"); style.Font.Bold = true; diff --git a/SushiBar/SushiBarDatabaseImplement/OrderStorage.cs b/SushiBar/SushiBarDatabaseImplement/OrderStorage.cs index eeee325..1a9feac 100644 --- a/SushiBar/SushiBarDatabaseImplement/OrderStorage.cs +++ b/SushiBar/SushiBarDatabaseImplement/OrderStorage.cs @@ -18,8 +18,11 @@ namespace SushiBarDatabaseImplement.Implements public List GetFilteredList(OrderSearchModel model) { using var context = new SushiBarDatabase(); - var result = context.Orders.Include(x => x.Sushi).Select(x => x.GetViewModel).ToList(); - return result; + if (model.DateFrom.HasValue) + { + return context.Orders.Include(x => x.Sushi).Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList(); + } + return context.Orders.Include(x => x.Sushi).Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList(); } public OrderViewModel? GetElement(OrderSearchModel model)