Exemple #1
0
        /// <summary>
        /// Deposits into a bank account
        /// </summary>
        /// <param name="account">Bank account to deposit</param>
        /// <param name="deposit">Given deposit amount</param>
        public void DepositAccount(BankAccount account, decimal deposit)
        {
            account.Deposit(deposit);
            BankAccountDTO accToUpdate = BankAccountMapper.BankAccToDTO(account);

            _repository.UpdateAccount(accToUpdate);
        }
Exemple #2
0
        /// <summary>
        /// Withdraws from a bank account
        /// </summary>
        /// <param name="account">Bank account to withdraw</param>
        /// <param name="withdrawal">Given withdrawal amount</param>
        public void WithdrawAccount(BankAccount account, decimal withdrawal)
        {
            account.Withdraw(withdrawal);
            BankAccountDTO accToUpdate = BankAccountMapper.BankAccToDTO(account);

            _repository.UpdateAccount(accToUpdate);
        }
Exemple #3
0
        /// <summary>
        /// Closes bank account
        /// </summary>
        /// <param name="account">Bank account to close</param>
        public void CloseAcount(BankAccount account)
        {
            BankAccountDTO accToRemove = BankAccountMapper.BankAccToDTO(account);

            _repository.RemoveAccount(accToRemove);
        }