public async Task <IViewComponentResult> InvokeAsync(MatchResource matchResource, string subMajorId, bool viewMode) { List <MatchResourceUploadList> uploadList = new List <MatchResourceUploadList>(); try { uploadList = matchResource.GetData <List <MatchResourceUploadList> >("Datas"); } catch { } ViewData["subMajorId"] = subMajorId; var subMajorName = "基本信息"; if (!string.IsNullOrEmpty(subMajorId)) { subMajorName = "专业" + (await MajorManager.GetByIdAsync(int.Parse(subMajorId))).BriefName; } ViewData["subMajorName"] = subMajorName; var viewName = "Default"; if (viewMode) { viewName = "View"; } return(View(viewName, uploadList)); }
public async Task <IViewComponentResult> InvokeAsync(MatchResource matchResource, int location) { List <MatchResourceDownloadList> downloadList = new List <MatchResourceDownloadList>(); try { downloadList = matchResource.GetData <List <MatchResourceDownloadList> >("Datas") .Where(o => o.FileLocation == location) .OrderBy(o => o.Sort) .ToList(); } catch { } return(View(downloadList)); }