⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pageargs.cs

📁 高校 学籍管理、成绩、收费、网上教学
💻 CS
字号:
using System;

namespace QSEDUNET.COMMAND
{
	public class PageArgs
	{
		public PageArgs()
		{
			recordPerPage = 20;
		}
		private int recordPerPage;		//每页记录条数
		private int totalRecordCount;	//总记录数
		private int recordCount;		//当前读取的记录数
		private int currentPageIndex;	//当前页码
		private int totalPage;			//总页数

		/// <summary>
		/// 每页的记录条数
		/// </summary>
		public int RecordPerPage
		{
			get
			{
				return recordPerPage;
			}
			set
			{
				recordPerPage = value;
			}
		}

		/// <summary>
		/// 总记录条数
		/// </summary>
		public int TotalRecordCount
		{
			get
			{
				return totalRecordCount;
			}
			set
			{
				totalRecordCount = value;
			}
		}

		/// <summary>
		/// 当前读取的记录数
		/// </summary>
		public int RecordCount
		{
			get
			{
				return recordCount;
			}
			set
			{
				recordCount = value;
			}
		}

		/// <summary>
		/// 当前页码数
		/// </summary>
		public int CurrentPageIndex
		{
			get
			{
				if( currentPageIndex <=1 )
					currentPageIndex = 1;
				return currentPageIndex;
			}
			set
			{
				currentPageIndex = value;
			}
		}

		/// <summary>
		/// 总页数
		/// </summary>
		public int TotalPage
		{
			get
			{
				totalPage = TotalRecordCount / recordPerPage;
				if( (totalPage*recordPerPage) < totalRecordCount )
					totalPage += 1;
				return totalPage;
			}
		}

		public int StartPage
		{
			get
			{
				if(CurrentPageIndex==0)
				{
					CurrentPageIndex = 1;
				}
				if(CurrentPageIndex<=1)
					return 1;
				else
				{
					if(CurrentPageIndex%100==0)
					{
						return (CurrentPageIndex-1)/100 * 100 + 1;
					}
					else
					{
						return (CurrentPageIndex / 100) * 100 + 1;
					}
				}
			}

		}
		
		/// <summary>
		/// 每个页面开始记录数
		/// </summary>
		public int StartRecordNo
		{
			get
			{
				return (CurrentPageIndex-1) * RecordPerPage + 1;
			}

		}

		/// <summary>
		/// 每个页面结束记录数
		/// </summary>
		public int EndRecordNo
		{
			get
			{
				return CurrentPageIndex * RecordPerPage;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -