This commit is contained in:
Kate 2023-05-21 22:52:37 +03:00
parent 0cdb83845a
commit d0ed969123

View File

@ -33,7 +33,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
/// <returns></returns>
public List<ReportReinforcedComponentViewModel> GetReinforcedComponent()
{
var components = _componentStorage.GetFullList();
var reinforceds = _reinforcedStorage.GetFullList();
var list = new List<ReportReinforcedComponentViewModel>();
@ -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;
}