You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
namespace Wood.Entity
|
|
{
|
|
/// <summary>
|
|
/// 分页参数
|
|
/// </summary>
|
|
public class Pagination
|
|
{
|
|
public Pagination()
|
|
{
|
|
Sort = "Id Desc"; // 默认按Id排序
|
|
PageIndex = 1;
|
|
PageSize = 20;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 每页行数
|
|
/// </summary>
|
|
public int PageSize { get; set; }
|
|
/// <summary>
|
|
/// 当前页
|
|
/// </summary>
|
|
public int PageIndex { get; set; }
|
|
/// <summary>
|
|
/// 排序列
|
|
/// 多列 使用 , 号分割
|
|
/// </summary>
|
|
public string Sort { get; set; }
|
|
/// <summary>
|
|
/// 总记录数
|
|
/// </summary>
|
|
public int TotalCount { get; set; }
|
|
/// <summary>
|
|
/// 总页数
|
|
/// </summary>
|
|
public int TotalPage
|
|
{
|
|
get
|
|
{
|
|
if (TotalCount > 0)
|
|
{
|
|
return TotalCount % this.PageSize == 0 ? TotalCount / this.PageSize : TotalCount / this.PageSize + 1;
|
|
}
|
|
else
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|