예제 #1
0
파일: Login.cs 프로젝트: rdxz2/emsp
 //TOMBOL LOGIN
 private void masuk_b_Click(object sender, EventArgs e)
 {
     if (mysqlconnection())
     {
         string password = password_t.Text;
         bool   ada      = false;
         id                   = id_t.Text;
         sqlquery             = connect.CreateCommand();
         sqlquery.CommandText = "SELECT password FROM dosen WHERE id_dosen = '" + id + "'";
         MySqlDataReader data = sqlquery.ExecuteReader();
         while (data.Read())
         {
             ada = true;
             if (data.GetString("password") == MD5(password))
             {
                 Menu_Kehadiran menu_kehadiran = new Menu_Kehadiran();
                 menu_kehadiran.StartPosition = FormStartPosition.CenterScreen;
                 menu_kehadiran.Show();
                 Hide();
             }
             else
             {
                 MessageBox.Show("ID atau password salah");
             }
         }
         if (!ada)
         {
             MessageBox.Show("ID atau password salah");
         }
     }
     else
     {
         MessageBox.Show("Gagal terhubung dengan database");
     }
 }
예제 #2
0
        //TOMBOL MENU KEHADIRAN
        private void menu_kehadiran_b_Click(object sender, EventArgs e)
        {
            Menu_Kehadiran menu_kehadiran = new Menu_Kehadiran();

            menu_kehadiran.StartPosition = FormStartPosition.CenterScreen;
            menu_kehadiran.Show();
            Hide();
        }