public ActionResult Detail(int?id) { ReportListDto info = new ReportListDto(); if (id != null) { info = _reportAppService.GetReportByIdAsync(new EntityDto <int>(id.Value)).Result; } var userMenu = GetUserMenu(PageNames.Reports).Result; ViewBag.UserMenu = userMenu; return(View(info)); }
public ActionResult Detail(int id = 0) { EntityDto <int> input = new EntityDto <int>() { Id = id }; PreAndNextNavModel <ReportListDto> dtoNavModel = new PreAndNextNavModel <ReportListDto>(); var currentDto = _reportAppService.GetReportByIdAsync(input).Result; if (currentDto != null) { dtoNavModel.CurrentItem = currentDto; var preDto = _reportAppService.GetFirstOrDefaultAsync(p => p.CreationTime < currentDto.CreationTime, r => r.CreationTime, false).Result; var nextDto = _reportAppService.GetFirstOrDefaultAsync(p => p.CreationTime > currentDto.CreationTime, r => r.CreationTime, true).Result; dtoNavModel.PreviousItem = preDto; dtoNavModel.NextItem = nextDto; } ViewBag.SeoSetting = GetSeoSetting(); return(View(dtoNavModel)); }