Esempio n. 1
0
 protected void OnOverdraft(OverdraftEventArgs e)
 {
     if (OnOverdraftHandler != null)
     {
         OnOverdraftHandler(this, e);
     }
 }
Esempio n. 2
0
 public bool Withdrawal(decimal aDebit)
 {
     if(aDebit < 0)
         throw new ArgumentOutOfRangeException();
     if(aDebit < _balance)
     {
         _balance -= aDebit;
         return true;
     }
     OverdraftEventArgs args = new OverdraftEventArgs(_balance,
                                                      aDebit);
     OnOverdraft(args);
     return false;
 }
Esempio n. 3
0
        public bool Withdrawal(decimal aDebit)
        {
            if (aDebit < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (aDebit < _balance)
            {
                _balance -= aDebit;
                return(true);
            }
            OverdraftEventArgs args = new OverdraftEventArgs(_balance,
                                                             aDebit);

            OnOverdraft(args);
            return(false);
        }
Esempio n. 4
0
 static void OnOverdraft(object sender, OverdraftEventArgs e)
 {
     Console.WriteLine("An overdraft occurred.");
     Console.WriteLine("The account balance is {0}.", e.Balance);
     Console.WriteLine("The withdrawal was {0}.", e.Withdrawal);
 }
Esempio n. 5
0
 static void OnOverdraft(object sender, OverdraftEventArgs e)
 {
     Console.WriteLine("An overdraft occurred.");
     Console.WriteLine("The account balance is {0}.", e.Balance);
     Console.WriteLine("The withdrawal was {0}.", e.Withdrawal);
 }
Esempio n. 6
0
 protected void OnOverdraft(OverdraftEventArgs e)
 {
     if(OnOverdraftHandler != null)
         OnOverdraftHandler(this, e);
 }