ПИбд-22 Боровков М В 5 лабораторная работа #6
@ -32,23 +32,15 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
/// <returns></returns>
|
||||
public List<ReportSushiComponentViewModel> GetSushiComponent()
|
||||
{
|
||||
var components = _componentStorage.GetFullList();
|
||||
var sushis = _sushiStorage.GetFullList();
|
||||
var list = new List<ReportSushiComponentViewModel>();
|
||||
foreach (var sushi in sushis)
|
||||
{
|
||||
var record = new ReportSushiComponentViewModel
|
||||
{
|
||||
SushiName = sushi.SushiName,
|
||||
Components = new List<Tuple<string, int>>(),
|
||||
TotalCount = 0
|
||||
};
|
||||
foreach (var component in sushi.SushiComponents)
|
||||
{
|
||||
record.Components.Add(new Tuple<string, int>(
|
||||
component.Value.Item1.ComponentName,
|
||||
component.Value.Item2
|
||||
));
|
||||
record.TotalCount += component.Value.Item2;
|
||||
}
|
||||
list.Add(record);
|
||||
}
|
||||
@ -63,7 +55,6 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
{
|
||||
return _orderStorage.GetFilteredList(new OrderSearchModel
|
||||
{
|
||||
DateFrom = model.DateFrom,
|
||||
DateTo = model.DateTo
|
||||
})
|
||||
.Select(x => new ReportOrdersViewModel
|
||||
@ -80,13 +71,10 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
/// Сохранение компонент в файл-Word
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public void SaveSushisToWordFile(ReportBindingModel model)
|
||||
{
|
||||
_saveToWord.CreateDoc(new WordInfo
|
||||
{
|
||||
FileName = model.FileName,
|
||||
Title = "Список суши",
|
||||
Sushis = _sushiStorage.GetFullList()
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
@ -98,7 +86,6 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
_saveToExcel.CreateReport(new ExcelInfo
|
||||
{
|
||||
FileName = model.FileName,
|
||||
Title = "Список суши",
|
||||
SushiComponents = GetSushiComponent()
|
||||
});
|
||||
}
|
||||
|
@ -82,7 +82,6 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
|
||||
row.Cells[i].Borders.Right.Width = borderWidth;
|
||||
row.Cells[i].Borders.Top.Width = borderWidth;
|
||||
row.Cells[i].Borders.Bottom.Width = borderWidth;
|
||||
row.Cells[i].Format.Alignment = GetParagraphAlignment(rowParameters.ParagraphAlignment);
|
||||
row.Cells[i].VerticalAlignment = VerticalAlignment.Center;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user