private void btnDoiMatKhau_Click(object sender, EventArgs e) { BLQuanLy blPassCu = new BLQuanLy(); string strLayPass = blPassCu.SelectPassCu(frmDangNhap.strTenDangNhap, ref err); if (frmMain.bIsLogin == true) { if (txtPassCu.Text == strLayPass) { if (txtPassNew.Text == txtConfirmNewPass.Text) { BLQuanLy blQL = new BLQuanLy(); blQL.DoiMatKhauQuanLy(frmDangNhap.strTenDangNhap, txtPassNew.Text, ref err); lbThongBao.Text = "Bạn đã đổi mật khẩu thành công!"; txtPassCu.ResetText(); txtPassNew.ResetText(); txtConfirmNewPass.ResetText(); } else { lbThongBao.Text = "Mật khẩu mới và Gõ lại mật khẩu mới không trùng khớp"; } } else { lbThongBao.Text = "Mật khẩu cũ sai"; } } }
private void btnDangNhap_Click(object sender, EventArgs e) { // lấy class ở tầng kết nối BLQuanLy blND = new BLQuanLy(); // lấy dữ liệu từ tầng nghiệp vụ từ class kiểm trả tài khoản có đúng hay không int value = blND.DangNhapQuanLy(this.txtUser.Text.Trim(), this.txtPass.Text.Trim(), ref err); if (value == 1) { frmMain.bIsLogin = true; strTenDangNhap = txtUser.Text.Trim(); Close(); } else { MessageBox.Show("Không đúng tên người dùng / mật khẩu !!!", "Thông báo"); this.txtUser.Focus(); } }