diff --git a/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/ReportLogic.cs b/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/ReportLogic.cs index 6ba31b5..dbf4dde 100644 --- a/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/ReportLogic.cs @@ -29,7 +29,6 @@ namespace FlowerShopBusinessLogic.BusinessLogics public List GetBouquetComponents() { - var components = _componentStorage.GetFullList(); var bouquets = _bouquetStorage.GetFullList(); var list = new List(); 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); }