private void button1_Click(object sender, EventArgs e) { AccountActivityLedger Ledger = new AccountActivityLedger(); double accountBalance = Ledger.CalculateAccountBalance(Convert.ToInt32(textBox1.Text)); label2.Text = label2.Text + Convert.ToString(accountBalance); }
private void button2_Click(object sender, EventArgs e) { var selectdAccountID = Convert.ToString(listBox1.SelectedItem); if (listBox1.SelectedItem == null) { MessageBox.Show("Please select the account in which to be Deposited"); } else { /*dataAccess.InsertData(@"use ApteanEdgeBank update Account * set AccountBalance=AccountBalance+"+Convert.ToString(textBox1.Text)+@"where AccountID =" + selectdAccountID, UserDAO.connectionString);*/ if (GetAccountType(Convert.ToInt32(selectdAccountID)) == "CA") { Account A = new ChequingAccount(); A.Deposit(Convert.ToDouble(textBox1.Text), Convert.ToInt32(selectdAccountID)); AccountActivityLedger Ledger = new AccountActivityLedger(); double newBalance = Ledger.CalculateAccountBalance(Convert.ToInt32(selectdAccountID)); label4.Text = "Balance: $" + Convert.ToString(newBalance); MessageBox.Show("Amount deposited successfully!"); } else if (GetAccountType(Convert.ToInt32(selectdAccountID)) == "TFS") { Account A = new TaxFreeSavingsAccount(); A.Deposit(Convert.ToDouble(textBox1.Text), Convert.ToInt32(selectdAccountID)); //MessageBox.Show("Amount deposited successfully!"); } else { MessageBox.Show("Amount could not be deposited"); } } textBox1.Clear(); }
private void button1_Click(object sender, EventArgs e) { AccountActivityLedger Ledger = new AccountActivityLedger(); double accountBalance = Ledger.CalculateAccountBalance(Convert.ToInt32(textBox1.Text)); label2.Text = label2.Text + Convert.ToString(accountBalance); }
private void button2_Click(object sender, EventArgs e) { var selectdAccountID = Convert.ToString(listBox1.SelectedItem); if (listBox1.SelectedItem == null) { MessageBox.Show("Please select the account in which to be Deposited"); } else { /*dataAccess.InsertData(@"use ApteanEdgeBank update Account set AccountBalance=AccountBalance+"+Convert.ToString(textBox1.Text)+@"where AccountID =" + selectdAccountID, UserDAO.connectionString);*/ if (GetAccountType(Convert.ToInt32(selectdAccountID)) == "CA") { Account A = new ChequingAccount(); A.Deposit(Convert.ToDouble(textBox1.Text), Convert.ToInt32(selectdAccountID)); AccountActivityLedger Ledger = new AccountActivityLedger(); double newBalance = Ledger.CalculateAccountBalance(Convert.ToInt32(selectdAccountID)); label4.Text = "Balance: $" + Convert.ToString(newBalance); MessageBox.Show("Amount deposited successfully!"); } else if (GetAccountType(Convert.ToInt32(selectdAccountID)) == "TFS") { Account A = new TaxFreeSavingsAccount(); A.Deposit(Convert.ToDouble(textBox1.Text), Convert.ToInt32(selectdAccountID)); //MessageBox.Show("Amount deposited successfully!"); } else { MessageBox.Show("Amount could not be deposited"); } } textBox1.Clear(); }