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"); } }
private void mainMenuToolStripMenuItem_Click(object sender, EventArgs e) { Main m1 = new Main(); this.Hide(); m1.Show(); }
private void button2_Click(object sender, EventArgs e) { Main m1 = new Main(); this.Hide(); m1.Show(); }
private void button2_Click_1(object sender, EventArgs e) { this.Hide(); Main M1 = new Main(); M1.Show(); }
private void feedbackToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); Main m1 = new Main(); m1.Show(); }