コード例 #1
0
        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);
        }
コード例 #2
0
 public List <VaiTro> getDSVaiTro()
 {
     return(tc.getDSVaiTro().ToList());
 }