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; }