public void LoadDanhSachGV() { var dao = new GiangVienDAO(); var lst = dao.GetAll(); cbbGVCN.Properties.DataSource = lst; cbbGVCN.Properties.ValueMember = "MaGV"; cbbGVCN.Properties.DisplayMember = "TenGV"; }
public List <GiangVien> GetAll() { GiangVienDAO context = new GiangVienDAO(); try { List <GiangVien> lstLop = contextGV.GetAll(); return(lstLop); } catch (Exception ex) { Console.WriteLine(ex); return(null); } }
public void LoadDanhSachGiangVien() { gcDanhSach.DataSource = null; gcDanhSach.Controls.Clear(); var dao = new GiangVienDAO(); var lst = new List <GiangVien>(); var ids = string.Join(",", cbbDanhSachKhoa.Properties.Items.GetCheckedValues()); var ser = txtSearch.Text; if (string.IsNullOrEmpty(ids)) { lst = dao.GetAll(ser); } else { lst = dao.GetAllByMaKhoa(ids, ser); } gcDanhSach.DataSource = lst; }
// Hàm load danh sách Giảng Viên private void LoadData() { GiangVienDAO dao = new GiangVienDAO(); dgvGiangVien.DataSource = dao.GetAll(); }