From 90535a3315a8b4eef3437c92fc0a4cc53b41ec33 Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Mon, 11 Mar 2024 11:03:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/ShopStorage.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LawFirm/AbstractLawFirmFileImplement/Implements/ShopStorage.cs b/LawFirm/AbstractLawFirmFileImplement/Implements/ShopStorage.cs index d53eb91..5efdaf7 100644 --- a/LawFirm/AbstractLawFirmFileImplement/Implements/ShopStorage.cs +++ b/LawFirm/AbstractLawFirmFileImplement/Implements/ShopStorage.cs @@ -83,15 +83,15 @@ namespace AbstractLawFirmFileImplement.Implements public bool SellDocument(IDocumentModel model, int count) { - var car = source.Documents.FirstOrDefault(x => x.Id == model.Id); + var document = source.Documents.FirstOrDefault(x => x.Id == model.Id); - if (car == null) + if (document == null) { return false; } - var shopDocuments = source.Shops.SelectMany(shop => shop.ShopDocuments.Where(c => c.Value.Item1.Id == car.Id)); + var shopDocuments = source.Shops.SelectMany(shop => shop.ShopDocuments.Where(c => c.Value.Item1.Id == document.Id)); int countStore = 0; @@ -105,7 +105,7 @@ namespace AbstractLawFirmFileImplement.Implements { var documents = shop.ShopDocuments; - foreach (var c in documents.Where(x => x.Value.Item1.Id == car.Id)) + foreach (var c in documents.Where(x => x.Value.Item1.Id == document.Id)) { int min = Math.Min(c.Value.Item2, count); documents[c.Value.Item1.Id] = (c.Value.Item1, c.Value.Item2 - min);