/// <summary> /// Creates a new exception with a message. /// </summary> /// <param name="account">The inactive account that was used.</param> public AccountInactiveException(BankAccount account) : base(string.Format("This account is currently inactive.")) { this.account = account; }
/// <summary> /// Creates a new transaction. /// </summary> /// <param name="sourceAccount">Source account to debit from.</param> /// <param name="destinationAccount">Destination account to credit to.</param> /// <param name="amount">Transfer amount.</param> public TransferFundsTransaction(BankAccount sourceAccount, BankAccount destinationAccount, decimal amount) : base(amount) { this.sourceAccount = sourceAccount; this.destinationAccount = destinationAccount; }
/// <summary> /// Creates a new exception with a message. /// </summary> /// <param name="account">The account that has insufficient funds.</param> /// <param name="transaction">The transaction that provoked the error.</param> public NoSufficientFundsException(BankAccount account, Transaction transaction) : base("There are not sufficient funds to perform this transaction.") { this.account = account; this.transaction = transaction; }
/// <summary> /// Creates a new deposit transaction. /// </summary> /// <param name="account">Account to which to make a depost.</param> /// <param name="amount">Deposit amount.</param> public DepositTransaction(BankAccount account, decimal amount) : base(amount) { this.account = account; }