From e58cae2cb3c6f61b41354869ec6e73cfa502d5b1 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Sun, 28 Apr 2024 23:14:13 +0400 Subject: [PATCH] some minor fixes in BusinessLogic --- Bank/BankBusinessLogic/BusinessLogic/AccountLogic.cs | 2 +- Bank/BankBusinessLogic/BusinessLogic/ManagerLogic.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bank/BankBusinessLogic/BusinessLogic/AccountLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/AccountLogic.cs index 678a0b8..8420f5b 100644 --- a/Bank/BankBusinessLogic/BusinessLogic/AccountLogic.cs +++ b/Bank/BankBusinessLogic/BusinessLogic/AccountLogic.cs @@ -99,7 +99,7 @@ namespace BankBusinessLogic.BusinessLogic _logger.LogInformation("Account. Number: {Number}. ManagerId: {ManagerId}. Id: {Id} ", model.Number, model.ManagerId, model.Id); var element = _accountStorage.GetElement(new AccountSearchModel { Number = model.Number }); - if (element != null) + if (element != null && element.Id != model.Id) throw new InvalidOperationException("Счет с таким номером уже есть"); } } diff --git a/Bank/BankBusinessLogic/BusinessLogic/ManagerLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/ManagerLogic.cs index 595e248..20b63a4 100644 --- a/Bank/BankBusinessLogic/BusinessLogic/ManagerLogic.cs +++ b/Bank/BankBusinessLogic/BusinessLogic/ManagerLogic.cs @@ -102,7 +102,7 @@ namespace BankBusinessLogic.BusinessLogic _logger.LogInformation("Manager. FIO:{FIO}. Email:{ Email}. Password:{ Password}. Id: { Id} ", model.Fio, model.Email, model.Password, model.Id); var element = _managerStorage.GetElement(new ManagerSearchModel { Email = model.Email }); - if (element != null) + if (element != null && element.Id != model.Id) throw new InvalidOperationException("Менеджер с таким Email уже есть"); } }