From 7cb45bfe43eb2416770e27fe0bcb395cffca6294 Mon Sep 17 00:00:00 2001 From: ekallin Date: Mon, 25 Mar 2024 00:08:21 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=D1=81=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=81=D0=B8=D0=BB=D1=8B=20=D0=BD=D0=B0=20=D0=B8?= =?UTF-8?q?=D1=81=D1=85=D0=BE=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBarBusinessLogic/OfficePackage/AbstractSaveToPdf.cs | 8 ++------ .../OfficePackage/HelperModels/ExcelInfo.cs | 2 +- .../OfficePackage/Implements/SaveToPdf.cs | 4 +++- SushiBarBusinessLogic/Reportlogic.cs | 7 ++++--- SushiBarContracts/BusinessLogicsContracts/IReportLogic.cs | 2 +- .../ViewModels/ReportSushiComponentViewModel.cs | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/SushiBarBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/SushiBarBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index cba331a..9296c47 100644 --- a/SushiBarBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/SushiBarBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -16,8 +16,7 @@ namespace SushiBarBusinessLogic.OfficePackage CreateParagraph(new PdfParagraph { Text = info.Title, - Style = - "NormalTitle", + Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); CreateParagraph(new PdfParagraph @@ -36,10 +35,7 @@ namespace SushiBarBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), - order.DateCreate.ToShortDateString(), - order.SushiName, - order.Sum.ToString() }, + Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.SushiName, order.Sum.ToString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/SushiBarBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/SushiBarBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs index d21b8ef..d9b69b4 100644 --- a/SushiBarBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs +++ b/SushiBarBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -6,7 +6,7 @@ namespace SushiBarBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List SushiComponents + public List SushiComponents { get; set; diff --git a/SushiBarBusinessLogic/OfficePackage/Implements/SaveToPdf.cs b/SushiBarBusinessLogic/OfficePackage/Implements/SaveToPdf.cs index e9a7d3f..b16cefe 100644 --- a/SushiBarBusinessLogic/OfficePackage/Implements/SaveToPdf.cs +++ b/SushiBarBusinessLogic/OfficePackage/Implements/SaveToPdf.cs @@ -11,7 +11,8 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements private Document? _document; private Section? _section; private Table? _table; - private static ParagraphAlignment GetParagraphAlignment(PdfParagraphAlignmentType type) + private static ParagraphAlignment + GetParagraphAlignment(PdfParagraphAlignmentType type) { return type switch { @@ -85,6 +86,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements row.Cells[i].VerticalAlignment = VerticalAlignment.Center; } } + protected override void SavePdf(PdfInfo info) { if (_document != null) diff --git a/SushiBarBusinessLogic/Reportlogic.cs b/SushiBarBusinessLogic/Reportlogic.cs index 8be5323..a60ecdd 100644 --- a/SushiBarBusinessLogic/Reportlogic.cs +++ b/SushiBarBusinessLogic/Reportlogic.cs @@ -23,6 +23,7 @@ namespace SushiBarBusinessLogic _sushiStorage = sushiStorage; _componentStorage = componentStorage; _orderStorage = orderStorage; + _saveToExcel = saveToExcel; _saveToWord = saveToWord; _saveToPdf = saveToPdf; @@ -31,14 +32,14 @@ namespace SushiBarBusinessLogic /// Получение списка компонент с указанием, в каких изделиях используются /// /// - public List GetSushiComponent() + public List GetSushiComponent() { var components = _componentStorage.GetFullList(); var sushis = _sushiStorage.GetFullList(); - var list = new List(); + var list = new List(); foreach (var component in components) { - var record = new ReportSushisComponentViewModel + var record = new ReportSushiComponentViewModel { ComponentName = component.ComponentName, Sushis = new List>(), diff --git a/SushiBarContracts/BusinessLogicsContracts/IReportLogic.cs b/SushiBarContracts/BusinessLogicsContracts/IReportLogic.cs index e1e3ef0..dc1f4af 100644 --- a/SushiBarContracts/BusinessLogicsContracts/IReportLogic.cs +++ b/SushiBarContracts/BusinessLogicsContracts/IReportLogic.cs @@ -9,7 +9,7 @@ namespace SushiBarContracts.BusinessLogicsContracts /// Получение списка компонент с указанием, в каких изделиях используются /// /// - List GetSushiComponent(); + List GetSushiComponent(); /// /// Получение списка заказов за определенный период /// diff --git a/SushiBarContracts/ViewModels/ReportSushiComponentViewModel.cs b/SushiBarContracts/ViewModels/ReportSushiComponentViewModel.cs index b43a7b3..f01efcb 100644 --- a/SushiBarContracts/ViewModels/ReportSushiComponentViewModel.cs +++ b/SushiBarContracts/ViewModels/ReportSushiComponentViewModel.cs @@ -1,6 +1,6 @@ namespace SushiBarContracts.ViewModels { - public class ReportSushisComponentViewModel + public class ReportSushiComponentViewModel { public string ComponentName { get; set; } = string.Empty; public int TotalCount { get; set; }