some minor fixes in BusinessLogic

This commit is contained in:
Zakharov_Rostislav 2024-04-28 23:14:13 +04:00
parent 7f7a7d6a93
commit e58cae2cb3
2 changed files with 2 additions and 2 deletions

View File

@ -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("Счет с таким номером уже есть");
}
}

View File

@ -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 уже есть");
}
}