public HttpResponseMessage getAllPage(HttpRequestMessage request, int page, int pageSize = 20)
        {
            return(CreateHttpResponse(request, () =>
            {
                int totalRow = 0;
                var responseData = SlideService.ReadPage(page, pageSize);

                totalRow = SlideService.GetAll().Count;

                var paginationSet = new PaginationSet <SlideModel>()
                {
                    Items = responseData,
                    Page = page,
                    TotalCount = totalRow,
                    TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize)
                };
                var response = request.CreateResponse(HttpStatusCode.OK, paginationSet);
                return response;
            }));
        }
Beispiel #2
0
        // GET: Area/QuanLySlide
        public ActionResult Search()
        {
            var list = slideService.GetAll();

            return(View(list));
        }