private void xoa()
        {
            UpdateKhachHangDTO khdto = new UpdateKhachHangDTO();

            khdto.MaKH = MAKH;
            bool kq = khbus.delete(khdto);

            if (kq == true)
            {
                MessageBox.Show("Xóa khách hàng thành công");
                disable();
            }
            else
            {
                MessageBox.Show("Xóa khách hàng thất bại");
                return;
            }
        }
        private void sua()
        {
            if (!kiemTraDL())
            {
                MessageBox.Show("Mời bạn nhập đầy đủ thông tin");
                return;
            }
            UpdateKhachHangDTO khdto = new UpdateKhachHangDTO();

            khdto.MaKH = MAKH;

            khdto.HoTen = ChuanHoaChuoi(tbName.Text);

            if (radioNam.Checked == true)
            {
                khdto.GioiTinh = "Nam";
            }
            else if (radioNu.Checked == true)
            {
                khdto.GioiTinh = "Nữ";
            }
            khdto.NgaySinh  = dateNgaySinh.Value;
            khdto.SDT       = tbSDT.Text;
            khdto.Email     = tbEmail.Text;
            khdto.MaQG      = getMaQG().ToString();
            khdto.SoHoChieu = tbSHC.Text;
            khdto.Passport  = imageToByteArray(pBPassport.Image);
            khdto.Avatar    = imageToByteArray(pBAvatar.Image);
            bool kq = khbus.update(khdto);

            if (kq == true)
            {
                MessageBox.Show("Sửa thông tin khách hàng thành công");
                disable();
            }
            else
            {
                MessageBox.Show("Sửa thông tin khách hàng thất bại");
                return;
            }
        }
Пример #3
0
        public bool delete(UpdateKhachHangDTO khdto)
        {
            bool re = khdal.delete(khdto);

            return(re);
        }