Exemple #1
0
        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));
        }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
 public ActionResult Details(int id)
 {
     return(View(accountTypeRepository.Get(id)));
 }