Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            Staff_Menu SM = new Staff_Menu();

            SM.Show();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("User ID or Password must not be empty !", "Login Error", MessageBoxButtons.OK);
            }
            else
            {
                if (type == "Staff")
                {
                    SqlConnection sqlcon = new SqlConnection(@"Data Source=SELVAH\SQLSERVER;Initial Catalog=master;Integrated Security=True;");
                    sqlcon.Open();
                    string         try1 = "Select * from EmployeeDB where (LoginType='" + type + "') and (empid='" + this.textBox1.Text + "')and (passcode='" + this.textBox2.Text + "')";
                    SqlDataAdapter sda  = new SqlDataAdapter(try1, sqlcon);
                    DataTable      dt   = new DataTable();
                    sda.Fill(dt);

                    if (dt.Rows.Count.ToString() == "1")
                    {
                        this.Hide();
                        Staff_Menu ss = new Staff_Menu();
                        ss.Show();
                    }
                    else
                    {
                        MessageBox.Show("Enter Valid password and user id!", "Login Error", MessageBoxButtons.OK);
                    }
                }
                else
                {
                    SqlConnection sqlcon = new SqlConnection(@"Data Source=SELVAH\SQLSERVER;Initial Catalog=master;Integrated Security=True;");
                    sqlcon.Open();
                    string         try1 = "Select * from EmployeeDB where (LoginType='" + type + "') and (empid='" + this.textBox1.Text + "')and (passcode='" + this.textBox2.Text + "')";
                    SqlDataAdapter sda  = new SqlDataAdapter(try1, sqlcon);
                    DataTable      dt   = new DataTable();
                    sda.Fill(dt);

                    if (dt.Rows.Count.ToString() == "1")
                    {
                        this.Hide();
                        ADMIN_MENU ss = new ADMIN_MENU();
                        ss.Show();
                    }
                    else
                    {
                        MessageBox.Show("Enter Valid password and user id!", "Login Error", MessageBoxButtons.OK);
                    }
                }
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (token == 1)
     {
         this.Hide();
         Staff_Menu SM = new Staff_Menu();
         SM.Show();
     }
     else
     {
         this.Hide();
         ADMIN_MENU AM = new ADMIN_MENU();
         AM.Show();
     }
 }