示例#1
0
 /// <summary>
 /// 下一页数据
 /// </summary>
 /// <param name="ResultPolicy">结果读取策略,1.讲结果放入LastResult属性,2.读取一次,不缓存</param>
 /// <returns></returns>
 public EntitySet <T> LastPage(EResultPolicy ResultPolicy)
 {
     if (this._PageIndex != -1)
     {
         this._PageIndex -= 1;
     }
     return(GetResult(ResultPolicy));
 }
示例#2
0
 /// <summary>
 /// 指定页数据
 /// </summary>
 /// <param name="PageIndex">页索引号</param>
 /// <param name="ResultPolicy">结果读取策略,1.讲结果放入LastResult属性,2.读取一次,不缓存</param>
 /// <returns></returns>
 public EntitySet <T> GotoPage(int PageIndex, int PageSize, EResultPolicy ResultPolicy)
 {
     if (this._PageIndex != -1)
     {
         this._PageIndex = PageIndex;
     }
     this._PageSize = PageSize;
     return(GetResult(ResultPolicy));
 }
示例#3
0
        /// <summary>
        /// 获取查询结果
        /// </summary>
        /// <param name="ResultPolicy">结果读取策略,1.讲结果放入LastResult属性,2.读取一次,不缓存</param>
        /// <returns></returns>
        public EntitySet <T> GetResult(EResultPolicy ResultPolicy)
        {
            EntitySet <T> Result = null;

            if (this._ConditionForSelect != null)
            {
                if (this._ViewName == null)
                {
                    Result = this.Query(this._ConditionForSelect, this._PageIndex, this._PageSize, _FieldNames);
                }
                else
                {
                    Result = this.QueryView(this._ViewName, this._ConditionForSelect, this._PageIndex, this._PageSize, this._FieldNames);
                }
            }
            else if (this._strConditionForSelect != null)
            {
                if (this._ViewName == null)
                {
                    Result = this.Query(this._strConditionForSelect, this._PageIndex, this._PageSize, _FieldNames);
                }
                else
                {
                    Result = this.QueryView(this._ViewName, this._strConditionForSelect, this._PageIndex, this._PageSize, this._FieldNames);
                }
            }
            if (ResultPolicy == EResultPolicy.Reusable)
            {
                this.LastResult = Result;
                return(LastResult);
            }
            else
            {
                this.LastResult = null;
                return(Result);
            }
        }