/// <summary> /// 透析列表 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <IActionResult> DialysisList(DialysisSearchInput input) { var model = new Page <AdminDialysisDto>(); var items = await _dialysisService.GetDialysisPageList(input); model.CurrentPage = input.PageIndex; model.TotalRecords = items.Item2; model.Items = items.Item1; return(PartialView("_DialysisListPartial", model)); }
/// <summary> /// 根据透析搜索输入分页获取透析记录 /// </summary> /// <param name="input">透析搜索输入</param> /// <returns>透析记录列表</returns> public async Task <Tuple <List <Domain.Models.Dialysis>, int> > GetDialysisPageList(DialysisSearchInput input) { var query = _context.Dialysis.Include(i => i.Shift).Where(i => i.PatientId == input.PatientId); int total = query.Count(); var dialysisList = await query.OrderByDescending(i => i.Id).Skip(input.PageSize * (input.PageIndex - 1)).Take(input.PageSize).ToListAsync(); return(new Tuple <List <Domain.Models.Dialysis>, int>(dialysisList, total)); }
/// <summary> /// 根据透析搜索输入分页获取透析记录 /// </summary> /// <param name="input">透析搜索输入</param> /// <returns>透析记录列表</returns> public async Task <Tuple <List <AdminDialysisDto>, int> > GetDialysisPageList(DialysisSearchInput input) { var result = await _repository.GetDialysisPageList(input); var tuple = new Tuple <List <AdminDialysisDto>, int>(Mapper.Map <List <Domain.Models.Dialysis>, List <AdminDialysisDto> >(result.Item1), result.Item2); return(tuple); }