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