Esempio n. 1
0
        private void LoadCBB()
        {
            lstLoaiSach = tlSer.GetAllData().AsEnumerable().Select(m => new TheLoaiSach()
            {
                MaTL  = m.Field <string>("MaTL"),
                TenTL = m.Field <string>("TenTL")
            }).ToList();
            lstNXB = nxbSer.GetAllData().AsEnumerable().Select(m => new NhaXuatBan()
            {
                MaNXB  = m.Field <string>("MaNXB"),
                TenNXB = m.Field <string>("TenNXB")
            }).ToList();
            lstTG = tgSer.GetAllData().AsEnumerable().Select(m => new TacGia()
            {
                MaTG  = m.Field <string>("MaTG"),
                TenTG = m.Field <string>("TenTG")
            }).ToList();
            lstNCC = nccSer.GetAllData().AsEnumerable().Select(m => new NhaCungCap()
            {
                MaNCC  = m.Field <string>("MaNCC"),
                TenNCC = m.Field <string>("TenNCC")
            }).ToList();
            lstNV = nvSer.GetAllData().AsEnumerable().Select(m => new NhanVien()
            {
                MaNV  = m.Field <string>("MaNV"),
                TenNV = m.Field <string>("TenNV")
            }).ToList();


            cbbLoaiSach.Items.Clear();
            foreach (TheLoaiSach item in lstLoaiSach)
            {
                cbbLoaiSach.Items.Add(item);
            }
            cbbLoaiSach.SelectedIndex = 0;
            cbbNXB.Items.Clear();
            foreach (NhaXuatBan item in lstNXB)
            {
                cbbNXB.Items.Add(item);
            }
            cbbNXB.SelectedIndex = 0;
            cbbTG.Items.Clear();
            foreach (TacGia item in lstTG)
            {
                cbbTG.Items.Add(item);
            }
            cbbTG.SelectedIndex = 0;
            cbbNCC.Items.Clear();
            foreach (NhaCungCap item in lstNCC)
            {
                cbbNCC.Items.Add(item);
            }
            cbbNCC.SelectedIndex = 0;
            cbbNV.Items.Clear();
            foreach (NhanVien item in lstNV)
            {
                cbbNV.Items.Add(item);
            }
            cbbNV.SelectedIndex = 0;
        }
Esempio n. 2
0
        private void loadCBB()
        {
            lstLoaiSach = tlSer.GetAllData().AsEnumerable().Select(m => new TheLoaiSach()
            {
                MaTL  = m.Field <string>("MaTL"),
                TenTL = m.Field <string>("TenTL")
            }).ToList();
            lstNXB = nxbSer.GetAllData().AsEnumerable().Select(m => new NhaXuatBan()
            {
                MaNXB  = m.Field <string>("MaNXB"),
                TenNXB = m.Field <string>("TenNXB")
            }).ToList();
            lstTG = tgSer.GetAllData().AsEnumerable().Select(m => new TacGia()
            {
                MaTG  = m.Field <string>("MaTG"),
                TenTG = m.Field <string>("TenTG")
            }).ToList();


            cbbLoaiSach.Items.Clear();
            foreach (TheLoaiSach item in lstLoaiSach)
            {
                cbbLoaiSach.Items.Add(item);
            }
            cbbLoaiSach.SelectedItem = 0;
            cbbNXB.Items.Clear();
            foreach (NhaXuatBan item in lstNXB)
            {
                cbbNXB.Items.Add(item);
            }
            cbbNXB.SelectedItem = 0;
            cbbTG.Items.Clear();
            foreach (TacGia item in lstTG)
            {
                cbbTG.Items.Add(item);
            }
            cbbTG.SelectedItem = 0;
        }