Fix
This commit is contained in:
parent
60dbd3137f
commit
58b7de8dfd
@ -51,6 +51,7 @@ namespace PizzeriaBusinessLogic.BusinessLogics
|
||||
}
|
||||
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
|
||||
return list;
|
||||
|
||||
}
|
||||
public bool CreateOrder(OrderBindingModel model)
|
||||
{
|
||||
@ -92,12 +93,11 @@ namespace PizzeriaBusinessLogic.BusinessLogics
|
||||
Count = model.Count
|
||||
}))
|
||||
{
|
||||
if (model.Status == OrderStatus.Готов)
|
||||
if (model.Status == OrderStatus.Готов || model.Status == OrderStatus.Ожидает)
|
||||
{
|
||||
model.Status = OrderStatus.Ожидает;
|
||||
UpdateOrder(model);
|
||||
return UpdateOrder(model);
|
||||
}
|
||||
throw new ArgumentException("Недостаточно места в магазинах для поставки");
|
||||
}
|
||||
model.Status = OrderStatus.Выдан;
|
||||
return UpdateOrder(model);
|
||||
|
@ -36,12 +36,13 @@ namespace PizzeriaBusinessLogic.BusinessLogics
|
||||
return;
|
||||
}
|
||||
var orders = _orderLogic.ReadList(new OrderSearchModel { Status = OrderStatus.Выдан });
|
||||
int count = _orderLogic.ReadList(new OrderSearchModel()).Count;
|
||||
int count = _orderLogic.ReadList(null).Count;
|
||||
if (orders == null || count == orders.Count)
|
||||
{
|
||||
_logger.LogWarning("DoWork. Orders is null or empty");
|
||||
return;
|
||||
}
|
||||
orders = _orderLogic.ReadList(null);
|
||||
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
||||
foreach (var implementer in implementers)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ using PizzeriaDatabaseImplement;
|
||||
namespace PizzeriaDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(PizzeriaDatabase))]
|
||||
[Migration("20230503204906_init")]
|
||||
[Migration("20230504051520_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <inheritdoc />
|
Loading…
Reference in New Issue
Block a user