Agliullov D. A. Lab work 1 Base #2

Closed
d.agliullov wants to merge 14 commits from Lab1_Base into main
Showing only changes of commit 47cf1ab393 - Show all commits

View File

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

Требуется сменить только статус, зачем все поля передавать?

Требуется сменить только статус, зачем все поля передавать?
model.DateImplement = vmodel.DateImplement;
model.PastryId = vmodel.PastryId;
model.Sum = vmodel.Sum;
model.Count= vmodel.Count;
if (_orderStorage.Update(model) == null)
{
_logger.LogWarning("Update operation failed");