From 96019a5916e48715a8996f09830b4e5e69c4f8c1 Mon Sep 17 00:00:00 2001 From: Pavel_Sorokin Date: Sun, 30 Apr 2023 18:12:09 +0400 Subject: [PATCH] fix --- .../ShipyardBusinessLogic/BusinessLogics/ClientLogic.cs | 2 +- Shipyard/ShipyardBusinessLogic/BusinessLogics/OrderLogic.cs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Shipyard/ShipyardBusinessLogic/BusinessLogics/ClientLogic.cs b/Shipyard/ShipyardBusinessLogic/BusinessLogics/ClientLogic.cs index 38dffbd..87fe0fe 100644 --- a/Shipyard/ShipyardBusinessLogic/BusinessLogics/ClientLogic.cs +++ b/Shipyard/ShipyardBusinessLogic/BusinessLogics/ClientLogic.cs @@ -108,7 +108,7 @@ namespace ShipyardBusinessLogic.BusinessLogics { throw new ArgumentNullException("У клиента отсутствует пароль", nameof(model.Email)); } - if (!Regex.IsMatch(model.Email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$") + if (!Regex.IsMatch(model.Email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$")) { throw new ArgumentException("Неправильно введенный email", nameof(model.Email)); } diff --git a/Shipyard/ShipyardBusinessLogic/BusinessLogics/OrderLogic.cs b/Shipyard/ShipyardBusinessLogic/BusinessLogics/OrderLogic.cs index 804fdb9..c896301 100644 --- a/Shipyard/ShipyardBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/Shipyard/ShipyardBusinessLogic/BusinessLogics/OrderLogic.cs @@ -21,10 +21,9 @@ namespace ShipyardBusinessLogic.BusinessLogics private readonly IOrderStorage _orderStorage; private readonly AbstractMailWorker _mailWorker; private readonly IClientLogic _clientLogic; - public OrderLogic(ILogger logger, IOrderStorage orderStorage, AbstractMailWorker mailWorker,IClientLogic clientLogic) private readonly IShopLogic _shopLogic; private readonly IShipStorage _shipStorage; - public OrderLogic(ILogger logger, IOrderStorage orderStorage, IShopLogic shopLogic,IShipStorage shipStorage) + public OrderLogic(ILogger logger, IOrderStorage orderStorage, IShopLogic shopLogic,IShipStorage shipStorage, AbstractMailWorker mailWorker, IClientLogic clientLogic) { _logger = logger; _orderStorage = orderStorage; @@ -129,9 +128,8 @@ namespace ShipyardBusinessLogic.BusinessLogics CheckModel(model,false); var result = _orderStorage.Update(model); if (result == null) - CheckModel(model, false); - if (_orderStorage.Update(model) == null) { + model.Status--; _logger.LogWarning("Change status operation failed"); return false; }