Esempio n. 1
0
 protected void OnAuditingTransaction(BankTransaction bankTrans)
 {
     if (this.AuditingTransaction != null)
     {
         AuditEventArgs auditTrans = new AuditEventArgs(bankTrans);
         this.AuditingTransaction(this, auditTrans);
     }
 }
Esempio n. 2
0
        public decimal Deposit(decimal amount)
        {
            accBal += amount;
            BankTransaction tran = new BankTransaction(amount);

            tranQueue.Enqueue(tran);
            return(accBal);
        }
Esempio n. 3
0
        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());
            }
        }
Esempio n. 4
0
        public bool Withdraw(decimal amount)
        {
            bool sufficientFunds = accBal >= amount;

            if (sufficientFunds)
            {
                accBal -= amount;
                BankTransaction tran = new BankTransaction(-amount);
                tranQueue.Enqueue(tran);
            }
            return(sufficientFunds);
        }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
 public AuditEventArgs(BankTransaction transaction)
 {
     this.transData = transaction;
 }