diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs index 88ae636..91ad497 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs @@ -35,7 +35,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic public List GetReinforcedComponents() { - var components = _componentStorage.GetFullList(); var reinforceds = _reinforcedStorage.GetFullList(); var list = new List(); foreach (var reinforced in reinforceds) @@ -46,13 +45,10 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic Components = new List<(string Component, int Count)>(), TotalCount = 0 }; - foreach (var component in components) + foreach (var component in reinforced.ReinforcedComponents) { - if (reinforced.ReinforcedComponents.ContainsKey(component.Id)) - { - record.Components.Add(new(component.ComponentName, reinforced.ReinforcedComponents[component.Id].Item2)); - record.TotalCount += reinforced.ReinforcedComponents[component.Id].Item2; - } + record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2)); + record.TotalCount += component.Value.Item2; } list.Add(record); }