From 47cf1ab393c6bff938ff71c4c8f04ae99d3740ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Mon, 6 Feb 2023 21:41:16 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConfectionaryBusinessLogic/OrderLogic.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ConfectionaryBusinessLogic/OrderLogic.cs b/ConfectionaryBusinessLogic/OrderLogic.cs index 441332b..064e5a6 100644 --- a/ConfectionaryBusinessLogic/OrderLogic.cs +++ b/ConfectionaryBusinessLogic/OrderLogic.cs @@ -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? ReadList(OrderSearchModel? model) @@ -99,6 +97,11 @@ namespace ConfectioneryBusinessLogic.BusinessLogics nameof(vmodel)); } model.Status = orderStatus; + model.DateCreate = vmodel.DateCreate; + 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"); From 8ceb065f328050bbdee26659d465f17b03052c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Mon, 6 Feb 2023 22:05:06 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConfectionaryBusinessLogic/OrderLogic.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ConfectionaryBusinessLogic/OrderLogic.cs b/ConfectionaryBusinessLogic/OrderLogic.cs index 064e5a6..1471185 100644 --- a/ConfectionaryBusinessLogic/OrderLogic.cs +++ b/ConfectionaryBusinessLogic/OrderLogic.cs @@ -98,7 +98,8 @@ namespace ConfectioneryBusinessLogic.BusinessLogics } model.Status = orderStatus; model.DateCreate = vmodel.DateCreate; - model.DateImplement = vmodel.DateImplement; + if (model.DateImplement == null) + model.DateImplement = vmodel.DateImplement; model.PastryId = vmodel.PastryId; model.Sum = vmodel.Sum; model.Count= vmodel.Count;