Esempio n. 1
0
 // Raise the Overdrawn event.
 protected virtual void OnOverdrawn(OverdrawnEventArgs args)
 {
     if (Overdrawn != null)
     {
         Overdrawn(this, args);
     }
 }
Esempio n. 2
0
        // The event handler with event args.
        private void SavingsOverdrawnHandler(object sender, OverdrawnEventArgs args)
        {
            string message =
                "The savings account is overdrawn." + Environment.NewLine +
                "Current Balance: " + args.CurrentBalance.ToString("C") + Environment.NewLine +
                "Debit Amount: " + args.DebitAmount.ToString("C");

            MessageBox.Show(message);
        }
Esempio n. 3
0
        // The event handler with event args.
        private void OverdraftOverdrawnHandler(object sender, OverdrawnEventArgs args)
        {
            // Get the overdraft account.
            OverdraftAccount account = sender as OverdraftAccount;
            string           message =
                "The account is overdrawn." + Environment.NewLine +
                "Current Balance: " + account.Balance.ToString("C") + Environment.NewLine +
                "Savings Balance: " + account.SavingsAccount.Balance.ToString("C") + Environment.NewLine +
                "Debit Amount: " + args.DebitAmount.ToString("C");

            MessageBox.Show(message);
        }
 // Raise the Overdrawn event.
 protected virtual void OnOverdrawn(OverdrawnEventArgs args)
 {
     if (Overdrawn != null) Overdrawn(this, args);
 }