Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void DoTransaction()
- {
- if (SelectedAccount.AccountActive == true)
- {
- if ((SelectedAccount is SavingsAccount && SelectedAccount.AvaliableFunds >= Amount) ||
- ((SelectedAccount is LineOfCreditAccount && SelectedAccount.AvaliableFunds >= Amount)))
- {
- TransactionStatus = Status.Complete;
- this.SelectedAccount.CurrentBalance -= Amount;
- }
- else
- {
- throw new NoSufficientFundsException();
- }
- }
- else
- {
- throw new AccountInactiveException();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement