Пример #1
0
        public void checkspassword()
        {
            string password = null;
            string userrole = null;
            SqlConnection con = new SqlConnection(Program.FCONSTR);
            con.Open();
            string query = "select [Login].[Password] , [login].Role from [login] where [Login].Name ='" + Login_username.Text + "' and [login].Role='"+Login_role.Text+"'";
            SqlCommand sc = new SqlCommand(query, con);
            SqlDataReader sd = sc.ExecuteReader();
            if (sd.HasRows)
            {
                while (sd.Read())
                {
                  Username = Login_username.Text;
                    password = sd.GetString(0);
                    userrole = sd.GetString(1);
                }

            }
            if (Login_password.Text == password && Login_role.Text==userrole)
            {
                Password= Login_password.Text;
                Main m = new Main();
                this.Hide();
                m.Show();
            }
            else
            {
                MessageBox.Show("Invalid Password or Invalid Authorization");
            }
        }
Пример #2
0
 private void mainMenuToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Main m1 = new Main();
     this.Hide();
     m1.Show();
 }
Пример #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     Main m1 = new Main();
     this.Hide();
     m1.Show();
 }
Пример #4
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     this.Hide();
     Main M1 = new Main();
     M1.Show();
 }
Пример #5
0
 private void feedbackToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Hide();
     Main m1 = new Main();
     m1.Show();
 }