protected void OnAuditingTransaction(BankTransaction bankTrans) { if (this.AuditingTransaction != null) { AuditEventArgs auditTrans = new AuditEventArgs(bankTrans); this.AuditingTransaction(this, auditTrans); } }
public decimal Deposit(decimal amount) { accBal += amount; BankTransaction tran = new BankTransaction(amount); tranQueue.Enqueue(tran); return(accBal); }
public void RecordTransaction(object sender, AuditEventArgs eventData) { BankTransaction tempTrans = eventData.getTransaction(); if (tempTrans != null) { this.auditFile.WriteLine("Amount: {0}\tDate: {1}", tempTrans.Amount(), tempTrans.When()); } }
public bool Withdraw(decimal amount) { bool sufficientFunds = accBal >= amount; if (sufficientFunds) { accBal -= amount; BankTransaction tran = new BankTransaction(-amount); tranQueue.Enqueue(tran); } return(sufficientFunds); }
public BankTransaction this[int index] { get { if (index < 0 || index >= tranQueue.Count) { return(null); } IEnumerator ie = tranQueue.GetEnumerator(); for (int i = 0; i <= index; i++) { ie.MoveNext(); } BankTransaction tran = (BankTransaction)ie.Current; return(tran); } }
public AuditEventArgs(BankTransaction transaction) { this.transData = transaction; }