using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using Ant.Data; using Ant.Frame; using System.Collections; namespace Ant.ORM { /// /// 实体基类 /// [Serializable] public abstract class QueryBase { private int _TimeStamp = 0; private string _WhereSql = string.Empty; /// /// /// public DataAccess SQLDB { get; set; } /// /// 关联对象的处理方式,比如:{Company:},{} /// protected Hashtable Rules = new Hashtable(); protected QueryBase() { } //public abstract void AcceptChanges(); /// /// 获得各个属性的值 /// /// 获得子对象数据的层次 public abstract void GetDetail(int level); /// /// 获取单个实体 /// /// /// 显示字段 /// public abstract ResponseModel GetEntity(RequestModel enty); /// /// 通过DataReader返回List集合 /// /// public abstract ResponseModel GetDr2EnList(RequestModel enty); /// /// /// /// 数据库对象 /// public abstract ResponseModel GetDt2EnList(RequestModel enty); /// /// 查询获取DataTable /// /// /// public abstract ResponseModel GetDtList(RequestModel enty); /// /// 由DataReader转DataTable /// /// /// public abstract ResponseModel GetDr2DtList(RequestModel enty); /// /// 查询分页返回实体 /// /// 起始 /// 记录数 /// public abstract ResponseModel GetPageRecordList(RequestModel enty); /// /// 查询分页返回DataTable /// /// /// /// public abstract ResponseModel GetPageRecordDt(RequestModel enty); /// /// 时间戳 /// internal long TimeStamp { get { return this._TimeStamp; } } /// /// 模块 /// public abstract string ModuleName { get; } /// /// 排序 /// public abstract string OrderBy { get; set; } /// /// 通过json字符串给实体类赋值 /// /// public virtual void SetValueByJson(string JsonString) { } private EntityPersistType persistType; /// /// 操作类型 /// public EntityPersistType PersistType { get { return persistType; } set { persistType = value; } } public bool _isbug=false; /// /// 是否Dbug /// public bool IsBug { get { return _isbug; } set { _isbug = value; } } /// /// 查询条件 /// public string WhereSql { get { return this._WhereSql; } set { value = value.Trim().ToLower(); if (value.StartsWith("where")) { value = value.Substring(5, value.Length - 5); } this._WhereSql = value; } } } }