Example #1
0
 static string LastPage <T>(EntityPage <T> page)
 {
     if (page.PageIndex != page.PageCount)
     {
         return(string.Format("<div onclick=\"_DoPage({1});\">{0}</div>", page.LastButton.ToHtmlString(), page.PageCount));
     }
     else
     {
         return(string.Format("<div>{0}</div>", page.LastButton.ToHtmlString()));
     }
 }
Example #2
0
 static string PrePage <T>(EntityPage <T> page)
 {
     if (page.PageIndex > 1)
     {
         return(string.Format("<div onclick=\"_DoPage({1});\">{0}</div>", page.PreButton.ToHtmlString(), page.PageIndex - 1));
     }
     else
     {
         return(string.Format("<div>{0}</div>", page.PreButton.ToHtmlString()));
     }
 }
Example #3
0
 static string FirstPage <T>(EntityPage <T> page)
 {
     if (page.PageIndex > 0)
     {
         return(string.Format("<div onclick=\"_DoPage(1);\">{0}</div>", page.FirstButton.ToHtmlString()));
     }
     else
     {
         return(string.Format("<div>{0}</div>", page.FirstButton.ToHtmlString()));
     }
 }
Example #4
0
        public static MvcHtmlString Pager <T>(this HtmlHelper htmlHelper, EntityPage <T> EntityPage, string ScriptFunctionName)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(Script(ScriptFunctionName));
            sb.Append(FirstPage(EntityPage));
            sb.Append(PrePage(EntityPage));
            sb.Append(NextPage(EntityPage));
            sb.Append(LastPage(EntityPage));
            sb.Append(PageCountLabel(EntityPage));
            sb.Append(RecordCountLabel(EntityPage));
            return(new MvcHtmlString(sb.ToString()));
        }
Example #5
0
 static string RecordCountLabel <T>(EntityPage <T> page)
 {
     return(string.Format("{0}{1}{2}", page.RecordCountLabelBefor.ToHtmlString(), page.RecordCount.ToString(), page.RecordCountLabelAfter.ToHtmlString()));
 }
Example #6
0
 static string PageCountLabel <T>(EntityPage <T> page)
 {
     return(string.Format("<div>{0}{1}/{2}{3}</div>", page.PageIndexLabelBefore.ToHtmlString(), page.PageIndex.ToString(), page.PageCount.ToString(), page.PageIndexLabelAfter.ToHtmlString()));
 }