private void BACK_BOX_Click(object sender, EventArgs e) { CustomerOperations co = new CustomerOperations(); this.Hide(); co.Show(); }
//method to Customer product operations private void CUSTOMER_Click(object sender, EventArgs e) { CustomerOperations cu = new CustomerOperations(); this.Hide(); cu.Show(); }
private void LOGIN_BUTTON_Click(object sender, EventArgs e) { using (SqlConnection con = new SqlConnection(cs)) { string query = "Select * from Customer where cust_id = @cust_id and cust_pass=@cust_pass"; DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(query, con); da.SelectCommand.Parameters.AddWithValue("@cust_id", ID_TXT.Text); da.SelectCommand.Parameters.AddWithValue("@cust_pass", PASSWORD_TXT.Text); try { da.Fill(dt); } catch (Exception Ex) { MessageBox.Show(Ex.Message.ToString()); } if (dt.Rows.Count == 1) { MessageBox.Show("Welcome"); CustomerOperations co = new CustomerOperations(); this.Hide(); co.Show(); } else if (ID_TXT.Text == "") { MessageBox.Show("ID not Empty"); } else if (PASSWORD_TXT.Text == "") { MessageBox.Show("Password not Empty"); } else { MessageBox.Show("Check your username and password"); ID_TXT.Text = ""; PASSWORD_TXT.Text = ""; } } }
private void BACK_BOX_Click(object sender, EventArgs e) { if (caller == "admin") { CustomerOperations co = new CustomerOperations(); this.Hide(); co.Show(); } else if (caller == "customer") { CustomerPortal cu = new CustomerPortal(); this.Hide(); cu.Show(); } }