예제 #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()));
     }
 }
예제 #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()));
     }
 }
예제 #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()));
     }
 }
예제 #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()));
        }
예제 #5
0
 static string RecordCountLabel <T>(EntityPage <T> page)
 {
     return(string.Format("{0}{1}{2}", page.RecordCountLabelBefor.ToHtmlString(), page.RecordCount.ToString(), page.RecordCountLabelAfter.ToHtmlString()));
 }
예제 #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()));
 }