Merge branch 'main' of https://git.is.ulstu.ru/Artyom_Yashin/PIbd-23_Yashin_A_Zakharov_R_CourseWork_Bank
This commit is contained in:
commit
1f91bd744a
@ -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("Счет с таким номером уже есть");
|
||||
}
|
||||
}
|
||||
|
@ -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 уже есть");
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ namespace BankDatabaseImplement.Models
|
||||
{
|
||||
Withdrawal = Withdrawal,
|
||||
Account = context.Accounts.First(x => x.Id == account.Key),
|
||||
Sum = account.Value.Item2,
|
||||
});
|
||||
context.SaveChanges();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user