예제 #1
0
        public ActionResult LastRepairs()
        {
            IEnumerable <LastRepairDTO> lastRepairsDto = _lastRepairService.GetAllLastRepairs();
            var lastRepairs = MyMapper <LastRepairDTO, LastRepairViewModel> .Map(lastRepairsDto);

            return(View(lastRepairs));
        }
예제 #2
0
        public ActionResult LastRepairs(int page = 1)
        {
            IEnumerable <LastRepairDTO> lastRepairsDto = _lastRepairService.GetAllLastRepairs();
            var lastRepairs = MyMapper <LastRepairDTO, LastRepairViewModel> .Map(lastRepairsDto)
                              .OrderBy(b => b.Id)
                              .Skip((page - 1) * PAGE_SIZE)
                              .Take(PAGE_SIZE);

            PageViewModel <LastRepairViewModel> p = new PageViewModel <LastRepairViewModel>
            {
                Items      = lastRepairs,
                PagingInfo = new PagingInfo
                {
                    CurrentPage  = page,
                    ItemsPerPage = PAGE_SIZE,
                    TotalItems   = _lastRepairService.GetAllLastRepairs().Count()
                }
            };

            return(View(p));
        }
예제 #3
0
        public ActionResult LastRepairs()
        {
            IEnumerable <LastRepairDTO> lastRepairsDto = _lastRepairService.GetAllLastRepairs();
            var report = MyMapper <LastRepairDTO, LastRepairViewModel> .Map(lastRepairsDto);

            if (report != null)
            {
                return(View(report));
            }
            else
            {
                return(HttpNotFound());
            }
        }