Пример #1
0
        /// <summary>
        /// Transfers funds from this account to another
        /// </summary>
        /// <param name="destinationAccount">The account to transfer to</param>
        /// <param name="transferAmount">The amount to transfer</param>
        public void Transfer(BankAccount destinationAccount, decimal transferAmount)
        {
            if (!this.Equals(destinationAccount))
            {
                decimal initialBalance = this.Balance;
                decimal finalBalance   = this.Withdraw(transferAmount);

                if (initialBalance != finalBalance)
                {
                    destinationAccount.Deposit(transferAmount);
                }
            }
        }
Пример #2
0
 public void Transfer(BankAccount destinationAccount, DollarAmount transferAmount)
 {
     this.Withdraw(transferAmount);
     destinationAccount.Deposit(transferAmount);
 }
Пример #3
0
 public void Transfer(BankAccount destinationAccount, decimal transferAmount) //method
 {
     Withdraw(transferAmount);
     destinationAccount.Deposit(transferAmount);
 }
 public void Transfer(BankAccount destinationAccount, decimal transferAmount)
 {
     Console.WriteLine($"Transfer successful, {transferAmount} transferred to {destinationAccount}.");
     Balance -= transferAmount;
     destinationAccount.Deposit(transferAmount);
 }
Пример #5
0
 private void Transfer(BankAccount destinationAccount, decimal transferAmount)
 {
     Withdraw(transferAmount);
     destinationAccount.Deposit(transferAmount);
 }
Пример #6
0
 public void Transfer(BankAccount destinationAccount, DollarAmount transferAmount)
 {
     destinationAccount.Deposit(transferAmount);
 }
Пример #7
0
 public void Transfer(BankAccount destinationAccount, decimal transferAmount)
 {
     Balance -= transferAmount;
     destinationAccount.Deposit(transferAmount);
 }