From d0ed9691237e14bbbe3a7f0455e3405e13260138 Mon Sep 17 00:00:00 2001 From: Kate Date: Sun, 21 May 2023 22:52:37 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=BB=D1=804?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/ReportLogic.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs b/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs index 3ba2a8e..8597407 100644 --- a/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs @@ -33,7 +33,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics /// public List GetReinforcedComponent() { - var components = _componentStorage.GetFullList(); var reinforceds = _reinforcedStorage.GetFullList(); var list = new List(); @@ -45,17 +44,13 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics Components = new List<(string, int)>(), TotalCount = 0 }; - foreach (var condition in components) + foreach (var component in reinforced.ReinforcedComponents) { - if (reinforced.ReinforcedComponents.ContainsKey(condition.Id)) - { - record.Components.Add(new(condition.ComponentName, reinforced.ReinforcedComponents[condition.Id].Item2)); - record.TotalCount += reinforced.ReinforcedComponents[condition.Id].Item2; - } + record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2)); + record.TotalCount += component.Value.Item2; } list.Add(record); } - return list; }