示例#1
0
 public void masuk()
 {
     koneksi();
     try
     {
         cmd = new OdbcCommand("select * from tb_admin", conn);
         dr  = cmd.ExecuteReader();
         dr.Read();
         if (Conversions.ToBoolean(!Operators.ConditionalCompareObjectEqual(T_username.Text, dr["username"], false)))
         {
             Interaction.MsgBox("Username Salah", Constants.vbInformation, "Pemberitahuan");
         }
         else if (Conversions.ToBoolean(!Operators.ConditionalCompareObjectEqual(T_password.Text, dr["password"], false)))
         {
             Interaction.MsgBox("Password Salah", Constants.vbInformation, "Pemberitahuan");
         }
         else if (Conversions.ToBoolean(Operators.AndObject(Operators.ConditionalCompareObjectEqual(T_username.Text, dr["username"], false), Operators.ConditionalCompareObjectEqual(T_password.Text, dr["password"], false))))
         {
             T_username.Clear();
             T_password.Clear();
             Interaction.MsgBox("Login Berhasil", Constants.vbInformation, "Pemberitahuan");
             Visible = false;
             My.MyProject.Forms.f_utama.Show();
         }
     }
     catch (Exception ex)
     {
         Interaction.MsgBox("Login Gagal", Constants.vbInformation, "Pemberitahuan");
     }
 }
示例#2
0
 private void B_reset_Click(object sender, EventArgs e)
 {
     T_username.Clear();
     T_password.Clear();
 }