private void button2_Click(object sender, EventArgs e) { this.Hide(); Main_menu f465 = new Main_menu(); f465.ShowDialog(); }
private void btnVhid_Click(object sender, EventArgs e) { try { string myConnection = "datasource=localhost;port=3306;username=root;password=23051997"; MySqlConnection myConn = new MySqlConnection(myConnection); MySqlCommand SelectCommand = new MySqlCommand("select * from epidsys.user where login='******' and password= '******';", myConn); MySqlDataReader myAdmin; if (log == txtLogin.Text || pass == txtPass.Text) { this.Hide(); Main_menu_admin_ f3 = new Main_menu_admin_(); f3.ShowDialog(); } else { myConn.Open(); myAdmin = SelectCommand.ExecuteReader(); int count = 0; while (myAdmin.Read()) { count = count + 1; } if (count == 1) { this.Hide(); Main_menu f2 = new Main_menu(); f2.ShowDialog(); } else { MessageBox.Show("nevirnyy parol"); } myConn.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }