From 503c0538360bbcb6df155a97f41497061e462ab8 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 22 Apr 2023 01:21:11 +0400 Subject: [PATCH] fix --- .../BusinessLogics/ReportLogic.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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); }