fix
This commit is contained in:
parent
e05c2bfeb3
commit
9f4419ada0
@ -98,6 +98,15 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
|
|||||||
$"Доступный статус: {(OrderStatus)((int)vmodel.Status + 1)}",
|
$"Доступный статус: {(OrderStatus)((int)vmodel.Status + 1)}",
|
||||||
nameof(vmodel));
|
nameof(vmodel));
|
||||||
}
|
}
|
||||||
|
if (orderStatus == OrderStatus.Готов)
|
||||||
|
{
|
||||||
|
var vreinforced = _reinforcedStorage.GetElement(new() { Id = vmodel.ReinforcedId });
|
||||||
|
|
||||||
|
if (vreinforced == null || !_shopLogic.AddReinforcedsInShops(vreinforced, vmodel.Count))
|
||||||
|
{
|
||||||
|
throw new Exception($"Не удалось заполнить магазины изделием '{vreinforced?.ReinforcedName ?? string.Empty}' из заказа {vmodel.Id}");
|
||||||
|
}
|
||||||
|
}
|
||||||
model.Status = orderStatus;
|
model.Status = orderStatus;
|
||||||
model.ReinforcedId = vmodel.ReinforcedId;
|
model.ReinforcedId = vmodel.ReinforcedId;
|
||||||
model.Sum = vmodel.Sum;
|
model.Sum = vmodel.Sum;
|
||||||
|
@ -13,5 +13,7 @@ namespace PrecastConcretePlantContracts.BusinessLogicsContracts
|
|||||||
bool Update(ShopBindingModel model);
|
bool Update(ShopBindingModel model);
|
||||||
bool Delete(ShopBindingModel model);
|
bool Delete(ShopBindingModel model);
|
||||||
bool AddReinforced(ShopSearchModel model, IReinforcedModel reinforced, int count);
|
bool AddReinforced(ShopSearchModel model, IReinforcedModel reinforced, int count);
|
||||||
|
bool AddReinforcedsInShops(IReinforcedModel reinforceds, int count);
|
||||||
|
public bool SellReinforceds(IReinforcedModel reinforceds, int needCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user