private void label17_Click(object sender, EventArgs e)
        {
            Main_Menu cf = new Main_Menu();

            cf.Show();
            this.Hide();
        }
Beispiel #2
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (Uname.Text == "" || Pass.Text == "")
     {
         MessageBox.Show("Missing user name or password");
     }
     else if (Role.SelectedItem == null)
     {
         MessageBox.Show("Please select your position");
         return;
     }
     else
     {
         if (Role.SelectedItem.ToString() == "Admin")
         {
             if (Uname.Text == "Admin" && Pass.Text == "Admin")
             {
                 Main_Menu pf = new Main_Menu();
                 pf.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Please Enter Correct Password");
             }
         }
         else if (Role.SelectedItem.ToString() == "Sales Man")
         {
             Con.Open();
             SqlDataAdapter sda = new SqlDataAdapter("Select count(8) from SellerTable where CONVERT(VARCHAR, SellerName)='" + Uname.Text + "' and CONVERT(VARCHAR, SellerPassword)='" + Pass.Text + "'", Con);
             DataTable      dt  = new DataTable();
             SetValueForText1 = Uname.Text;
             sda.Fill(dt);
             if (dt.Rows[0][0].ToString() == "1")
             {
                 Shopform pf = new Shopform();
                 pf.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Incorect");
             }
             Con.Close();
         }
     }
 }