public IEnumerable <CNhanVienModel> getDSPCCV(IPagedList <NhanVien> ds) { var i = ds.FirstItemOnPage; var query = (from nv in ds.AsEnumerable() join vt in tc.getDSVaiTro() on nv.VaiTroID equals vt.IDVaiTro into val from vt in val.DefaultIfEmpty() select new CNhanVienModel { STT = i++, MaNhanVien = nv.MaNhanVien, HoTen = nv.HoTen, VaiTroID = nv.VaiTroID, VaiTro = vt == null ? "" : vt.TenVaiTro, }); return(query); }
public List <VaiTro> getDSVaiTro() { return(tc.getDSVaiTro().ToList()); }