/// <summary> /// 列表 /// </summary> /// <returns></returns> //[AbpMvcAuthorize("Administration.Role")] public ActionResult Index(int id = 1) { RoleSearchInput model = new RoleSearchInput(); model.PageIndex = id; return(View(model)); }
/// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="id"></param> /// <returns></returns> public Task <PagedList <RoleListDto> > List(RoleSearchInput input, int id) { int pageSize = 10; var query = _roleRepository.GetAll().WhereIf(!string.IsNullOrEmpty(input.Name), t => t.Name.Contains(input.Name) || t.DisplayName.Contains(input.Name)); int totalCount; var list = query.OrderBy(p => p.Name).PageBy(id, pageSize, out totalCount); PagedList <RoleListDto> result = new PagedList <RoleListDto>(list.MapTo <List <RoleListDto> >(), id, pageSize, totalCount); return(Task.FromResult(result)); }
public async Task <ActionResult> List(RoleSearchInput searchModel, int id = 1) { var list = await _roleAppService.List(searchModel, id); return(PartialView("_PageTable", list)); }