Musoev D.T. LabWork_4 Base #4

Closed
Denis wants to merge 3 commits from LabWork_4 into LabWork_3
Showing only changes of commit 503c053836 - Show all commits

View File

@ -29,7 +29,6 @@ namespace FlowerShopBusinessLogic.BusinessLogics
public List<ReportBouquetComponentViewModel> GetBouquetComponents()
{
var components = _componentStorage.GetFullList();
var bouquets = _bouquetStorage.GetFullList();
var list = new List<ReportBouquetComponentViewModel>();
foreach (var bouquet in bouquets)
@ -40,13 +39,10 @@ namespace FlowerShopBusinessLogic.BusinessLogics
Components = new List<(string Component, int Count)>(),
TotalCount = 0
};
foreach (var component in components)
foreach (var component in bouquet.BouquetComponents)
{
if (bouquet.BouquetComponents.ContainsKey(component.Id))
{
record.Components.Add(new(component.ComponentName, bouquet.BouquetComponents[component.Id].Item2));
record.TotalCount += bouquet.BouquetComponents[component.Id].Item2;
}
record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2));
record.TotalCount += component.Value.Item2;
}
list.Add(record);
}