From a956ac08f59499214f1039589838c6ae9c2fad65 Mon Sep 17 00:00:00 2001 From: GokaPek Date: Sat, 22 Jun 2024 10:50:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BD=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractLawFirmFileImpliment/Implements/ShopStorage.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/LawFirm/AbstractLawFirmFileImpliment/Implements/ShopStorage.cs b/LawFirm/AbstractLawFirmFileImpliment/Implements/ShopStorage.cs index bb6969c..914ceb8 100644 --- a/LawFirm/AbstractLawFirmFileImpliment/Implements/ShopStorage.cs +++ b/LawFirm/AbstractLawFirmFileImpliment/Implements/ShopStorage.cs @@ -94,12 +94,9 @@ namespace AbstractLawFirmFileImplement.Implements var shopDocuments = source.Shops.SelectMany(shop => shop.ShopDocuments.Where(c => c.Value.Item1.Id == document.Id)); - int countStore = 0; + int countStore = shopDocuments.Sum(it => it.Value.Item2); - foreach (var it in shopDocuments) - countStore += it.Value.Item2; - - if (count > countStore) + if (count > countStore) return false; foreach (var shop in source.Shops)