Exemplo n.º 1
0
 private void hienThi()
 {
     try
     {
         gridControl1.DataSource = null;
         gridControl1.DataSource = _nhanVien.DanhSachNhanVien();
     }
     catch (Exception)
     {
         MessageBox.Show(this, "không Thể Lấy Danh Sách", "Lỗi");
     }
 }
Exemplo n.º 2
0
        private void loadItemsGLU()
        {
            //glu Khach Hang
            var rs1 = new List <vlKhachHang>();
            var tb1 = khachHangDAO.DanhSacKH();

            foreach (DataRow row1 in tb1.Rows)
            {
                var value1 = new vlKhachHang {
                    ID = row1["MaKH"].ToString(), Name = row1["TenKH"].ToString()
                };
                rs1.Add(value1);
            }
            gluKhachHang.Properties.DataSource    = rs1;
            gluKhachHang.Properties.DisplayMember = "Name";
            gluKhachHang.Properties.ValueMember   = "Name";
            gluKhachHang.Properties.NullText      = "Chọn Khách Hàng";
            gluKhachHang.Properties.BestFitMode   = BestFitMode.BestFitResizePopup;
            //glu ma Kh
            var rs2 = new List <vlKhachHang>();
            var tb2 = khachHangDAO.DanhSacKH();

            foreach (DataRow row2 in tb2.Rows)
            {
                var value2 = new vlKhachHang {
                    ID = row2["MaKH"].ToString(), Name = row2["TenKH"].ToString()
                };
                rs2.Add(value2);
            }
            gluMaKH.Properties.DataSource    = rs2;
            gluMaKH.Properties.DisplayMember = "ID";
            gluMaKH.Properties.ValueMember   = "ID";
            gluMaKH.Properties.NullText      = "Chọn Mã KH";
            gluMaKH.Properties.BestFitMode   = BestFitMode.BestFitResizePopup;
            //glu Kho
            var rs3 = new List <vlKho>();
            var tb3 = KhoDAO.DanhSachKho();

            foreach (DataRow row3 in tb3.Rows)
            {
                var value3 = new vlKho {
                    ID = row3["MaKho"].ToString(), Name = row3["TenKho"].ToString()
                };
                rs3.Add(value3);
            }
            gluKho.Properties.DataSource    = rs3;
            gluKho.Properties.DisplayMember = "Name";
            gluKho.Properties.ValueMember   = "Name";
            gluKho.Properties.NullText      = "Chọn Kho";

            gluKho.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
            //glu nhanvien
            var rs4 = new List <vlNhanVien>();
            var tb4 = NhanVienDAO.DanhSachNhanVien();

            foreach (DataRow row4 in tb4.Rows)
            {
                var value4 = new vlNhanVien {
                    ID = row4["MaNV"].ToString(), Name = row4["TenNV"].ToString()
                };
                rs4.Add(value4);
            }
            gluNhanVien.Properties.DataSource    = rs4;
            gluNhanVien.Properties.DisplayMember = "Name";
            gluNhanVien.Properties.ValueMember   = "Name";
            gluNhanVien.Properties.NullText      = "Chọn NV";
            gluNhanVien.Properties.BestFitMode   = BestFitMode.BestFitResizePopup;
        }