-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGridPager.cs
More file actions
48 lines (47 loc) · 1.15 KB
/
Copy pathGridPager.cs
File metadata and controls
48 lines (47 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Text;
namespace Blog.Common
{
/// <summary>
/// 分页帮助类类
/// </summary>
/// <typeparam name="T">需要返回数据的类型</typeparam>
public class GridPager<T>
{
/// <summary>
/// 每页行数
/// </summary>
public int rows { get; set; }
/// <summary>
/// 当前页是第几页
/// </summary>
public int page { get; set; }
/// <summary>
/// 排序方式
/// </summary>
public string order { get; set; }
/// <summary>
/// 排序列
/// </summary>
public string sort { get; set; }
/// <summary>
/// 总行数
/// </summary>
public int totalRows { get; set; }
/// <summary>
/// 数据集合
/// </summary>
public List<T> Entities { get; set; }
/// <summary>
/// 总页数
/// </summary>
public int totalPages
{
get
{
return (int)Math.Ceiling((float)totalRows / (float)rows);
}
}
}
}