public ActionResult LastRepairs() { IEnumerable <LastRepairDTO> lastRepairsDto = _lastRepairService.GetAllLastRepairs(); var lastRepairs = MyMapper <LastRepairDTO, LastRepairViewModel> .Map(lastRepairsDto); return(View(lastRepairs)); }
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)); }
public ActionResult LastRepairs() { IEnumerable <LastRepairDTO> lastRepairsDto = _lastRepairService.GetAllLastRepairs(); var report = MyMapper <LastRepairDTO, LastRepairViewModel> .Map(lastRepairsDto); if (report != null) { return(View(report)); } else { return(HttpNotFound()); } }