private void button7_Click(object sender, EventArgs e)
        {
            FORM_LOGIN lgt = new FORM_LOGIN();

            lgt.Show();
            this.Hide();
        }
Example #2
0
        private void login_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FORM_LOGIN frm_login = new FORM_LOGIN();

            frm_login.Show();
            this.Hide();
        }
 private void btnsignout_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Anda Yakin Ingin Logout dari Aplikasi Ini?", "Pertanyaan", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
     {
         FORM_LOGIN login = new FORM_LOGIN();
         login.Show();
         this.Hide();
     }
 }
Example #4
0
 private void btnregister_Click(object sender, EventArgs e)
 {
     dtregister = mycom.getsql("SELECT * FROM t_user");
     if (System.Text.RegularExpressions.Regex.IsMatch(txt_password.Text, "[^a-z]"))
     {
         MessageBox.Show("Mohon Maaf Password Tidak Boleh Ada Caps Lock dan Karakter Unik!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txt_password.Text = "";
         txt_username.Text = "";
     }
     else if (txt_username.Text == "input new username" || txt_password.Text == "input new password" || cbolevel.Text == "select here")
     {
         MessageBox.Show("Mohon Isi Terlebih Dahulu Data yang Kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (txt_username.Text == "" || txt_password.Text == "" || cbolevel.Text == "")
     {
         MessageBox.Show("Mohon Isi Terlebih Dahulu Data yang Kosong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //else if (dtregister.Rows.Count != 0)
     //{
     //    mycom.Pesan("Username atau Password atau Level Sudah Ada!");
     //}
     else
     {
         status = "Register";
         Boolean berhasil = true;
         if (status == "Register")
         {
             berhasil = mycom.setsql("INSERT INTO t_user (username, password, level) VALUES ('" + txt_username.Text + "', '" + txt_password.Text + "', '" + cbolevel.Text + "')");
         }
         if (berhasil)
         {
             mycom.Pesan("Registrasi Sukses! Please Login.");
             FORM_LOGIN frm_login = new FORM_LOGIN();
             frm_login.Show();
             this.Hide();
         }
         else
         {
             mycom.Pesan("Registrasi Gagal! Mohon Ulang Kembali.");
         }
     }
 }