Исправлены заказы
This commit is contained in:
parent
241e701722
commit
8571a9a747
@ -39,7 +39,13 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
|
|||||||
|
|
||||||
public bool TakeOrderInWork(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выполняется);
|
public bool TakeOrderInWork(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выполняется);
|
||||||
public bool DeliveryOrder(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выдан);
|
public bool DeliveryOrder(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выдан);
|
||||||
public bool FinishOrder(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Готов);
|
public bool FinishOrder(OrderBindingModel model)
|
||||||
|
{
|
||||||
|
var res = SetOrderStatus(model, OrderStatus.Готов);
|
||||||
|
if (res)
|
||||||
|
model.DateImplement = DateTime.Now;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
|
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ namespace ConfectioneryListImplement
|
|||||||
{
|
{
|
||||||
if (model.Id.HasValue && order.Id == model.Id)
|
if (model.Id.HasValue && order.Id == model.Id)
|
||||||
{
|
{
|
||||||
return order.GetViewModel;
|
return GetViewModel(order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -55,7 +55,7 @@ namespace ConfectioneryListImplement
|
|||||||
{
|
{
|
||||||
if (order.Id == model.Id)
|
if (order.Id == model.Id)
|
||||||
{
|
{
|
||||||
return new() { order.GetViewModel };
|
return new() { GetViewModel(order) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new();
|
return new();
|
||||||
@ -66,7 +66,7 @@ namespace ConfectioneryListImplement
|
|||||||
var result = new List<OrderViewModel>();
|
var result = new List<OrderViewModel>();
|
||||||
foreach (var order in _source.Orders)
|
foreach (var order in _source.Orders)
|
||||||
{
|
{
|
||||||
result.Add(order.GetViewModel);
|
result.Add(GetViewModel(order));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -102,5 +102,19 @@ namespace ConfectioneryListImplement
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private OrderViewModel GetViewModel(Order model)
|
||||||
|
{
|
||||||
|
var res = model.GetViewModel;
|
||||||
|
foreach (var pastry in _source.Pastry)
|
||||||
|
{
|
||||||
|
if (pastry.Id == model.PastryId)
|
||||||
|
{
|
||||||
|
res.PastryName = pastry.PastryName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ namespace ConfectioneryView
|
|||||||
{
|
{
|
||||||
dataGridView.DataSource = list;
|
dataGridView.DataSource = list;
|
||||||
dataGridView.Columns["Id"].Visible = false;
|
dataGridView.Columns["Id"].Visible = false;
|
||||||
/*dataGridView.Columns["PastryName"].AutoSizeMode =
|
dataGridView.Columns["PastryName"].AutoSizeMode =
|
||||||
DataGridViewAutoSizeColumnMode.Fill;*/
|
DataGridViewAutoSizeColumnMode.Fill;
|
||||||
}
|
}
|
||||||
_logger.LogInformation("Çàãðóçêà çàêàçîâ");
|
_logger.LogInformation("Çàãðóçêà çàêàçîâ");
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ namespace ConfectioneryView
|
|||||||
{
|
{
|
||||||
dataGridView.DataSource = list;
|
dataGridView.DataSource = list;
|
||||||
dataGridView.Columns["Id"].Visible = false;
|
dataGridView.Columns["Id"].Visible = false;
|
||||||
|
dataGridView.Columns["PastryComponents"].Visible = false;
|
||||||
dataGridView.Columns["PastryName"].AutoSizeMode =
|
dataGridView.Columns["PastryName"].AutoSizeMode =
|
||||||
DataGridViewAutoSizeColumnMode.Fill;
|
DataGridViewAutoSizeColumnMode.Fill;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user