using System;
using System.Collections.Generic;
using System.Text;
namespace Infrastructure.Model
{
///
/// 分页参数
///
public class PagedInfo
{
///
/// 每页行数
///
public int PageSize { get; set; } = 10;
///
/// 当前页
///
public int PageIndex { get; set; } = 1;
///
/// 排序列
///
//public string Sort { get; set; }
///
/// 排序类型
///
//public string SortType { get; set; }
///
/// 总记录数
///
public int TotalCount { get; set; }
///
/// 总页数
///
//public int TotalPage
//{
// get
// {
// if (TotalCount > 0)
// {
// return TotalCount % this.PageSize == 0 ? TotalCount / this.PageSize : TotalCount / this.PageSize + 1;
// }
// else
// {
// return 0;
// }
// }
// set { }
//}
public int TotalPage { get; set; }
public List Result { get; set; }
public PagedInfo()
{
}
public PagedInfo(List source, int pageIndex, int pageSize)
{
PageIndex = pageIndex;
PageSize = pageSize;
TotalCount = source.Count;
TotalPage = (int)Math.Ceiling(TotalCount / (double)PageSize);//计算总页数
}
}
}