From 1425accad00ef251424a1cdb1829554036e60f2c Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Wed, 19 Apr 2023 18:22:49 +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=BC=D0=BE=D0=B6=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BE=D0=B9=D1=82=D0=B8=D1=81=D1=8C=20=D1=86=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D1=8E=20=D0=B2=20=D0=B6=D0=B8=D0=B7=D0=BD=D1=8C...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssemblyBusinessLogic/OrderLogic.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs index b39df00..b56099c 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs @@ -77,6 +77,11 @@ namespace FurnitureAssemblyBusinessLogic if (model == null) { return false; } + if (!_shopLogic.AddFurnituresAtShops(new FurnitureBindingModel() { Id = model.FurnitureId }, model.Count)) + { + _logger.LogWarning("There are not empty places at shops. Replenishment is impossible"); + return false; + } if (!ChangeStatus(model, OrderStatus.Готов)) { _logger.LogWarning("Order's status is wrong"); @@ -93,13 +98,7 @@ namespace FurnitureAssemblyBusinessLogic { return false; } - - if (!_shopLogic.AddFurnituresAtShops(new FurnitureBindingModel() { Id = model.FurnitureId}, model.Count)) - { - _logger.LogWarning("There are not empty places at shops. Replenishment is impossible"); - return false; - } - + if (!ChangeStatus(model, OrderStatus.Выдан)) { _logger.LogWarning("Order's status is wrong");