Шаг 2.не знаю - fix "готово"

This commit is contained in:
Кашин Максим 2023-03-14 11:24:23 +04:00
parent 1d143d2846
commit aff68c7469
2 changed files with 9 additions and 2 deletions

View File

@ -59,12 +59,17 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
} }
if (viewModel.Status + 1 != newStatus) if (viewModel.Status + 1 != newStatus)
{
_logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Order status incorrect.");
return false;
}
model.Status = newStatus; model.Status = newStatus;
if (model.Status == OrderStatus.Готов) if (model.Status == OrderStatus.Готов)
{ {
model.DateImplement = DateTime.Now; model.DateImplement = DateTime.Now;
var reinforced = _reinforcedStorage.GetElement(new() { Id = viewModel.ReinforcedId }); var reinforced = _reinforcedStorage.GetElement(new() { Id = viewModel.ReinforcedId });
if (reinforced == null) if (reinforced == null)
@ -83,10 +88,12 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
} }
CheckModel(model, false); CheckModel(model, false);
if (_orderStorage.Update(model) == null) if (_orderStorage.Update(model) == null)
{ {
model.Status--; model.Status--;
_logger.LogWarning("Update operation failed"); _logger.LogWarning("Update operation failed");
return false; return false;
} }