Esempio n. 1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            mainMenu back = new mainMenu();

            this.Hide();
            back.Show();
        }
Esempio n. 2
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            mainMenu newEmp = new mainMenu();

            newEmp.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            mainMenu menu = new mainMenu();

            this.Hide();
            menu.Show();
        }
Esempio n. 4
0
 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);
     }
 }