/// <summary>
        /// Gets the pages.
        /// </summary>
        /// <param name="param">The parameters required to create a view model.</param>
        /// <param name="maxPages">The maximum pages.</param>
        /// <param name="totalNumberOfPages">The total number of pages.</param>
        /// <returns></returns>
        protected virtual IEnumerable <OrderHistoryPageViewModel> GetPages(OrderHistoryPaginationParam param, int maxPages, int totalNumberOfPages)
        {
            var pages     = new List <OrderHistoryPageViewModel>();
            int endPage   = 0;
            int startPage = 0;

            if (totalNumberOfPages < maxPages)
            {
                startPage = 1;
                endPage   = totalNumberOfPages;
            }
            else if (maxPages <= totalNumberOfPages)
            {
                int maxPagesSplit      = (int)Math.Floor((double)maxPages / 2);
                int potentialStartPage = param.CurrentPage - maxPagesSplit;

                if (potentialStartPage < 1)
                {
                    startPage = 1;
                    endPage   = maxPages;
                }
                else
                {
                    int potentialEndPage = param.CurrentPage + maxPagesSplit - (maxPages % 2 == 0 ? 1 : 0);

                    if (potentialEndPage > totalNumberOfPages)
                    {
                        startPage = totalNumberOfPages - maxPages + 1;
                        endPage   = totalNumberOfPages;
                    }
                    else
                    {
                        startPage = potentialStartPage;
                        endPage   = potentialEndPage;
                    }
                }
            }
            else if (maxPages > totalNumberOfPages)
            {
                startPage = 1;
                endPage   = totalNumberOfPages;
            }

            for (var index = startPage; index <= endPage; index++)
            {
                var displayName = index.ToString(CultureInfo.InvariantCulture);
                var searchPage  = new OrderHistoryPageViewModel
                {
                    DisplayName   = displayName,
                    PageNumber    = index,
                    IsCurrentPage = index == param.CurrentPage
                };

                pages.Add(searchPage);
            }

            return(pages);
        }
        /// <summary>
        /// Gets the previous page.
        /// </summary>
        /// <param name="param">The parameters required to create a view model.</param>
        /// <returns></returns>
        protected virtual OrderHistoryPageViewModel GetPreviousPage(OrderHistoryPaginationParam param)
        {
            var previousPage = new OrderHistoryPageViewModel
            {
                DisplayName = LocalizationProvider
                              .GetLocalizedString(new GetLocalizedParam
                {
                    Category    = "List-Search",
                    Key         = "B_Previous",
                    CultureInfo = param.CultureInfo
                })
            };

            if (param.CurrentPage > 1)
            {
                previousPage.PageNumber = param.CurrentPage - 1;
            }
            else
            {
                previousPage.IsCurrentPage = true;
            }

            return(previousPage);
        }
        /// <summary>
        /// Gets the next page.
        /// </summary>
        /// <param name="param">The parameters required to create a view model.</param>
        /// <param name="totalNumberOfPages">The total number of pages.</param>
        /// <returns></returns>
        protected virtual OrderHistoryPageViewModel GetNextPage(OrderHistoryPaginationParam param, int totalNumberOfPages)
        {
            var nextPage = new OrderHistoryPageViewModel
            {
                DisplayName = LocalizationProvider
                              .GetLocalizedString(new GetLocalizedParam
                {
                    Category    = "List-Search",
                    Key         = "B_Next",
                    CultureInfo = param.CultureInfo
                })
            };

            if (param.CurrentPage < totalNumberOfPages)
            {
                nextPage.PageNumber = param.CurrentPage + 1;
            }
            else
            {
                nextPage.IsCurrentPage = true;
            }

            return(nextPage);
        }