4 лаба, убарала список компонентов из ReportLogic GetTravelComponents

This commit is contained in:
a.puchkina 2024-04-10 12:02:32 +04:00
parent 1b62d53fc4
commit 4c1eb57d14

View File

@ -44,13 +44,10 @@ namespace TravelCompanyBusinessLogic.BusinessLogic
Components = new List<(string Component, int Count)>(),
TotalCount = 0
};
foreach (var component in components)
foreach (var component in Travel.TravelComponents)
{
if (Travel.TravelComponents.ContainsKey(component.Id))
{
record.Components.Add(new(component.ComponentName, Travel.TravelComponents[component.Id].Item2));
record.TotalCount += Travel.TravelComponents[component.Id].Item2;
}
record.Components.Add(new(component.Value.Item1.ComponentName, component.Value.Item2));
record.TotalCount += component.Value.Item2;
}
list.Add(record);
}