From 4c1eb57d1495343f3a18431eeae846bc2e764a8c Mon Sep 17 00:00:00 2001 From: "a.puchkina" Date: Wed, 10 Apr 2024 12:02:32 +0400 Subject: [PATCH] =?UTF-8?q?4=20=D0=BB=D0=B0=D0=B1=D0=B0,=20=D1=83=D0=B1?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D0=BB=D0=B0=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B8=D0=B7=20ReportLogic=20GetTravelComponents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/ReportLogic.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/TravelCompany/TravelCompanyBusinessLogic/BusinessLogic/ReportLogic.cs b/TravelCompany/TravelCompanyBusinessLogic/BusinessLogic/ReportLogic.cs index 2bc757b..898b93a 100644 --- a/TravelCompany/TravelCompanyBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/TravelCompany/TravelCompanyBusinessLogic/BusinessLogic/ReportLogic.cs @@ -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); }