From d2982a5d5f20206068407df70efa50698225e8ba Mon Sep 17 00:00:00 2001 From: Artyom_Yashin Date: Tue, 7 May 2024 23:26:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=90=D1=80=D0=B1=D0=B0=D0=B9=D1=82=D0=B5?= =?UTF-8?q?=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ComputersShop/ComputersShop/FormMain.cs | 3 +-- .../ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs | 2 +- .../ComputersShopDatabaseImplement/Implements/OrderStorage.cs | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ComputersShop/ComputersShop/FormMain.cs b/ComputersShop/ComputersShop/FormMain.cs index 468605b..bee63e0 100644 --- a/ComputersShop/ComputersShop/FormMain.cs +++ b/ComputersShop/ComputersShop/FormMain.cs @@ -201,8 +201,7 @@ namespace ComputersShop private void запускРаботToolStripMenuItem_Click(object sender, EventArgs e) { - _workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic - )) as IImplementerLogic)!, _orderLogic); + _workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic); MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs index 03abf4b..7042ec4 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs @@ -139,7 +139,7 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogWarning("Read operation failed"); return false; } - if (element.Status != status - 1 || element.Status == OrderStatus.Готов) + if (!(element.Status == status - 1 || element.Status == OrderStatus.Готов)) { _logger.LogWarning("Status change operation failed"); throw new InvalidOperationException("Текущий статус заказа не может быть переведен в выбранный"); diff --git a/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs index c409869..6dc3adf 100644 --- a/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs +++ b/ComputersShop/ComputersShopDatabaseImplement/Implements/OrderStorage.cs @@ -29,7 +29,8 @@ namespace ComputersShopDatabaseImplement.Implements (!model.Id.HasValue || x.Id == model.Id) && (!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) && (!model.DateTo.HasValue || x.DateCreate <= model.DateTo) && - (!model.ClientId.HasValue || x.ClientId == model.ClientId) + (!model.ClientId.HasValue || x.ClientId == model.ClientId) && + (!model.Status.HasValue || x.Status == model.Status) ) ) .Select(x => x.GetViewModel)