private void listView1_SelectedIndexChanged(object sender, EventArgs e) { try { if (deleteMode) { var confirm = new DialogConfirm(); confirm.setDialogText("Are you sure you want to delete this customer? This action cannot be undone."); confirm.ShowDialog(); if (confirm.DialogResult == DialogResult.Yes) { //master.deleteUser(); deleteMode = false; } } else { var person = listView1.SelectedItems[0].Text; var search = new Search.SearchThroughAccount(); search.ForExactAccountNumber(master.getMasterBank().getBankServices(), long.Parse(person)); master.setAccount(search.AccountSearchResults[0]); master.updateView(1); } } catch { } }
private void accounts_box_SelectedIndexChanged(object sender, System.EventArgs e) { //MessageBox.Show(accounts_box.SelectedItem.ToString()); var search = new Search.SearchThroughAccount(); search.ForExactAccountNumber(masterForm.getMasterBank().getBankServices(), long.Parse(accounts_box.SelectedItem.ToString())); account = search.AccountSearchResults[0]; updateAccountInformation(); }
private void search_results_SelectedIndexChanged(object sender, EventArgs e) { try { var search = new Search.SearchThroughAccount(); search.ForDataString(masterForm.getMasterBank().getBankServices(), listBox2.SelectedItem.ToString()); var account = search.AccountSearchResults[0]; masterForm.setAccount(account); masterForm.updateView(1); listBox2.Items.Clear(); } catch { } }
private void from_cb_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cb = sender as ComboBox; var search = new Search.SearchThroughAccount(); search.ForExactAccountNumber(master.getMasterBank().getBankServices(), long.Parse(cb.SelectedItem.ToString())); var account = search.AccountSearchResults[0]; if (cb == from_cb) { from_bal.Text = account.getBalance().ToString(); fromAccount = account; amount.Enabled = true; } if (cb == to_cb) { to_bal.Text = account.getBalance().ToString(); toAccount = account; } }
private void search_proceed_Click(object sender, EventArgs e) { groupBox2.Visible = true; listBox2.Items.Clear(); if (atLeastOneFieldIsFilled()) { var search = new Search.SearchThroughAccount(); search.ForAccountNumber(masterForm.getMasterBank().getBankServices(), long.Parse(acct_num.Text)); if (search.accountIsFound()) { foreach (Account a in search.AccountSearchResults) { listBox2.Items.Add(a.data()); } } else { listBox2.Items.Add("No results found."); } } }