예제 #1
0
        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));
        }