using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace PeterPage.Common
{
    public class PageInfo
    {
        ///@TableName varchar(50),         --表名
        ///@Fields varchar(5000) = '*',     --字段名(全部字段为*)
        ///@OrderField varchar(5000),         --排序字段(必须!支持多字段)
        ///@sqlWhere varchar(5000) = Null,    --条件语句(不用加where)
        ///@pageSize int,                     --每页多少条记录
        ///@pageIndex int = 1 ,             --指定当前为第几页
        ///@TotalPage int output             --返回总页数 
        ///@OrderType bit=0,                --排序类型,1是升序,0是降序

        private string tablename;

        public string Tablename
        {
            get { return tablename; }
            set { tablename = value; }
        }
        private string fields;

        public string Fields
        {
            get { return fields; }
            set { fields = value; }
        }
        private string orderfield;

        public string Orderfield
        {
            get { return orderfield; }
            set { orderfield = value; }
        }
        private string sqlwhere = string.Empty;

        public string Sqlwhere
        {
            get { return sqlwhere; }
            set { sqlwhere = value; }
        }
        private int pagesize = 15;

        public int PageSize
        {
            get { return pagesize; }
            set { pagesize = value; }
        }
        private int pageIndex = 1;

        public int PageIndex
        {
            get { return pageIndex; }
            set { pageIndex = value; }
        }
        private int ordertype = 0;

        public int OrderType
        {
            get { return ordertype; }
            set { ordertype = value; }
        }
        public PageInfo(string _tablename, string _fields, string _orderfield, string _sqlwhere, int _pagesize, int _pageIndex)
        {
            this.tablename = _tablename;
            this.fields = _fields;
            this.orderfield = _orderfield;
            this.pagesize = _pagesize;
            this.pageIndex = _pageIndex;
            this.Sqlwhere = _sqlwhere;

        }
        public PageInfo(string _tablename, string _fields, string _orderfield, string _sqlwhere, int _pagesize, int _pageIndex, int _ordertype)
        {
            this.tablename = _tablename;
            this.fields = _fields;
            this.orderfield = _orderfield;
            this.pagesize = _pagesize;
            this.pageIndex = _pageIndex;
            this.Sqlwhere = _sqlwhere;
            this.ordertype = _ordertype;

        }
        public PageInfo()
        { }
    }
}
