分页
时间:2011-04-11 来源:杀 手
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DVL.Model
{
public class TestModeol
{
#region 每页记录数
private int pageCount = 5;
public int PageCount
{
get { return pageCount; }
set { pageCount = value; }
}
#endregion
#region 总记录数
private int total;
public int Total
{
get { return total; }
set { total = value; }
}
#endregion
#region 总页数
private int pageNumber;
public int PageNumber
{
get
{
if (Total % PageCount == 0)
{
pageNumber = Total / PageCount;
}
else
{
pageNumber = Total / pageNumber + 1;
}
return pageNumber;
}
set { pageNumber = value; }
}
#endregion
#region 当前总页数
private int currentpage;
public int Currentpage
{
get
{
if (currentpage > PageNumber)
{
currentpage = PageNumber;
}
if (currentpage < 1)
{
currentpage = 1;
}
return currentpage;
}
set { currentpage = value; }
}
#endregion
}
}s