示例#1
0
文件: Analys.cs 项目: dgankoi/EpidSys
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            Main_menu f465 = new Main_menu();

            f465.ShowDialog();
        }
示例#2
0
文件: Login.cs 项目: dgankoi/EpidSys
 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);
     }
 }