Вроде работает
This commit is contained in:
parent
8b09ebcbaa
commit
0ef00332bc
@ -62,17 +62,11 @@ namespace FurnitureAssemblyBusinessLogic
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_logger.LogWarning($"");
|
||||
if (modelNew.ImplementerId.HasValue)
|
||||
{
|
||||
_logger.LogWarning($"Order {model.Id} is already in Work");
|
||||
throw new InvalidOperationException($"Order {model.Id} is already in Work");
|
||||
}
|
||||
model.Status = modelNew.Status;
|
||||
if (!ChangeStatus(model, OrderStatus.Выполняется))
|
||||
{
|
||||
_logger.LogWarning("Order's status is wrong");
|
||||
return false;
|
||||
throw new InvalidOperationException("Order's status is wrong");
|
||||
}
|
||||
_orderStorage.Update(model);
|
||||
return true;
|
||||
@ -86,21 +80,21 @@ namespace FurnitureAssemblyBusinessLogic
|
||||
}
|
||||
model.ImplementerId = modelNew.ImplementerId;
|
||||
model.Status = modelNew.Status;
|
||||
if (!_shopLogic.AddFurnituresAtShops(new FurnitureBindingModel() { Id = modelNew.FurnitureId }, modelNew.Count))
|
||||
{
|
||||
if (!ChangeStatus(model, OrderStatus.Ожидание))
|
||||
{
|
||||
_logger.LogWarning($"Order's status {model.Status} is wrong");
|
||||
return false;
|
||||
}
|
||||
_orderStorage.Update(model);
|
||||
_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");
|
||||
throw new InvalidOperationException("Order's status is wrong");
|
||||
}
|
||||
if (!_shopLogic.AddFurnituresAtShops(new FurnitureBindingModel() { Id = modelNew.FurnitureId }, modelNew.Count))
|
||||
{
|
||||
model.Status--;
|
||||
if (!ChangeStatus(model, OrderStatus.Ожидание))
|
||||
{
|
||||
_logger.LogWarning($"Order's status {model.Status} is wrong");
|
||||
throw new InvalidOperationException("Order's status is wrong");
|
||||
}
|
||||
_orderStorage.Update(model);
|
||||
_logger.LogWarning("There are not empty places at shops. Replenishment is impossible");
|
||||
return false;
|
||||
}
|
||||
model.DateImplement = DateTime.Now;
|
||||
|
Loading…
Reference in New Issue
Block a user