Ejemplo n.º 1
0
        private void BtnMasuk_Click(object sender, EventArgs e)
        {
            string id = TxtID.Text.Trim();
            string pw = TxtPassword.Text.Trim();

            if (login.LoginCek(id, pw) == true)
            {
                string cek = login.CekStat(id).Rows[0][0].ToString();

                menu.username = id;

                if (cek == "Tidak Login")
                {
                    login.Ubah(TxtID.Text, " Sedang Login");
                    menu.Show();
                    Hide();
                }

                else
                {
                    MessageBox.Show("User sedang Login", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("ID atau Password anda salah !", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void btnKeluarAplikasi_Click(object sender, EventArgs e)
 {
     logout.Ubah(username, "Tidak Login");
     if (MessageBox.Show("Apakah anda akan keluar ? ",
                         "peringatan ", MessageBoxButtons.YesNo,
                         MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         Application.Exit();
     }
 }