Beispiel #1
0
 private void btnDeposit_Click(object sender, EventArgs e)
 {
     if (_depositAmount > 0)
     {
         selectedAccount.Balance += _depositAmount;
         ShowResultDialog(true);
         XactLog x = new XactLog(selectedAccount.Name, "Deposit", "Deposit", DepositAmount);
         User.record.Add(x);
     }
 }
Beispiel #2
0
    public static void LoadLog()
    {
        XactLog e3 = new XactLog("Chequing", "Deposit", "Deposit-Pay", 1099.87f);
        XactLog e2 = new XactLog("Chequing", "Purchase", "Purchase Tim Hortons", 100.00f);
        XactLog e1 = new XactLog("Savings", "Deposit", "Account Opening", 5760.34f);
        XactLog e4 = new XactLog("Savings", "Withdrawal", "Cash Withdrawal From ATM", 240.00f);

        record.Add(e1);
        record.Add(e2);
        record.Add(e3);
        record.Add(e4);
    }
Beispiel #3
0
        private void yesBtn_Click(object sender, EventArgs e)
        {
            float transferAmount = float.Parse(amountTxtBox.Text.Substring(1));

            getAccount().Balance = getAccount().Balance - transferAmount;
            confirmPanel.Visible = false;
            amount            = new List <String>();
            amountTxtBox.Text = formatAmount();
            fromComboBox.Items.Clear();

            foreach (BankAccount acc in User.Accounts)
            {
                fromComboBox.Items.Add(acc.ToString());
            }
            fromComboBox.SelectedIndex = 0;
            showError("Success", "e-Transfer successfully sent!");
            XactLog x = new XactLog(getAccount().Name, "Transfer", "E-Transfer To: " + toComboBox.SelectedText, transferAmount);

            User.record.Add(x);
        }
Beispiel #4
0
 private void btnWithdraw_Click(object sender, EventArgs e)
 {
     if (WithdrawalAmount > 0)
     {
         if (WithdrawalAmount <= selectedAccount.Balance)
         {
             selectedAccount.Balance -= WithdrawalAmount;
             XactLog x = new XactLog(selectedAccount.Name, "Withdrawal", "Withdrawal", WithdrawalAmount);
             User.record.Add(x);
             ShowResultDialog(true);
             HideAllCommonAmountButtons();
             HideCustomAmountButtons();
         }
         else
         {
             ShowResultDialog(false);
             HideAllCommonAmountButtons();
             HideCustomAmountButtons();
         }
     }
 }
Beispiel #5
0
        //0 = chequing, 1 = saving
        private void confirmBtn_Click(object sender, EventArgs e)
        {
            BankAccount accountFrom = (BankAccount)transferComboFrom.SelectedItem;
            BankAccount accountTo   = (BankAccount)transferComboTo.SelectedItem;


            if (accountFrom != accountTo && accountFrom != null && accountTo != null && !string.IsNullOrEmpty(amountStr))
            {
                float amt = float.Parse(amountStr);
                if (amt < accountFrom.Balance)
                {
                    accountFrom.Balance -= amt;
                    accountTo.Balance   += amt;
                    XactLog x = new XactLog(accountFrom.Name, "Transfer", "Transfer To: " + accountTo.Name, amt);
                    User.record.Add(x);
                    finishTransfer(true);
                }
                else
                {
                    //OVERDRAWN ERROR
                    finishTransfer(false);
                }
            }
        }