ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №6 усложненная #19

Closed
Zakharov_Rostislav wants to merge 16 commits from lab-6-hard into lab-5-hard
Showing only changes of commit 94ca959be1 - Show all commits

View File

@ -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.Ожидает;