From 3caad41432b173a6a7cde1db6e451f4f6022c336 Mon Sep 17 00:00:00 2001 From: m1aksim1 Date: Mon, 8 May 2023 19:26:16 +0400 Subject: [PATCH] fix --- .../SoftwareInstallationBusinessLogic/OrderLogic.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OrderLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OrderLogic.cs index 1cae707..73c16b9 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/OrderLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/OrderLogic.cs @@ -15,6 +15,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics private readonly IOrderStorage _orderStorage; private readonly IPackageStorage _packageStorage; private readonly IShopLogic _shopLogic; + private static bool _finished = false; public OrderLogic(ILogger logger, IOrderStorage orderStorage, IPackageStorage packageStorage, IShopLogic shopLogic) { @@ -49,8 +50,15 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics public bool FinishOrder(OrderBindingModel model) { + if (_finished) + { + return false; + } + _finished = true; model.DateImplement = DateTime.Now; - return SetOrderStatus(model, OrderStatus.Готов); + var res = SetOrderStatus(model, OrderStatus.Готов); + _finished = false; + return res; } public OrderViewModel? ReadElement(OrderSearchModel model)