Beispiel #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtusername.Text == "")
     {
         MessageBox.Show("Username tidak boleh kosong");
     }
     else if (txtpassword.Text == "")
     {
         MessageBox.Show("Password tidak bolek kosong");
     }
     else
     {
         db.openConnection();
         string sql = "select * from pengguna where username ='******' and password ='******'";
         Console.WriteLine(sql);
         string[] result = db.queryNoReturn(sql);
         db.closeConnection();
         if (result.Length > 0)
         {
             HalamanDepan form = new HalamanDepan();
             form.Show();
             Hide();
         }
     }
 }
 private void TambahCancel_Click(object sender, EventArgs e)
 {
     this.Dispose();
     using (HalamanDepan halamanDepan = new HalamanDepan())
     {
         halamanDepan.ShowDialog();
     }
 }