private void btnExit_Click(object sender, EventArgs e) { mainMenu back = new mainMenu(); this.Hide(); back.Show(); }
private void btnExit_Click(object sender, EventArgs e) { mainMenu newEmp = new mainMenu(); newEmp.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { mainMenu menu = new mainMenu(); this.Hide(); menu.Show(); }
private void btnLogin_Click(object sender, EventArgs e) // code to check the password { try { using (SqlConnection sqlcon = new SqlConnection(@"Data Source=.;Initial Catalog=HairSalon;Integrated Security=True")) { string query = "Select EmpID, Pass from Employees where EmpID = '" + txtUserName.Text + "' and Pass = '******'"; //SqlCommand cmd = new SqlCommand("Select EmpID, Pass from dbo.Employees where EmpID = '" + txtEmpID.Text + "' and Pass = '******'", sqlcon) SqlDataAdapter sda = new SqlDataAdapter(query, sqlcon); DataTable dtable = new DataTable(); sda.Fill(dtable); if (dtable.Rows.Count == 1) { mainMenu menuObj = new mainMenu(); this.Hide(); menuObj.Show(); } else { MessageBox.Show("Check your Employee ID and Password"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }