MVC第三波书店分页数据PageList工具类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookShopSys.Utitlty
{
public class PageList
{
public int PageIndex { get; private set; } //页索引
public int PageSize { get; private set; }//页大小
public int TotalPage { get; private set; }//总页数
public int TotalCount { get; private set; }//总条数
///
/// 分页数据源类构造函数
///
/// 全部数据
/// 页索引
/// 页大小
public PageList(List
{
this.PageIndex = pageIndex;
this.PageSize = pageSize;
this.TotalCount = totalCount;
this.TotalPage = totalPage;
this.AddRange(source);
}
///
/// 当前是否有上一页
///
public bool HasPreviousPage
{
get
{
return (PageIndex > 1);
}
}
///
/// 当前是否有下一页
///
public bool HasNextPage
{
get
{
return (PageIndex < TotalPage);
}
}
}
}
///
/// 当前是否有上一页
///
public bool HasPreviousPage
{
get
{
return (PageIndex > 1);
}
}
///
/// 当前是否有下一页
///
public bool HasNextPage
{
get
{
return (PageIndex < TotalPage);
}