public AccountNumber GenerateNumber(Guid accountOwnerId, Guid accountTypeId) { var accountOwner = accountOwnerService.GetAccountOwner(accountOwnerId); var accountType = accountTypeRepository.Get(accountTypeId); var ownerAccountTypeCount = accountRepository.GetOwnerAccountTypeCount(accountOwnerId, accountTypeId).Result; return(new AccountNumber(accountOwner.NationalCode, accountType.Code, ownerAccountTypeCount)); }
public void RegisterAccount(CreateAccountDto dto) { uow.Begin(); var accountOwner = customerRepository.Get(dto.CustomerId); var accountType = accountTypeRepository.Get(dto.AccountTypeId); var account = new Account(dto.Balance, accountOwner, accountType); try { accountRepository.Save(account); uow.Commit(); } catch (System.Exception ex) { uow.Rollback(); } }
public ActionResult Details(int id) { return(View(accountTypeRepository.Get(id))); }