Beispiel #1
0
        /// <summary>
        /// web 分页HTML
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="showFirstAndLastPage">是否显示第一页和最后一页</param>
        /// <param name="urlBuilder">url规则</param>
        /// <returns></returns>
        public static string BuildPageHtml <T>(this PagedModel <T> model, bool showFirstAndLastPage, Func <int, UrlArguments> urlBuilder)
        {
            if (model == null)
            {
                return(string.Empty);
            }

            return(Build(model.PageNumber, model.TotalPages, showFirstAndLastPage, urlBuilder));
        }
Beispiel #2
0
        /// <summary>
        /// web 分页HTML
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="numberPagesToDisplay"></param>
        /// <param name="showFirstAndLastPage">是否显示第一页和最后一页</param>
        /// <param name="language"></param>
        /// <param name="urlBuilder">url规则</param>
        /// <returns></returns>
        public static string BuildPageHtml <T>(this PagedModel <T> model, int numberPagesToDisplay, bool showFirstAndLastPage, PagerLanguage language, Func <int, string> urlBuilder)
        {
            if (model == null)
            {
                return(string.Empty);
            }

            return(Build(model.PageNumber, model.TotalPages, numberPagesToDisplay, showFirstAndLastPage, language, urlBuilder));
        }
Beispiel #3
0
        /// <summary>
        /// web 分页HTML
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="urlBuilder">url规则</param>
        /// <returns></returns>
        public static string BuildPageHtml <T>(this PagedModel <T> model, Func <int, string> urlBuilder)
        {
            if (model == null)
            {
                return(string.Empty);
            }

            return(Build(model.PageNumber, model.TotalPages, urlBuilder));
        }