public ActionResult Index()
        {
            var pageTypes = GetAllPageTypes();

            var model = new ListPagesViewModel
            {
                PageTypesList = pageTypes
            };

            return(View("~/Business/Plugins/Admin/ListPagesByPageTypes/Views/Index.cshtml", model));
        }
        /// <summary>
        /// Action result for viewing partial model of List pages by page types
        /// </summary>
        /// <param name="id">page type id</param>
        /// <param name="page">page id</param>
        /// <returns>Pages by their page type</returns>
        public PartialViewResult LoadPagesFromPageType(int id, int page)
        {
            var currentPage = page != 0 ? page : 1;
            var startPage   = currentPage - 10;
            var endPage     = currentPage + 11;

            var pages         = GetAllPagesOfPageType(id).Skip(_pageSize * (page - 1)).Take(_pageSize).ToList();
            var totalCount    = GetAllPagesOfPageType(id).Count();
            var numberOfPages = Convert.ToInt32(Math.Ceiling((double)totalCount / _pageSize));

            if (startPage <= 0)
            {
                endPage  -= (startPage - 1);
                startPage = 1;
            }
            if (endPage > numberOfPages)
            {
                endPage = numberOfPages;
                if (endPage > 20)
                {
                    startPage = endPage - 21;
                }
            }

            ListPagesViewModel viewModel = new ListPagesViewModel
            {
                PageSize      = _pageSize,
                TotalPages    = totalCount,
                NumberOfPages = numberOfPages,
                CurrentPage   = page,
                PagesList     = pages,
                StartPage     = startPage,
                EndPage       = endPage,
            };

            return(PartialView("~/Business/Plugins/Admin/ListPagesByPageTypes/Views/_Pages.cshtml", viewModel));
        }