Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1.         public override void DoTransaction()
  2.         {
  3.             if (SelectedAccount.AccountActive == true)
  4.             {
  5.  
  6.                 if ((SelectedAccount is SavingsAccount && SelectedAccount.AvaliableFunds >= Amount) ||
  7.                      ((SelectedAccount is LineOfCreditAccount && SelectedAccount.AvaliableFunds >= Amount)))
  8.                 {
  9.                     TransactionStatus = Status.Complete;
  10.                     this.SelectedAccount.CurrentBalance -= Amount;
  11.                    
  12.                 }
  13.                 else
  14.                 {
  15.                     throw new NoSufficientFundsException();
  16.                 }
  17.             }
  18.             else
  19.             {
  20.                 throw new AccountInactiveException();
  21.             }
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement