/// <summary> /// 列表 /// </summary> /// <returns></returns> //[AbpMvcAuthorize("Administration.NewsType")] public ActionResult Index(int id = 1) { var model = new NewsTypeSearchInput(); model.PageIndex = id; return(View(model)); }
/// <summary> /// 分页请求 /// </summary> /// <param name="input"></param> /// <param name="id"></param> /// <returns></returns> public Task <PagedList <NewsTypeListDto> > List(NewsTypeSearchInput input, int id) { int pageSize = 10; var query = _newsTypeRepository.GetAll() .WhereIf(!string.IsNullOrEmpty(input.TypeName), t => t.TypeName.Contains(input.TypeName) || t.TypeCode.Contains(input.TypeName)); int totalCount; var list = query.OrderBy(p => p.SortOrder).PageBy(id, pageSize, out totalCount); PagedList <NewsTypeListDto> result = new PagedList <NewsTypeListDto>(list.MapTo <List <NewsTypeListDto> >(), id, pageSize, totalCount); return(Task.FromResult(result)); }
public async Task <ActionResult> List(NewsTypeSearchInput searchModel, int id = 1) { var list = await _newsTypeAppService.List(searchModel, id); return(PartialView("_PageTable", list)); }