Ejemplo n.º 1
0
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="objPageParameter"></param>
 public PageHelper(PageHelper objPageParameter)
 {
     if (objPageParameter != null)
     {
         this.PageIndex = objPageParameter.PageIndex;
         this.PageSize = objPageParameter.PageSize;
         this.RecordCount = objPageParameter.RecordCount;
         this.OrderBy = objPageParameter.OrderBy;
         this.Filter = objPageParameter.Filter;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 通用获取列表设置
 /// </summary>
 /// <returns></returns>
 public PageHelper GetPageParameterInfo()
 {
     PageHelper parameter = new PageHelper();
     parameter.PageIndex = TypeParse.StrToInt(GetRequestString("page"), 1);
     parameter.PageSize = TypeParse.StrToInt(GetRequestString("pageSize"), 0);
     parameter.OrderBy = string.Format("{0} {1}", Request.Form["sort"] ?? "AddTime", Request.Form["order"] ?? "desc");
     if (parameter.PageSize <= 0)
     {
         int size = Utility.GetInt32(Utility.GetAppSetting("PageSizeDefault"));
         parameter.PageSize = size <= 0 ? 20 : size;
     }
     return parameter;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 页面信息呈现
 /// </summary>
 /// <param name="pageHelper">分页助手类</param>
 /// <param name="showbutton"></param>
 /// <returns></returns>
 public static string PageInfo(PageHelper pageHelper,bool showbutton)
 {
     string str = "";
     int num = pageHelper.PageCount;
     int reCount = pageHelper.RecordCount;
     int pageSize = pageHelper.PageSize;
     string pageParameter = pageHelper.Filter;
     int indexPage = pageHelper.PageIndex;
     str = "<table id='pagetab' border='0' cellpadding='0' style='border-collapse: collapse' width='100%' height='20'>";
     object obj2 = str + "<tr><td align='right' id='tdtest'>";
     str =
         string.Concat(new object[]
         {
             obj2, "共<b>", reCount, "</b>条记录&nbsp;每页<b>", pageSize, "</b>条记录&nbsp;共<b>", num, "</b>页&nbsp;<b>",
             indexPage, "</b>/<b>", num, "</b>&nbsp;&nbsp;&nbsp;&nbsp;分页:"
         });
     if (indexPage > 1)
     {
         object obj3 = str + "<a href=# title=First name='"+1+"'>首页</a>&nbsp;&nbsp;";
         str =
             string.Concat(new object[] { obj3, "<a href=# title=Previous name='"+(indexPage-1)+"'>上一页</a>" });
     }
     if (indexPage < num)
     {
         object obj6 = str;
         object obj7 =
             string.Concat(new object[] { obj6, "<a href=# title=Next name='"+(indexPage+1)+"'>下一页</a>&nbsp;&nbsp;" });
         str =
             string.Concat(new object[] { obj7, "<a href=# title=LastPage name='"+num+"'>尾页</a>" });
     }
     str = str + "&nbsp;</td>";
     if (showbutton)
     {
         str = str +
               "<td width='80'><form style='line-height: 150%; margin-top: 0; margin-bottom: 0' name='Select_Page' action='?' mothed='get'><input type='text' style='width:30px;' id='select_page_goto' name='Page' size='2'><a href=#  name='B1'>跳转</a>" +
               GetPageParameterHidden(SplitPageParameter(pageParameter)) + "</form></td>";
     }
     return (str + "</tr></table>");
 }