Merge branch 'Lab1_Base' into Lab1_Hard

This commit is contained in:
Данияр Аглиуллов 2023-02-06 22:33:49 +04:00
commit 2cb3292cf8

View File

@ -41,10 +41,8 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
public bool DeliveryOrder(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выдан); public bool DeliveryOrder(OrderBindingModel model) => SetOrderStatus(model, OrderStatus.Выдан);
public bool FinishOrder(OrderBindingModel model) public bool FinishOrder(OrderBindingModel model)
{ {
var res = SetOrderStatus(model, OrderStatus.Готов);
if (res)
model.DateImplement = DateTime.Now; model.DateImplement = DateTime.Now;
return res; return SetOrderStatus(model, OrderStatus.Готов);
} }
public List<OrderViewModel>? ReadList(OrderSearchModel? model) public List<OrderViewModel>? ReadList(OrderSearchModel? model)
@ -99,6 +97,12 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
nameof(vmodel)); nameof(vmodel));
} }
model.Status = orderStatus; model.Status = orderStatus;
model.DateCreate = vmodel.DateCreate;
if (model.DateImplement == null)
model.DateImplement = vmodel.DateImplement;
model.PastryId = vmodel.PastryId;
model.Sum = vmodel.Sum;
model.Count= vmodel.Count;
if (_orderStorage.Update(model) == null) if (_orderStorage.Update(model) == null)
{ {
_logger.LogWarning("Update operation failed"); _logger.LogWarning("Update operation failed");