/// <summary>
/// 分页链接
/// </summary>
/// <param name=pageSize></param>
/// <param name=recordCount></param>
/// <param name=currentPage></param>
/// <param name=prev>当前页前面显示的数量</param>
/// <param name=next>当前页后面显示的数量</param>
/// <returns></returns>
public string PageLink(int pageSize int recordCount int currentPage int prev int next)
{
int pageCount = recordCount % pageSize == ? (recordCount / pageSize) : ((int)MathCeiling((double)recordCount / pageSize));
StringBuilder sb = new StringBuilder();
if (currentPage > && recordCount > )
{
sbAppend(<a href=\?page=);
sbAppend((currentPage )ToString());
sbAppend(\>前一页</a> );
}
if (currentPage > prev + )
sbAppend(<a href=\?page=\></a> );
if (currentPage < prev)
next = next + prev currentPage + ;
if (next > pageCount currentPage)
prev = prev + next (pageCount currentPage);
for (int i = ; i <= pageCount; i++)
{
if (i == currentPage)
{
sbAppend(<a href=\?page= + i + \ class=\current\ ><font color=\red\> + i + </font></a> );
}
else
{
if (i > (currentPage prev ) && i < (currentPage + next + ))
{
sbAppend(<a href=\?page= + i + \> + i + </a> );
}
}
}
if (currentPage < pageCount next)
sbAppend( <a href=\?page= + pageCountToString() + \> + pageCountToString() + </a>);
if (currentPage < pageCount)
sbAppend( <a href=\?page= + (currentPage + )ToString() + \>后一页</a>);
return sbToString();
}