private void FrmInputPassword_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (T8GlobalFunc.MD5Encrypt(txtPassword.Text) == T8UserLoginInfo.Password) { this.open = true; this.Close(); } } else if (e.KeyCode == Keys.Escape) { this.Close(); } }
public void InsertSingleData(FrmTambahUser _frmTambahUser) { GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.gvUser.MasterView); dataRowInfo.Cells[0].Value = _frmTambahUser.txtUsername.Text; dataRowInfo.Cells[1].Value = T8GlobalFunc.MD5Encrypt(_frmTambahUser.txtPassword.Text); dataRowInfo.Cells[2].Value = _frmTambahUser.hakAksesUser; dataRowInfo.Cells[3].Value = null; dataRowInfo.Cells[4].Value = null; dataRowInfo.Cells[5].Value = _frmTambahUser.status; dataRowInfo.Cells[6].Value = string.Format("{0:dd MMM yyyy}", DateTime.Now); dataRowInfo.Cells[7].Value = string.Format("{0:HH:mm:ss}", DateTime.Now); dataRowInfo.Cells[8].Value = T8UserLoginInfo.Username; gvUser.Rows.Insert(0, dataRowInfo); }
private void radButton2_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "Anda yakin akan mengubah password?", "Konfirmasi", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes) { if (T8GlobalFunc.MD5Encrypt(txtPasswordLama.Text) == T8UserLoginInfo.Password) { try { UserBusiness.UbahPassword(T8UserLoginInfo.Username, T8GlobalFunc.MD5Encrypt(txtPasswordBaru.Text)); T8UserLoginInfo.Password = T8GlobalFunc.MD5Encrypt(txtPasswordBaru.Text); MessageBox.Show(this, "Passwod anda sudah dirubah.", "Data disimpan", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); T8Application.DBConnection.Close(); } } } }
private void UserLogin() { if (!IsValidInput()) { return; } T8UserLoginInfo.UserLoginInit(); string hakAkses = UserBusiness.Login(txtUsername.Text, T8GlobalFunc.MD5Encrypt(txtPassword.Text), T8UserLoginInfo.IdLogin); if (hakAkses != "") { T8UserLoginInfo.SetUserLogin(txtUsername.Text, T8GlobalFunc.MD5Encrypt(txtPassword.Text), hakAkses, true); AppInit.isLogin = true; this.Close(); } else { MessageBox.Show(this, "Anda tidak memiliki hak akses untuk menggunakan aplikasi ini.", "User Tidak Ditemukan", MessageBoxButtons.OK, MessageBoxIcon.Stop); txtUsername.Focus(); } }
private void InsertUser() { if (rdoAktif.IsChecked) { status = rdoAktif.Text; } else { status = rdoNonAktif.Text; } UserBusiness.Tambah(GlobalFunction.SqlCharChecker(txtUsername.Text), T8GlobalFunc.MD5Encrypt(txtPassword.Text), hakAksesUser.ToString(), status, T8UserLoginInfo.Username); this.frmPengguna.InsertSingleData(this); if (lvKategori.CheckedItems.Count != 0) { InsertKategoriUser(); } if (lvTkKeamanan.CheckedItems.Count != 0) { InsertTkKeamananUser(); } //ClearInput(); }