This commit is contained in:
Дмитрий Блохин 2024-04-18 18:39:10 +04:00
parent 839353894d
commit ba374506a4

View File

@ -33,34 +33,28 @@ namespace FishFactoryBusinessLogic.BusinessLogics
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
}
public List<ReportCannedComponentViewModel> GetCannedComponent()
{
var components = _componentStorage.GetFullList();
var canneds = _cannedStorage.GetFullList();
var list = new List<ReportCannedComponentViewModel>();
foreach (var canned in canneds)
{
var record = new ReportCannedComponentViewModel
{
CannedName = canned.CannedName,
Components = new List<Tuple<string, int>>(),
TotalCount = 0
};
foreach (var component in components)
{
if (canned.CannedComponents.ContainsKey(component.Id))
{
record.Components.Add(new Tuple<string,
int>(component.ComponentName, canned.CannedComponents[component.Id].Item2));
record.TotalCount +=
canned.CannedComponents[component.Id].Item2;
}
}
list.Add(record);
}
return list;
}
public List<ReportOrdersViewModel> GetOrders(ReportBindingModel model)
public List<ReportCannedComponentViewModel> GetCannedComponent()
{
var canneds = _cannedStorage.GetFullList();
var list = new List<ReportCannedComponentViewModel>();
foreach (var canned in canneds)
{
var record = new ReportCannedComponentViewModel
{
CannedName = canned.CannedName,
Components = new List<Tuple<string, int>>(),
TotalCount = 0
};
foreach (var component in canned.CannedComponents.Values)
{
record.Components.Add(new Tuple<string, int>(component.Item1.ComponentName, component.Item2));
record.TotalCount += component.Item2;
}
list.Add(record);
}
return list;
}
public List<ReportOrdersViewModel> GetOrders(ReportBindingModel model)
{
return _orderStorage.GetFilteredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo })
.Select(x => new ReportOrdersViewModel