From 461e4aa2c9147b36a98874cf9f82e27a4166b9a7 Mon Sep 17 00:00:00 2001 From: dasha Date: Tue, 11 Apr 2023 16:31:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SushiBarBusinessLogic/BusinessLogics/WorkModeling.cs | 4 ++-- SushiBar/SushiBarDatabaseImplement/Models/Order.cs | 5 +++-- SushiBar/SushiBarFileImplement/Models/Order.cs | 3 ++- SushiBar/SushiBarListImplement/Models/Order.cs | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/WorkModeling.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/WorkModeling.cs index 27176b4..8f71021 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/WorkModeling.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/WorkModeling.cs @@ -76,6 +76,8 @@ namespace SushiBarBusinessLogic.BusinessLogics { Id = order.Id }); + // отдыхаем + Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100)); } // кто-то мог уже перехватить заказ, игнорируем ошибку catch (InvalidOperationException ex) @@ -88,8 +90,6 @@ namespace SushiBarBusinessLogic.BusinessLogics _logger.LogError(ex, "Error while do work"); throw; } - // отдыхаем - Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100)); } }); } diff --git a/SushiBar/SushiBarDatabaseImplement/Models/Order.cs b/SushiBar/SushiBarDatabaseImplement/Models/Order.cs index 0c8cd1c..f15634f 100644 --- a/SushiBar/SushiBarDatabaseImplement/Models/Order.cs +++ b/SushiBar/SushiBarDatabaseImplement/Models/Order.cs @@ -53,8 +53,9 @@ namespace SushiBarDatabaseImplement.Models return; } Status = model.Status; - DateImplement = model.DateImplement; - ImplementerId = model.ImplementerId; + DateImplement = model.DateImplement; + if (model.ImplementerId.HasValue) + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() diff --git a/SushiBar/SushiBarFileImplement/Models/Order.cs b/SushiBar/SushiBarFileImplement/Models/Order.cs index 483ddac..a52d7fa 100644 --- a/SushiBar/SushiBarFileImplement/Models/Order.cs +++ b/SushiBar/SushiBarFileImplement/Models/Order.cs @@ -65,7 +65,8 @@ namespace SushiBarFileImplement.Models } Status = model.Status; DateImplement = model.DateImplement; - ImplementerId = model.ImplementerId; + if (model.ImplementerId.HasValue) + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() diff --git a/SushiBar/SushiBarListImplement/Models/Order.cs b/SushiBar/SushiBarListImplement/Models/Order.cs index 90710ee..e6ef6ae 100644 --- a/SushiBar/SushiBarListImplement/Models/Order.cs +++ b/SushiBar/SushiBarListImplement/Models/Order.cs @@ -42,8 +42,9 @@ namespace SushiBarListImplement.Models return; } Status = model.Status; - ImplementerId = model.ImplementerId; - DateImplement = model.DateImplement; + ImplementerId = model.ImplementerId; + if (model.ImplementerId.HasValue) + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() {