示例#1
0
        public UCNguoiDung()
        {
            InitializeComponent();
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();

            HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan());
        }
示例#2
0
        private void btbDangNhap_Click(object sender, EventArgs e)
        {
            TaiKhoan taiKhoan = new TaiKhoan();

            taiKhoan.TenTaiKhoan = texUserName.Text;
            MaHoa maHoa = new MaHoa();

            //TexPass.UseSystemPasswordChar = true;
            taiKhoan.MatKhau = maHoa.ToMD5(TexPass.Text);
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();
            int KetQua = hienThiMatKhauBLL.KiemTraDangNhap(taiKhoan.TenTaiKhoan, taiKhoan.MatKhau);

            if (KetQua == 1)
            {
                frmQuanLyBanHang frmQuanLyBanHang = new frmQuanLyBanHang();
                frmQuanLyBanHang.Text = "Xin Chào : " + LayThongTinTaiKhoan(taiKhoan.TenTaiKhoan);
                frmQuanLyBanHang.Show();
                this.Hide();
            }
            else if (KetQua == 0)
            {
                MessageBox.Show("Bạn Nhập Sai Mật Khâu");
            }
            else if (KetQua == -1)
            {
                MessageBox.Show("Tài Khoản Không Tồn Tại");
            }
            else if (KetQua == -2)
            {
                MessageBox.Show("Lỗi Kết Nối SQL");
            }
            FrmDangNhap frmDangNhap = new FrmDangNhap();

            frmDangNhap.Close();
        }
示例#3
0
        private string LayThongTinTaiKhoan(string TenTaiKhoan)
        {
            string            TenNguoiDung      = null;
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();

            foreach (TaiKhoan taikhoan in hienThiMatKhauBLL.HienThiTaiKhoanTheoTen(TenTaiKhoan))
            {
                TenNguoiDung = taikhoan.TenDayDu;
                break;
            }
            return(TenNguoiDung);
        }
示例#4
0
        private void btnLuuKH_Click(object sender, EventArgs e)
        {
            TaiKhoan TaiKhoan = new TaiKhoan()
            {
                TenDayDu  = TexTenDayDu.Text + "",
                GioiTinh  = texGioitinh.Text + "",
                DienThoai = texDienThoai.Text + ""
            };
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();

            foreach (TaiKhoan taikhoan in hienThiMatKhauBLL.HienThiDanhSachTaiKhoan())
            {
                if (taikhoan.TenTaiKhoan == TexTaiKhoan.Text)
                {
                    MessageBox.Show("Tài Khoản Đã Tồn Tại");
                    return;
                }
                else
                {
                    TaiKhoan.TenTaiKhoan = TexTaiKhoan.Text;
                }
            }
            if (TexMatKhau.Text == "")
            {
                MessageBox.Show("Bạn Cần Nhập  Mật Khẩu");
                return;
            }
            else
            {
                MaHoa maHoa = new MaHoa();
                TaiKhoan.MatKhau = maHoa.ToMD5(TexMatKhau.Text);
            }


            if (cbHienThi.Text == "")
            {
                MessageBox.Show("Chưa Chọn Hiển Thị");
                return;
            }
            else
            {
                TaiKhoan.HienThi = bool.Parse(cbHienThi.Text);
            }
            hienThiMatKhauBLL.ThemThongTinNguoiDung(TaiKhoan);
            TexTaiKhoan.Text  = "";
            TexMatKhau.Text   = "";
            TexTenDayDu.Text  = "";
            texGioitinh.Text  = "";
            texDienThoai.Text = "";
            cbHienThi.Text    = "";
            HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan());
        }
示例#5
0
        private void buttonTimKiem_Click(object sender, EventArgs e)
        {
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();

            if (radioTaiKhoan.Checked)
            {
                HienThiNguoiDung(hienThiMatKhauBLL.HienThiTaiKhoanTheoTen(texTimKiem.Text));
            }
            if (radiotenDayDu.Checked)
            {
                HienThiNguoiDung(hienThiMatKhauBLL.HienThiTaiKhoanTheoTenDayDu(texTimKiem.Text));
            }
        }
示例#6
0
        private void btnDanhSach_Click(object sender, EventArgs e)
        {
            HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL();

            HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan());
        }