|
- using System;
-
- namespace HealthMonitor.Util.QueryObjects
- {
- public class Paging
- {
- private int _curPage = 1;
-
-
-
- public int CurPage
- {
- get
- {
- return Math.Min(Math.Max(1, this._curPage), this.PageCount);
- }
- set
- {
- this._curPage = value;
- }
- }
-
- private int _pageSize = 10;
-
-
-
- public int PageSize
- {
- get
- {
- return Math.Max(1, this._pageSize);
- }
- set
- {
- this._pageSize = value;
- }
- }
-
- private int _totalCount = 0;
-
-
-
- public int TotalCount
- {
- get { return this._totalCount; }
- set { this._totalCount = value; }
- }
-
-
-
-
- public int PageCount
- {
- get
- {
- int cnt = (int)Math.Ceiling((double)_totalCount / _pageSize);
- return Math.Max(1, cnt);
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
|