This commit is contained in:
Kate 2023-06-13 13:05:51 +03:00
parent 6a8eb870c9
commit 78a6283a1a
6 changed files with 15 additions and 9 deletions

View File

@ -262,8 +262,8 @@ namespace PrecastConcretePlantView
private void загруженностьМагазиновToolStripMenuItem_Click(object sender, EventArgs e) private void загруженностьМагазиновToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var service = Program.ServiceProvider?.GetService(typeof(FormReportShopTravels)); var service = Program.ServiceProvider?.GetService(typeof(FormReportShopReinforceds));
if (service is FormReportShopTravels form) if (service is FormReportShopReinforceds form)
{ {
form.ShowDialog(); form.ShowDialog();
} }

View File

@ -1,5 +1,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Reporting.WinForms; using Microsoft.Reporting.WinForms;
using PrecastConcretePlantContracts.BindingModels;
using PrecastConcretePlantContracts.BusinessLogicsContracts;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;

View File

@ -1,4 +1,6 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using PrecastConcretePlantContracts.BindingModels;
using PrecastConcretePlantContracts.BusinessLogicsContracts;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;

View File

@ -13,15 +13,17 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
private readonly IComponentStorage _componentStorage; private readonly IComponentStorage _componentStorage;
private readonly IReinforcedStorage _reinforcedStorage; private readonly IReinforcedStorage _reinforcedStorage;
private readonly IOrderStorage _orderStorage; private readonly IOrderStorage _orderStorage;
private readonly IShopStorage _shopStorage;
private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToExcel _saveToExcel;
private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToWord _saveToWord;
private readonly AbstractSaveToPdf _saveToPdf; private readonly AbstractSaveToPdf _saveToPdf;
public ReportLogic(IReinforcedStorage reinforcedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, public ReportLogic(IReinforcedStorage reinforcedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage,
AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) IShopStorage shopStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf)
{ {
_reinforcedStorage = reinforcedStorage; _reinforcedStorage = reinforcedStorage;
_componentStorage = componentStorage; _componentStorage = componentStorage;
_orderStorage = orderStorage; _orderStorage = orderStorage;
_shopStorage = shopStorage;
_saveToExcel = saveToExcel; _saveToExcel = saveToExcel;
_saveToWord = saveToWord; _saveToWord = saveToWord;
_saveToPdf = saveToPdf; _saveToPdf = saveToPdf;
@ -161,11 +163,11 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
} }
public void SaveShopReinforcedToExcelFile(ReportBindingModel model) public void SaveShopReinforcedToExcelFile(ReportBindingModel model)
{ {
_saveToExcel.CreateShopReport(new ExcelInfo _saveToExcel.CreateShopReport(new ExcelInfoShop
{ {
FileName = model.FileName, FileName = model.FileName,
Title = "Список магазинов", Title = "Список магазинов",
ShopTravels = GetShopReinforced() ShopReinforceds = GetShopReinforced()
}); });
} }
public void SaveOrdersByDateToPdfFile(ReportBindingModel model) public void SaveOrdersByDateToPdfFile(ReportBindingModel model)

View File

@ -78,7 +78,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage
} }
SaveExcel(info); SaveExcel(info);
} }
public void CreateShopReport(ExcelInfo info) public void CreateShopReport(ExcelInfoShop info)
{ {
CreateExcel(new ExcelInfo() { FileName = info.FileName }); CreateExcel(new ExcelInfo() { FileName = info.FileName });
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
@ -111,14 +111,14 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage
ColumnName = "B", ColumnName = "B",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = reinforced.Item1, Text = reinforced.Item1,
StyleInfo = ExcelStyleInfoType.TextWithBorder StyleInfo = ExcelStyleInfoType.TextWithBroder
}); });
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
{ {
ColumnName = "C", ColumnName = "C",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = reinforced.Item2.ToString(), Text = reinforced.Item2.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBorder StyleInfo = ExcelStyleInfoType.TextWithBroder
}); });
rowIndex++; rowIndex++;
} }

View File

@ -12,6 +12,6 @@ namespace PrecastConcretePlantContracts.ViewModels
public int TotalCount { get; set; } 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();
} }
} }