/// <summary> /// 获取社团对应的图片 /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <IActionResult> ImageList(Guid id) { var entitys = await _businessImageExtension.FindByAsyn(x => x.RelevanceObjectID == id); var entityList = new List <BusinessImageVM>(); foreach (var entity in entitys) { entityList.Add(new BusinessImageVM(entity)); } return(View("~/Views/BusinessView/ActivityTermView/_ImageList.cshtml", entityList)); }
/// <summary> /// 根据关键词检索人员数据集合,返回给前端页面 /// </summary> /// <param name="keywork"></param> /// <returns></returns> public async Task <IActionResult> List(string keywork, string listPageParaJson) { var listPagePara = Newtonsoft.Json.JsonConvert.DeserializeObject <ListPageParameter>(listPageParaJson); var boVMCollection = new List <PersonVM>(); if (!String.IsNullOrEmpty(keywork)) { Expression <Func <Person, bool> > condtion = x =>//Contains(参数字符串是否包含于string对象中) x.Name.Contains(keywork) || x.FixedTelephone.Contains(keywork); var personCollection = await _PersonExtension.FindByAsyn(condtion); foreach (var bo in personCollection) { boVMCollection.Add(new PersonVM(bo)); } } else { var personCollection = await _PersonExtension.GetAllAsyn(); foreach (var bo in personCollection) { boVMCollection.Add(new PersonVM(bo)); } } var personCollectionPageList = IQueryableExtensions.ToPaginatedList(boVMCollection.AsQueryable <PersonVM>(), listPagePara.PageIndex, listPagePara.PageSize); var personCollections = new List <PersonVM>(); foreach (var personCollection in personCollectionPageList) { personCollections.Add(personCollection); } var pageGroup = PagenateGroupRepository.GetItem <PersonVM>(personCollectionPageList, 3, listPagePara.PageIndex); ViewBag.PageGroup = pageGroup; ViewBag.PageParameter = listPagePara; return(View("../../Views/BusinessOrganization/Person/_List", personCollections)); }