public static void BindingKhachHang(System.Windows.Forms.ComboBox cboKhachHang)
        {
            cboKhachHang.Items.Clear();
            BLL_KhachHang    adapter = new BLL_KhachHang();
            List <KhachHang> list    = adapter.GetList(string.Empty);

            if (list != null)
            {
                KhachHang item = new KhachHang();
                item.MaKhachHang  = -1;
                item.TenKhachHang = "Khách hàng - chọn -";
                list.Insert(0, item);
                cboKhachHang.DataSource    = list;
                cboKhachHang.ValueMember   = "MaKhachHang";
                cboKhachHang.DisplayMember = "TenKhachHang";
            }
        }
        public ThongKeBanHang()
        {
            InitializeComponent();
            _ListOrginal = _ThongKeBanHang.GetListOrginal();
            Reset();
            // Tạo ds cho cb_TenNhanVien
            List <DLL.NhanVien> listuser     = (new BLL_NhanVien()).GetList();
            List <string>       listnameuser = new List <string>();

            listnameuser.Add("");
            foreach (DLL.NhanVien mem in listuser)
            {
                listnameuser.Add(mem.TenNV.Trim());
            }
            _CTHoaDonBanHang.MakeComboBoxNoAuto(cb_TenNhanVien, listnameuser);
            // Tạo ds cho cb_TenKH
            List <DLL.KhachHang> listKH     = _KhachHang.GetList();
            List <string>        listnamekh = new List <string>();

            listnamekh.Add("");
            foreach (DLL.KhachHang mem in listKH)
            {
                listnamekh.Add(mem.TenKH.Trim());
            }
            _CTHoaDonBanHang.MakeComboBoxNoAuto(cb_TenKhachHang, listnamekh);
            // Tạo ds cho cb_TrangThai
            List <string> liststt = new List <string>();

            liststt.Add("");
            liststt.Add("Giao Ngay Lúc Lập");
            liststt.Add("Chưa Giao");
            liststt.Add("Đang Giao");
            liststt.Add("Đã Giao");
            _NhaCungCap.MakeComboBoxNoAuto(cb_TrangThai, liststt);
            liststt.Clear();
            liststt.Add("Đang Giao");
            liststt.Add("Đã Giao");
            _HoaDonBanHang.MakeComboBoxNoAuto(cb_ThietLapTrangThai, liststt);
            cb_ThietLapTrangThai.SelectedIndex = 0;
        }
Esempio n. 3
0
 private void Refresh_Grid()
 {
     try
     {
         for (; grid_khachhang.Rows.Count > 0;)
         {
             grid_khachhang.Rows.RemoveAt(0);
         }
     }
     catch
     { }
     try
     {
         var listKH = khachhang.GetList();
         foreach (DLL.KhachHang vari in listKH)
         {
             grid_khachhang.Rows.Add(vari.MaKH, vari.TenKH, vari.NgaySinh, vari.GioiTinh, vari.DiaChi, vari.SDT, vari.CMND, vari.Email, bll_loaikh.GetObjectFromID(vari.MaLoaiKH).TenLoaiKH, vari.CongNo);
         }
     }
     catch (Exception)
     { }
 }
        private void SearchKhachHang(string keySearch)
        {
            BLL_KhachHang adapter = new BLL_KhachHang();

            dgvKhachHang.DataSource = adapter.GetList(keySearch);
        }
 private void Refresh_Grid()
 {
     this.gridControl_KhachHang.DataSource = null;
     this.gridControl_KhachHang.DataSource = khachhang.GetList();
 }