首页 > 其他 > 详细

分页-Page

时间:2015-05-16 13:11:28      阅读:189      评论:0      收藏:0      [点我收藏+]

public void setPageSize(int pageSize) {
if(pageSize>0)
this.pageSize = pageSize;
}
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
if(recordCount>0){
this.recordCount = recordCount;
this.setTotalPageCountByRs();

}

}

//设置总页数
private void setTotalPageCountByRs(){
if(this.recordCount%this.pageSize==0)
this.totalPageCount=this.recordCount/this.pageSize;
else if(this.recordCount%this.pageSize>0)
this.totalPageCount=this.recordCount/this.pageSize+1;
else
this.totalPageCount=0;
}
//得到开始记录数
public int getStartRow(){
return (currPageNo - 1) * pageSize + 1;
}
//得到结束记录数
public int getEndRow(){
return currPageNo * pageSize;
}
}

分页-Page

原文:http://www.cnblogs.com/JesseCary/p/4507614.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!