Ejemplo n.º 1
0
        //button thêm khách hàng
        private void btnThemkhtt_Click(object sender, EventArgs e)
        {
            KHACHHANGBUS bus    = new KHACHHANGBUS();
            KHACHHANGTT  entity = new KHACHHANGTT();

            entity.TENKH      = txtTenkhachhang.Text;
            entity.CMND       = txtCMND.Text;
            entity.DIACHI     = txtDiaChi.Text;
            entity.SDT        = txtDienthoai.Text;
            entity.NGAYCAP    = dtpickerngaycap.Value;
            entity.NGAYHETHAN = dtpngayhethan.Value;
            if (!bus.Add(entity))
            {
                MessageBox.Show(KHACHHANGDAO.error_message);
            }
            else
            {
                MessageBox.Show("THÊM THÀNH CÔNG!!");
                thanhviendgv.DataSource = bus.GetList();
                thanhviendgv.Columns["ID"].HeaderText      = "ID khách hàng";
                thanhviendgv.Columns["TENKH"].HeaderText   = "Tên khách hàng";
                thanhviendgv.Columns["CMND"].HeaderText    = "CMND";
                thanhviendgv.Columns["DIACHI"].HeaderText  = "Địa chỉ";
                thanhviendgv.Columns["SDT"].HeaderText     = "Điện thoại";
                thanhviendgv.Columns["DIEMTL"].HeaderText  = "Điểm tích lũy";
                thanhviendgv.Columns["NGAYCAP"].Visible    = false;
                thanhviendgv.Columns["NGAYHETHAN"].Visible = false;
                thanhviendgv.Columns["ID"].Visible         = false;
            }
        }
Ejemplo n.º 2
0
        public bool Delete(string Manv)
        {
            KHACHHANGTT kh = new KHACHHANGTT();

            kh.ID = Manv;
            return(khdao.Delete(kh));
        }
Ejemplo n.º 3
0
        //button cập nhập KHÁCH HÀNG
        private void btnupdatekh_Click(object sender, EventArgs e)
        {
            KHACHHANGBUS bus    = new KHACHHANGBUS();
            KHACHHANGTT  entity = new KHACHHANGTT();

            if (txtsuaten.Text != "")
            {
                entity.ID     = txtsuaid.Text;
                entity.TENKH  = txtsuaten.Text;
                entity.CMND   = txtsuacmnd.Text;
                entity.DIACHI = txtsuadiachi.Text;
                entity.SDT    = txtsuasdt.Text;
                bool success = bus.Update(entity);
                common.successorerror(success);
                if (success)
                {
                    common.ClearTextBoxes(tabPage17);
                    //thanhviendgv.DataSource = bus.TimKH(textBox19.Text);
                    //thanhviendgv.Columns["ID"].Visible = false;
                }
            }
        }
Ejemplo n.º 4
0
 public bool Add(KHACHHANGTT kh)
 {
     kh.ID = getid();
     return(khdao.Insert(kh));
 }
Ejemplo n.º 5
0
 public bool Update(KHACHHANGTT kh)
 {
     return(khdao.Update(kh));
 }