diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs index c72736b..853580e 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OrderLogic.cs @@ -78,6 +78,11 @@ namespace FurnitureAssemblyBusinessLogic if (modelNew == 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; + } model.Status = modelNew.Status; model.ImplementerId = modelNew.ImplementerId; if (!ChangeStatus(model, OrderStatus.Готов)) @@ -97,12 +102,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; - } + model.Status = modelNew.Status; model.ImplementerId = modelNew.ImplementerId;