diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/OrderLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/OrderLogic.cs index 349ad70..fb6ecfb 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/OrderLogic.cs @@ -82,20 +82,20 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics _logger.LogWarning("Read operation failed"); return false; } - if (!(element.Status == status - 1 || model.Status == OrderStatus.Готов)) + if (!(element.Status == status - 1 || element.Status == OrderStatus.Готов)) { _logger.LogWarning("Status change operation failed"); throw new InvalidOperationException("Текущий статус заказа не может быть переведен в выбранный"); } if (element.Status == OrderStatus.Готов || element.Status == OrderStatus.Ожидает) { - var manufacture = _manufactureStorage.GetElement(new ManufactureSearchModel() { Id = model.ManufactureId }); + var manufacture = _manufactureStorage.GetElement(new ManufactureSearchModel() { Id = element.ManufactureId }); if (manufacture == null) { _logger.LogWarning("Status update to " + status.ToString() + " operation failed. Document not found."); return false; } - if (CheckSupply(manufacture, model.Count) == false) + if (CheckSupply(manufacture, element.Count) == false) { _logger.LogWarning("Status update to " + status.ToString() + " operation failed. Shop supply error."); status = OrderStatus.Ожидает;