private void listCustomersToolStripMenuItem_Click(object sender, EventArgs e) { ListOfCustomers nextForm = new ListOfCustomers(); // this.Hide(); nextForm.ShowDialog(); // this.Close(); }
public bool CustomerAvailabilityCheck() { UserDAO udao = new UserDAO(); DataTable dataTable = new DataTable(); bool foundFlag = false; string customerID = textBox1.Text; dataTable = udao.GetData("use ApteanEdgeBank select * from Customer", UserDAO.connectionString); ListOfCustomers newForm = new ListOfCustomers(); for (int i = 0; i < dataTable.Rows.Count; i++) { if (Convert.ToString(dataTable.Rows[i]["CustomerID"]) == customerID) { foundFlag = true; } } if (foundFlag) { return true; } else { return false; } }
private void sortByNameToolStripMenuItem_Click(object sender, EventArgs e) { ListOfCustomers nextForm = new ListOfCustomers(true); // true to sort by Name nextForm.ShowDialog(); }
private void sortByCustomerIDToolStripMenuItem_Click(object sender, EventArgs e) { ListOfCustomers newForm = new ListOfCustomers(false); // false for sorting by CustomerID newForm.ShowDialog(); }
public void Issue_Loan_Account(int accountID, float balance) { try { conn = new SqlConnection(connectionString); conn.Open(); DataTable dataTable = new DataTable(); bool foundFlag = false; dataTable = GetData("use ApteanEdgeBank select * from Account", UserDAO.connectionString); ListOfCustomers newForm = new ListOfCustomers(); for (int i = 0; i < dataTable.Rows.Count; i++) { if (Convert.ToString(dataTable.Rows[i]["AccountID"]) == Convert.ToString(accountID)) { foundFlag = true; } } if ( foundFlag == true) { myQuery = "Use ApteanEdgeBank update Account set [AccountBalance] = AccountBalance + " + balance + " where AccountID= " + accountID; InsertData(myQuery, connectionString); } } catch(SqlException ex) { System.Windows.Forms.MessageBox.Show("Sql Exception : " + ex.Message); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("General Exception :" + ex.Message); } finally { conn.Close(); } }