Fix
This commit is contained in:
parent
b130e1ac99
commit
9b793348bf
@ -108,7 +108,15 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||
{
|
||||
throw new ArgumentNullException("Нет периода действия", nameof(model.Period));
|
||||
}
|
||||
|
||||
var element = _cardStorage.GetElement(new CardSearchModel
|
||||
{
|
||||
Number = model.Number,
|
||||
});
|
||||
|
||||
if (element != null && element.Id != model.Id)
|
||||
{
|
||||
throw new InvalidOperationException("Карта с таким ноиером уже есть");
|
||||
}
|
||||
_logger.LogInformation("Card. Number:{Number}.CVC:{CVC}.ClientId:{ClientID}.Patronymic:{Period}.Id:{Id}",
|
||||
model.Number, model.CVC, model.Period.ToString(), model.ClientID, model.Id);
|
||||
}
|
||||
|
@ -124,14 +124,11 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||
model.Name, model.Surname, model.Patronymic, model.Email, model.Password, model.Telephone, model.Id);
|
||||
var element = _clientStorage.GetElement(new ClientSearchModel
|
||||
{
|
||||
Name = model.Name,
|
||||
Surname = model.Surname,
|
||||
Patronymic = model.Surname,
|
||||
Email = model.Email,
|
||||
});
|
||||
if (element != null && element.Id != model.Id)
|
||||
{
|
||||
throw new InvalidOperationException("Клиент с таким именем уже есть");
|
||||
throw new InvalidOperationException("Клиент с такой почтой уже есть");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user