Example #1
0
        /// <summary>
        /// 创建分页信息
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="currentPageIndex"></param>
        /// <param name="recordCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public static string PagerHtml(string firstFormat, string format, int currentPageIndex, int recordCount,
                                       int pageCount)
        {
            IPagingGetter pg = new CustomPagingGetter(
                firstFormat,
                format,
                "第一页",
                "最末页",
                "&lt;&lt;上一页",
                "&gt;&gt;下一页"
                );


            UrlPager p = NewPager(currentPageIndex, pageCount, pg);

            // p.PreviousPageText = "<<";
            // p.NextPageText = ">>";
            p.EnableInput    = true;
            p.SelectPageText = "跳页";
            p.PagerTotal     = String.Empty;
            p.RecordCount    = recordCount;
            p.PagerTotal     = String.Empty;
            return(p.Pager());
        }
Example #2
0
        public static UrlPager NewPager(int page, int pageCount, IPagingGetter pg)
        {
            if (pageCount == 0)
            {
                pageCount = 1;
            }
            if (page == 0)
            {
                page = 1;
            }

            UrlPager p = new UrlPager(page, pageCount);

            if (pg == null)
            {
                pg = DefaultGetter;
            }
            else
            {
                p.Getter = pg;
            }

            return(p);
        }