From 75e4c71d5defdc5137207b46b2ece54109d98c4d Mon Sep 17 00:00:00 2001 From: dasha Date: Thu, 9 Mar 2023 13:13:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D1=88=D0=BB=D0=BE=D0=B3=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SushiBarContracts/StoragesContracts/IShopStorage.cs | 1 - SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs | 9 +-------- SushiBar/SushiBarListImplement/Implements/ShopStorage.cs | 5 ----- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs b/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs index 0028fe5..d2b3b6e 100644 --- a/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs +++ b/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs @@ -13,7 +13,6 @@ namespace SushiBarContracts.StoragesContracts ShopViewModel? Insert(ShopBindingModel model); ShopViewModel? Update(ShopBindingModel model); ShopViewModel? Delete(ShopBindingModel model); - bool IsEnoughSushi(ISushiModel model, int count); bool SellSushi(ISushiModel model, int count); } } diff --git a/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs b/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs index d8d5302..18ecd1d 100644 --- a/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs +++ b/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs @@ -72,16 +72,9 @@ namespace SushiBarFileImplement.Implements return null; } - public bool IsEnoughSushi(ISushiModel model, int count) - { - int temp = source.Shops - .Select(x => x.ListSushi.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum(); - return temp >= count; - } - public bool SellSushi(ISushiModel model, int count) { - if (!IsEnoughSushi(model, count)) + if (source.Shops.Select(x => x.ListSushi.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum() < count) { return false; } diff --git a/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs b/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs index f7c55c9..1f85f14 100644 --- a/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs +++ b/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs @@ -100,11 +100,6 @@ namespace SushiBarListImplement.Implements return null; } - public bool IsEnoughSushi(ISushiModel model, int count) - { - throw new NotImplementedException(); - } - public bool SellSushi(ISushiModel model, int count) { throw new NotImplementedException();