public void LoadData() { KhachHangBUS a = new KhachHangBUS(); maKHMoi = a.MaKHMoi(); txt_MaKH.Text = maKHMoi; //trThai = 1; //TrangThai(); LoaiKhachHangBUS lp = new LoaiKhachHangBUS(); cbo_LoaiKH.DataSource = lp.DanhSachLoaiKH().FindAll(o => o.TINHTRANG == true); cbo_LoaiKH.ValueMember = "MALOAI"; cbo_LoaiKH.DisplayMember = "TENLOAIKH"; TinhTrangKHBUS tt = new TinhTrangKHBUS(); cbo_TinhTrang.DataSource = tt.DSTINHTRANGKH(); cbo_TinhTrang.ValueMember = "MATTR"; cbo_TinhTrang.DisplayMember = "TENTTR"; //load datagridviewcomboboxcolum truoc khi load ds . DataGridViewComboBoxColumn dgvcb_loaiphong = (DataGridViewComboBoxColumn)dgv_KhachHang.Columns["colLOAI"]; dgvcb_loaiphong.DataSource = lp.DanhSachLoaiKH().FindAll(o => o.TINHTRANG == true); dgvcb_loaiphong.ValueMember = "MALOAI"; dgvcb_loaiphong.DisplayMember = "TENLOAIKH"; DataGridViewComboBoxColumn dgvcb_tinhtrang = (DataGridViewComboBoxColumn)dgv_KhachHang.Columns["colTT"]; dgvcb_tinhtrang.DataSource = tt.DSTINHTRANGKH(); dgvcb_tinhtrang.ValueMember = "MATTR"; dgvcb_tinhtrang.DisplayMember = "TENTTR"; //DataGridViewCheckBoxColumn dgvckb = (DataGridViewCheckBoxColumn)dgv_sanpham.Columns["TinhTrang"]; KhachHangBUS b = new KhachHangBUS(); dgv_KhachHang.DataSource = b.DanhSachKhachHang(); }
private void LoadData() { LoaiKhachHangBUS b = new LoaiKhachHangBUS(); dgv_LoaiKH.DataSource = b.DanhSachLoaiKH(); }