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");