From 5cfafad105d2255c0f4e6f5f7a857229aa010018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Thu, 13 Apr 2023 10:58:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20GetShopReinforcedies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/ReportLogic.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs index 6b0ee1c..88ae636 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/ReportLogic.cs @@ -112,8 +112,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic { var shops = _shopStorage.GetFullList(); - var reinforcedies = _reinforcedStorage.GetFullList(); - var list = new List(); foreach (var shop in shops) @@ -121,18 +119,14 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic var record = new ReportShopReinforcedViewModel { ShopName = shop.Name, - Reinforcedies = new List>(), + Reinforcedies = new(), TotalCount = 0 }; - foreach (var reinforced in reinforcedies) + foreach (var reinforced in shop.ShopReinforcedies) { - if (shop.ShopReinforcedies.ContainsKey(reinforced.Id)) - { - record.Reinforcedies.Add(new(reinforced.ReinforcedName, shop.ShopReinforcedies[reinforced.Id].Item2)); - record.TotalCount += shop.ShopReinforcedies[reinforced.Id].Item2; - } + record.Reinforcedies.Add(new(reinforced.Value.Item1.ReinforcedName, reinforced.Value.Item2)); + record.TotalCount += reinforced.Value.Item2; } - record.Workload = record.TotalCount / (double)shop.ReinforcedMaxCount; list.Add(record); }