Esempio n. 1
0
        public ActionResult Index(int page = 1, string keywords = "")
        {
            ViewBag.Keywords = keywords;

            var sortingPagingBuilder = new SortingPagingBuilder
            {
                Keywords = keywords,
                Sorts    = new SortBuilder
                {
                    ColumnName  = "CreatedDate",
                    ColumnOrder = SortBuilder.SortOrder.Descending
                }
            };
            var paging = new Paging
            {
                PageNumber  = page,
                PageSize    = PageSize,
                TotalRecord = 0
            };

            var manufacturers = _paymentMethodService.PagedList(sortingPagingBuilder, paging);

            if (manufacturers.IsAny())
            {
                var pageInfo = new Helper.PageInfo(CommonHelper.PageSize, page, paging.TotalRecord, i => Url.Action("Index", new { page = i, keywords }));
                ViewBag.PageInfo = pageInfo;
            }

            return(View(manufacturers));
        }