private void calculateInterestBtn_Click(object sender, EventArgs e) { if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Investment)) { activeInvest = (Investment)accountsCombo.SelectedItem; outputBox.Text += activeInvest.scalingInterest() + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Omni)) { activeOmni = (Omni)accountsCombo.SelectedItem; outputBox.Text += activeOmni.LargeInterest() + "\r\n"; } else { outputBox.Text += "Please select a valid account. \r\n"; } }
private void withdrawButton_Click(object sender, EventArgs e) { if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Account)) { activeEveryday = (Account)accountsCombo.SelectedItem; outputBox.Text += (activeEveryday.withdraw((float)transactionAmount.Value)) + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Investment)) { activeInvest = (Investment)accountsCombo.SelectedItem; outputBox.Text += (activeInvest.withdraw((float)transactionAmount.Value)) + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Omni)) { activeOmni = (Omni)accountsCombo.SelectedItem; outputBox.Text += (activeOmni.withdraw((float)transactionAmount.Value)) + "\r\n"; } else { outputBox.Text += "Please select a valid account. \r\n"; } }
private void lastTransactionBtn_Click(object sender, EventArgs e) { if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Account)) { activeEveryday = (Account)accountsCombo.SelectedItem; outputBox.Text += "The last transaction for this account: " + activeEveryday.LastTransaction + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Investment)) { activeInvest = (Investment)accountsCombo.SelectedItem; outputBox.Text += "The last transaction for this account: " + activeInvest.LastTransaction + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Omni)) { activeOmni = (Omni)accountsCombo.SelectedItem; outputBox.Text += "The last transaction for this account: " + activeOmni.LastTransaction + "\r\n"; } else { outputBox.Text += "Please select a valid account. \r\n"; } }
private void balanceBtn_Click(object sender, EventArgs e) { if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Account)) { activeEveryday = (Account)accountsCombo.SelectedItem; outputBox.Text += "Balance: $" + activeEveryday.balance + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Investment)) { activeInvest = (Investment)accountsCombo.SelectedItem; outputBox.Text += "Balance: $" + activeInvest.balance + "\r\n"; } else if (accountsCombo.SelectedItem.GetType() == typeof(BankProject.Omni)) { activeOmni = (Omni)accountsCombo.SelectedItem; outputBox.Text += "Balance: $" + activeOmni.balance + "\r\n"; } else { outputBox.Text += "Please select a valid account. \r\n"; } }