C#페이지당 객체 캡슐화[다중 테이블 연결 쿼리 페이지 지원] - 교육 시범 버전 - 솔리드 모델 객체

7300 단어
먼저 관련 솔리드 클래스를 정의합니다.
 
페이지 정보 클래스:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace BookShopModel
{
    /// <summary>
    ///  
    /// </summary>    
    [Serializable]
    public class PageInfo
    {
        //------------------------------- ---------------------------------


        private String _tableName;

        /// <summary>
        ///  ( )
        /// </summary>
        public String TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }
        private String _pkey;

        /// <summary>
        ///  
        /// </summary>
        public String Pkey
        {
            get { return _pkey; }
            set { _pkey = value; }
        }
        private int _pageSize = 10;

        /// <summary>
        ///  
        /// </summary>
        public int PageSize
        {
            get { return _pageSize; }
            set { _pageSize = value; }
        }
        private int _pageIndex = 1;

        /// <summary>
        ///  
        /// </summary>
        public int PageIndex
        {
            get { return _pageIndex; }
            set { _pageIndex = value; }
        }

        private Condition[] _conditions = null;

        /// <summary>
        ///  
        /// </summary>
        public Condition[] Conditions
        {
            get { return _conditions; }
            set { _conditions = value; }
        }

        private NOrder[] _orders;
        /// <summary>
        ///  
        /// </summary>
        public NOrder[] Orders
        {
            get { return _orders; }
            set { _orders = value; }
        }

        //------------------------------------------- -------------------------------------


        private int _recordCount;

        /// <summary>
        ///  
        /// </summary>
        public int RecordCount
        {
            get { return _recordCount; }
            set { _recordCount = value; }
        }
        private int _pageCount;

        /// <summary>
        ///  
        /// </summary>
        public int PageCount
        {
            get { return _pageCount; }
            set { _pageCount = value; }
        }

        private DataTable _result;
        /// <summary>
        ///  [ADO.NET DataRow ], , List 
        /// </summary>
        public DataTable Result
        {
            get { return _result; }
            set { _result = value; }
        }

        private List<object> _rlist;
        /// <summary>
        ///  [ ], 
        /// </summary>
        public List<object> Rlist
        {
            get { return _rlist; }
            set { _rlist = value; }
        }

        
    }
}

페이지 나누기 기준 클래스:
using System;
using System.Collections.Generic;
using System.Text;

namespace BookShopModel
{
    /// <summary>
    ///  
    /// </summary>
    public class Condition
    {
        private String _propertyName;

        public String PropertyName
        {
            get { return _propertyName; }
            set { _propertyName = value; }
        }

        // 
        private Compare _cp;

        public Compare Opt
        {
            get { return _cp; }
            set { _cp = value; }
        }

        private Object _propertyValue;

        public Object PropertyValue
        {
            get { return _propertyValue; }
            set { _propertyValue = value; }
        }

        public Condition()
        {

        }

        public Condition(string propertyName,Compare opt,object propertyValue)
        {
            this._propertyName = propertyName;
            this._cp = opt;
            this._propertyValue = propertyValue;
        }
	
	
    }
}

페이지별 클래스 정렬:
using System;
using System.Collections.Generic;
using System.Text;

namespace BookShopModel
{
    /// <summary>
    ///  
    /// </summary>
    public class NOrder
    {
        public NOrder() { }
        public NOrder(String propertyName,Direction direct) 
        {
            this._propertyName = propertyName;
            this._direct = direct;
        }

        private String _propertyName;

        public String PropertyName
        {
            get { return _propertyName; }
            set { _propertyName = value; }
        }

        private Direction _direct;

        public Direction Direct
        {
            get { return _direct; }
            set { _direct = value; }
        }
	
	
    }
}

페이지 나누기 기준 객체의 비교 속성[열거]:
using System;
using System.Collections.Generic;
using System.Text;

namespace BookShopModel
{
    /// <summary>
    ///  
    /// </summary>
    public enum Compare
    {
        /// <summary>
        ///  
        /// </summary>
        EQ,
        /// <summary>
        ///  
        /// </summary>
        GT,
        /// <summary>
        ///  
        /// </summary>
        LT,
        /// <summary>
        ///  
        /// </summary>
        GE,
        /// <summary>
        ///  
        /// </summary>
        LE,
        /// <summary>
        ///  
        /// </summary>
        NE,
        /// <summary>
        ///  
        /// </summary>
        LIKE,
        /// <summary>
        ///  
        /// </summary>
        BETWEEN
    }
}

정렬 방향 열거:
using System;
using System.Collections.Generic;
using System.Text;

namespace BookShopModel
{
    /// <summary>
    ///  
    /// </summary>
    public enum Direction
    {
        ASC,
        DESC
    }
}

좋은 웹페이지 즐겨찾기