From 78a6283a1ad2619ad19426566557215d6ca2f4ab Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 13 Jun 2023 13:05:51 +0300 Subject: [PATCH] fix 5h --- PrecastConcretePlant/FormMain.cs | 4 ++-- PrecastConcretePlant/FormReportOrdersByDate.cs | 2 ++ PrecastConcretePlant/FormReportShopReinforceds.cs | 2 ++ .../BusinessLogic/ReportLogic.cs | 8 +++++--- .../OfficePackage/AbstractSaveToExcel.cs | 6 +++--- .../ViewModels/ReportShopReinforcedViewModel.cs | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/PrecastConcretePlant/FormMain.cs b/PrecastConcretePlant/FormMain.cs index a62f32b..e8bcfde 100644 --- a/PrecastConcretePlant/FormMain.cs +++ b/PrecastConcretePlant/FormMain.cs @@ -262,8 +262,8 @@ namespace PrecastConcretePlantView private void загруженностьМагазиновToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormReportShopTravels)); - if (service is FormReportShopTravels form) + var service = Program.ServiceProvider?.GetService(typeof(FormReportShopReinforceds)); + if (service is FormReportShopReinforceds form) { form.ShowDialog(); } diff --git a/PrecastConcretePlant/FormReportOrdersByDate.cs b/PrecastConcretePlant/FormReportOrdersByDate.cs index 206469e..36e5eb7 100644 --- a/PrecastConcretePlant/FormReportOrdersByDate.cs +++ b/PrecastConcretePlant/FormReportOrdersByDate.cs @@ -1,5 +1,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Reporting.WinForms; +using PrecastConcretePlantContracts.BindingModels; +using PrecastConcretePlantContracts.BusinessLogicsContracts; using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/PrecastConcretePlant/FormReportShopReinforceds.cs b/PrecastConcretePlant/FormReportShopReinforceds.cs index 6285970..8b3c7f6 100644 --- a/PrecastConcretePlant/FormReportShopReinforceds.cs +++ b/PrecastConcretePlant/FormReportShopReinforceds.cs @@ -1,4 +1,6 @@ using Microsoft.Extensions.Logging; +using PrecastConcretePlantContracts.BindingModels; +using PrecastConcretePlantContracts.BusinessLogicsContracts; using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs b/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs index 6e08751..0905d42 100644 --- a/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs @@ -13,15 +13,17 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics private readonly IComponentStorage _componentStorage; private readonly IReinforcedStorage _reinforcedStorage; private readonly IOrderStorage _orderStorage; + private readonly IShopStorage _shopStorage; private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; public ReportLogic(IReinforcedStorage reinforcedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, - AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) + IShopStorage shopStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { _reinforcedStorage = reinforcedStorage; _componentStorage = componentStorage; _orderStorage = orderStorage; + _shopStorage = shopStorage; _saveToExcel = saveToExcel; _saveToWord = saveToWord; _saveToPdf = saveToPdf; @@ -161,11 +163,11 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics } public void SaveShopReinforcedToExcelFile(ReportBindingModel model) { - _saveToExcel.CreateShopReport(new ExcelInfo + _saveToExcel.CreateShopReport(new ExcelInfoShop { FileName = model.FileName, Title = "Список магазинов", - ShopTravels = GetShopReinforced() + ShopReinforceds = GetShopReinforced() }); } public void SaveOrdersByDateToPdfFile(ReportBindingModel model) diff --git a/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 92bf8d4..eca3bf3 100644 --- a/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -78,7 +78,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage } SaveExcel(info); } - public void CreateShopReport(ExcelInfo info) + public void CreateShopReport(ExcelInfoShop info) { CreateExcel(new ExcelInfo() { FileName = info.FileName }); InsertCellInWorksheet(new ExcelCellParameters @@ -111,14 +111,14 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage ColumnName = "B", RowIndex = rowIndex, Text = reinforced.Item1, - StyleInfo = ExcelStyleInfoType.TextWithBorder + StyleInfo = ExcelStyleInfoType.TextWithBroder }); InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "C", RowIndex = rowIndex, Text = reinforced.Item2.ToString(), - StyleInfo = ExcelStyleInfoType.TextWithBorder + StyleInfo = ExcelStyleInfoType.TextWithBroder }); rowIndex++; } diff --git a/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs b/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs index c255564..7e7b7cb 100644 --- a/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs +++ b/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs @@ -12,6 +12,6 @@ namespace PrecastConcretePlantContracts.ViewModels public int TotalCount { get; set; } - public List<(string Travel, int Count)> Travels { get; set; } = new(); + public List<(string Reinforced, int Count)> Reinforceds { get; set; } = new(); } }