private void LoadHangKhachHang() { var nguon = HangKhachHang.DocTatCa(); cboHangKH.ValueMember = "ID"; cboHangKH.DisplayMember = "Ten"; cboHangKH.DataSource = nguon; cboHangKH.DropDownStyle = ComboBoxStyle.DropDownList; }
private void LoadHangKH(int tinhTrangForm) { foreach (HangKhachHang hang in HangKhachHang.DocTatCa()) { nguonHangKH.Add(hang.ID, hang.Ten); } cboHangKH.Items.Clear(); foreach (KeyValuePair <int, string> kv in nguonHangKH) { cboHangKH.Items.Add(kv.Value); cboHangKH.SelectedIndex = 0; } cboHangKH.DropDownStyle = ComboBoxStyle.DropDownList; }
public Dictionary <int, string> HangKhachHangS() { var hangKHTheoUser = NguoiDung.DocTheoTenDangNhap(View.TenNhanVien.Trim().ToLower()).ChoHangKhachHang.Trim().Split(';'); var nguonHangKH = HangKhachHang.DocTatCa().Where(x => hangKHTheoUser.Contains(x.MaHieu.Trim())).ToList(); //var so = nguonHangKH.Count(); //var so = nguonHangKH.Count(); Dictionary <int, string> dict = new Dictionary <int, string>(); foreach (HangKhachHang hkh in nguonHangKH) { dict.Add(hkh.ID, hkh.Ten); } return(dict); }
public List <HangKhachHang> HangKhachHangS() { return(HangKhachHang.DocTatCa()); }