PagerHelper-分页类
public static class PagerHelper
{
#region 数字分页类
/// <summary>
///
/// </summary>
/// <param name="intCounts">总记录数</param>
/// <param name="intPageSizes">每页显示条数</param>
/// <param name="intPageCounts">总页数</param>
/// <param name="intThisPages">当前页数</param>
/// <param name="strUrl">Url</param>
/// <returns></returns>
public static string strPage(int intCounts, int intPageSizes, int intPageCounts, int intThisPages, string strUrl)
{
int intCount = Convert.ToInt32(intCounts); //总记录数
int intPageCount = Convert.ToInt32(intPageCounts); //总共页数
int intPageSize = Convert.ToInt32(intPageSizes); //每页显示
int intPage = ; //数字显示
int intThisPage = Convert.ToInt32(intThisPages); //当前页数
int intBeginPage = ; //开始页数
int intCrossPage = ; //变换页数
int intEndPage = ; //结束页数
string strPage = null; //返回值 intCrossPage = intPage / ;
strPage = "共 <font color=\"#FF0000\">" + intCount.ToString() + "</font> 条记录 第 <font color=\"#FF0000\">" + intThisPage.ToString() + "/" + intPageCount.ToString() + "</font> 页 每页 <font color=\"#FF0000\">" + intPageSize.ToString() + "</font> 条 ";
if (intThisPage > )
{
strPage = strPage + "<a href=\"" + strUrl + "1\">首页</a> ";
strPage = strPage + "<a href=\"" + strUrl + Convert.ToString(intThisPage - ) + "\">上一页</a> ";
}
if (intPageCount > intPage)
{
if (intThisPage > intPageCount - intCrossPage)
{
intBeginPage = intPageCount - intPage + ;
intEndPage = intPageCount;
}
else
{
if (intThisPage <= intPage - intCrossPage)
{
intBeginPage = ;
intEndPage = intPage;
}
else
{
intBeginPage = intThisPage - intCrossPage;
intEndPage = intThisPage + intCrossPage;
}
}
}
else
{
intBeginPage = ;
intEndPage = intPageCount;
}
if (intCount > )
{ for (int i = intBeginPage; i <= intEndPage; i++)
{
if (i == intThisPage)
{
strPage = strPage + " <input type=\"hidden\" id=\"thisPageId\" value=" + i.ToString() + " />" + "<font color=\"#FF0000\">" + i.ToString() + "</font> ";
}
else
{
strPage = strPage + " <a href=\"" + strUrl + i.ToString() + "\" title=\"第" + i.ToString() + "页\">" + i.ToString() + "</a> ";
}
}
}
if (intThisPage < intPageCount)
{
strPage = strPage + "<a href=\"" + strUrl + Convert.ToString(intThisPage + ) + "\">下一页</a> ";
strPage = strPage + "<a href=\"" + strUrl + intPageCount.ToString() + "\">尾页</a> ";
}
return strPage;
}
#endregion
}
PagerHelper-分页类的更多相关文章
- php实现的分页类
php分页类文件: <?php /** file: page.class.php 完美分页类 Page */ class Page { private $total; //数据表中总记录数 pr ...
- asp.net的快捷实用分页类
KeleyiPager分页类,可以于对列表页进行分页浏览,代码是从HoverTreeCMS项目中COPY的,感觉很不错,使用简单方便,但是功能强大. 在线体验效果:http://cms.hovertr ...
- php分页类
1.需求 学会php分页类的使用 2.参考例子 CI的分页类 3.代码部分 <?php class pagination{ public $pagesize=20; public $pagein ...
- PHPCMS V9 分页类的修改教程
首先,打开 phpcms\libs\functions\global.func.php 这个文件,找到文件第622行的分页函数,复制一下,粘贴到默认分页函数的下面,重新命名后保存.(笔者在此命名为:p ...
- php 简单分页类
/** file: page.class.php 完美分页类 Page */ class Page { private $total; //数据表中总记录数 privat ...
- PHP简单漂亮的分页类
本文介绍一款原生的PHP分页类,分页样式有点类似bootstrap. <?php /* * ********************************************* * @类名 ...
- ThinkPHP 分页类的使用及退出功能的实现
/* ThinkPHP设置编码统一: 一.数据库设置为utf8_bin 二.HTML页面设置charset=utf-8,而且检查文档编码格式是否是utf-8.phpDesigner8设置方式为“文件- ...
- php部分---一个分页类、用法
1.分页类 <?php /** file: page.class.php 完美分页类 Page */ class Page { private $total; //数据表中总记录数 privat ...
- DedeCMS织梦动态分页类,datalist标签使用实例
<?php require_once(dirname(__FILE__)."/include/common.inc.php");//载入基础文件 require_once(D ...
- webpy分页类 + 上传类
webpy没有分页类.按照php的思路.自己编了一个.数据库用的是sqlite. class Page(object): '''分页类''' def __init__(self,page_size,d ...
随机推荐
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q69-Q71)
Question 69 You are designing an extranet site using SharePoint 2010. This site must allow employees ...
- 导致VC不能释放的几个原因
delegate的属性不是weak NSTimer没有invalidate block中的强引用 调用了performSelector,退出时没有cancelPerformSelectorsWithT ...
- Android上传图片到PHP服务器并且支持浏览器上传文件(word、图片、音乐等)
暑假已经过了一半了,这才完成计划当中的第二个任务.虽然进度是慢了点.但也算是暑假的收获吧.下面我就把我学习当中的收获记录在此. 还是跟以往一样,先上图片. 操作的步骤:打开程序---->选择上传 ...
- 操作系统开发系列—11.ELF格式 ●
ELF文件的结构如下图所示: ELF文件由4部分组成,分别是ELF头(ELF header).程序头表(Program header table).节(Sections)和节头表(Section he ...
- IntelliJ IDEA 使用Git怎样记住密码和忘记密码的方法
IntelliJ IDEA 使用Git怎样记住密码的方法 1.当使用Ctrl+T进行更新时,弹出密码框(此时不要输入任何字符),直接点"Cancel" 2.略等二三秒,会弹出新的密 ...
- 分页查询的SQL语句
select * from(select row_number() over (ORDER BY Id DESC) cyqrownum,t.* from [Table_TY_Member] t ) v ...
- .net开发中常用的第三方组件
.net开发中常用的第三方组件 2013-05-09 09:33:32| 分类: dotnet |举报 |字号 订阅 下载LOFTER 我的照片书 | RSS.NET.dll RSS. ...
- VBS进行http请求及JSON数据的读取和生成
背景: 近期帮一个公司做第三方API的二次封装,需要部署到该公司网站.所获取的是Json数据格式.由于该公司原系统采用的ASP+VBS技术方案,因此采用VBS对API进行请求.封装. 实现: 废话不多 ...
- java获取当前星期几
//获取当前星期几Calendar calendar;calendar = Calendar.getInstance();System.out.println(calendar);System.out ...
- ios界面布局整理
1 UIView 1.1 创建自定义的UIView的xib文件 [1]设置 file's Owner的 Custom Class 中的class 执行自定义控件类 [2]设置当前UIView 的屏幕大 ...