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)
{
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();
}

View File

@ -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;

View File

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

View File

@ -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)

View File

@ -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++;
}

View File

@ -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();
}
}