예제 #1
0
        public BankAccountModel createAccount(string CustomerName, string CustomerID, string AccountNumber, float InitialBalance)
        {
            BankAccountRepository repository = new BankAccountRepository(this._context);

            var account = repository.getByAccountNumber(AccountNumber);

            if (account != null)
            {
                throw new Exception("there's another bank account with this Bank Number.");
            }

            account = repository.createAccount(CustomerName, CustomerID, AccountNumber, InitialBalance);
            return(BanckAccountMapper.toModel(account));
        }
예제 #2
0
        public List <BankAccountModel> getByCustomerID(string OwnerCustomerID)
        {
            BankAccountRepository repository = new BankAccountRepository(this._context);

            return(repository.getByCustomerID(OwnerCustomerID).Select(a => BanckAccountMapper.toModel(a)).ToList());
        }
예제 #3
0
        public BankAccountModel getByAccountToken(Guid token)
        {
            BankAccountRepository repository = new BankAccountRepository(this._context);

            return(BanckAccountMapper.toModel(repository.getByAccountToken(token)));
        }
예제 #4
0
        public BankAccountModel getByAccountNumber(string AccountNumber)
        {
            BankAccountRepository repository = new BankAccountRepository(this._context);

            return(BanckAccountMapper.toModel(repository.getByAccountNumber(AccountNumber)));
        }