コード例 #1
0
ファイル: Helper.cs プロジェクト: hanson-huang/cms
 internal static string BuildJsonPagerInfo(string firstLinkFormat,string linkFormat, int pageIndex, int recordCount, int pages)
 {
     var pagingGetter = new CustomPagingGetter(firstLinkFormat, linkFormat, "", "", "<<", ">>");
     UrlPager pg = UrlPaging.NewPager(pageIndex,pages,pagingGetter);
     pg.RecordCount = recordCount;
     pg.LinkCount = 10;
     pg.PagerTotal="共{2}条";
     return pg.Pager();
 }
コード例 #2
0
ファイル: UrlPager.cs プロジェクト: w1146869587/devfw
 static DefaultPageingGetter()
 {
     getter = new CustomPagingGetter(
         "",
         "?page=%d",
         "第一页",
         "最末页",
         "上一页",
         "下一页"
         );
 }
コード例 #3
0
ファイル: UrlPager.cs プロジェクト: w1146869587/devfw
        /// <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());
        }
コード例 #4
0
ファイル: CmsTemplateCore.cs プロジェクト: coodream/cms
        /// <summary>
        /// 设置分页
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageCount"></param>
        /// <param name="recordCount"></param>
        /// <param name="firstLink"></param>
        /// <param name="link"></param>
        public virtual void SetPager(int pageIndex, int pageCount, int recordCount, string firstLink, string link)
        {

            //string pagerPack = "";
            //switch (this.site.Language)
            //{
            //    default:
            //    case Languages.En_US:
            //        pagerPack = en_us_pack; break;
            //    case Languages.Zh_CN:
            //        pagerPack = zh_cn_pack; break;
            //    case Languages.Zh_TW:
            //        pagerPack = zh_tw_pack; break;
            //}

            //string[] pagerLangs = pagerPack.Split('|');

            // const string pagerTpl = "<div class=\"pager\">{0}</div>";

            IPagingGetter getter = new CustomPagingGetter(
                firstLink,
                link,
                 AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText),
                 AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText),
                 AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText),
                 AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText)
                );

            UrlPager p = UrlPaging.NewPager(pageIndex, pageCount, getter);
            p.LinkCount = 10;
            p.PagerTotal = "<span class=\"pagerinfo\">" + AtNet.Cms.Cms.Language.Get(LanguagePackageKey.PAGER_PagerTotal) + "</span>";
            p.RecordCount = recordCount;
            /* StringBuilder sb = new StringBuilder();
           
           sb.Append("<div class=\"pager\">");

           
           p.RecordCount = recordCount;
           p.FirstPageLink = firstLink;
           p.LinkFormat = link;

           p.PreviousPageText = Cms.Language.Get(LanguagePackageKey.PAGER_PrePageText);
           p.NextPageText = Cms.Language.Get(LanguagePackageKey.PAGER_NextPageText);
           p.PageTextFormat = "{0}";
           p.SelectPageText = Cms.Language.Get(LanguagePackageKey.PAGER_SelectPageText);
           p.Style = PagerStyle.Custom;
           p.EnableSelect = true;
           p.PagerTotal = Cms.Language.Get(LanguagePackageKey.PAGER_PagerTotal);
           p.LinkCount = 10;*/

            string key = this.PushPagerKey();
            AtNet.Cms.Cms.Context.Items[key] = p.Pager(); // String.Format(pagerTpl, p.ToString());
        }
コード例 #5
0
ファイル: UrlPager.cs プロジェクト: ReinhardHsu/devfw
 static DefaultPageingGetter()
 {
     getter = new CustomPagingGetter(
         "",
         "?page=%d",
         "第一页",
         "最末页",
         "上一页",
         "下一页"
         );
 }
コード例 #6
0
ファイル: UrlPager.cs プロジェクト: ReinhardHsu/devfw
        /// <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();
        }