private void LoadKhoa() { KhoaDAO dao = new KhoaDAO(); cbbKhoa.DisplayMember = "TenKhoa"; cbbKhoa.ValueMember = "MaKhoa"; cbbKhoa.DataSource = dao.GetAll(); }
public void LoadDanhSachKhoa() { var dao = new KhoaDAO(); var lst = dao.GetAll(); cbbDanhSachKhoa.Properties.DataSource = lst; cbbDanhSachKhoa.Properties.ValueMember = "MaKhoa"; cbbDanhSachKhoa.Properties.DisplayMember = "TenKhoa"; }
public void LoadDanhSachKhoa() { gcDanhSach.DataSource = null; gcDanhSach.Controls.Clear(); var dao = new KhoaDAO(); var ser = txtSearch.Text; var lst = dao.GetAll(ser); gcDanhSach.DataSource = lst; }
private void LoadData() { KhoaDAO dao = new KhoaDAO(); dgvKhoa.DataSource = dao.GetAll().Select(t => new { MaKhoa = t.MaKhoa, TenKhoa = t.TenKhoa, DiaChi = t.DiaChi, SoDienThoai = t.SoDienThoai }).ToList(); }
/// <summary> /// Lay tat ca record /// </summary> /// <returns>List</returns> public List <Khoa> GetAll() { KhoaDAO context = new KhoaDAO(); try { List <Khoa> lstKhoa = context.GetAll(); return(lstKhoa); } catch (Exception ex) { Console.WriteLine(ex); return(null); } }
private void LoadData() { KhoaDAO dao = new KhoaDAO(); dgvKhoa.DataSource = dao.GetAll(); }
public DataTable DanhSach() { return(khoaDAO.GetAll()); }