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