using System; using System.Collections.Generic; using System.Text; using CYQ.Data.Table; using System.Data.Common; using System.Data; namespace CYQ.Data.Aop { /// /// Aop参数信息 /// public partial class AopInfo { // internal bool IsCustomAop = false; private string _TableName; /// /// 表名 /// public string TableName { get { return _TableName; } set { _TableName = value; } } //private bool _IsView; ///// ///// 是否视图(或视图语句) ///// //public bool IsView //{ // get { return _IsView; } // set { _IsView = value; } //} // private DalType _DalType = DalType.None; /// /// 数据类型(只读) /// public DataBaseType DalType { get { if (MAction != null) { return MAction.DataBaseType; } else if (MProc != null) { return MProc.DataBaseType; } return DataBaseType.None; //if (_DalType == DalType.None) //{ // if (MAction != null) // { // _DalType = MAction.DalType; // } // else if (MProc != null) // { // _DalType = MProc.DalType; // } //} //return _DalType; } //set { _DalType = value; } } // private string _DataBase; /// /// 数据库名称(只读) /// public string DataBase { get { if (MAction != null) { return MAction.DataBaseName; } else if (MProc != null) { return MProc.DataBaseName; } return string.Empty; //if (string.IsNullOrEmpty(_DataBase)) //{ // if (MAction != null) // { // _DataBase = MAction.dalHelper.DataBase; // } // else if (MProc != null) // { // _DataBase = MProc.dalHelper.DataBase; // } //} //return _DataBase; } // set { _DataBase = value; } } /// /// 数据库链接(只读) /// public string ConnectionString { get { if (MAction != null) { return MAction.ConnString; } else if (MProc != null) { return MProc.ConnString; } return string.Empty; } } private object _AopPara; /// /// AOP的自定义参数 /// public object AopPara { get { return _AopPara; } set { _AopPara = value; } } private bool _IsTransaction; /// /// 是否事务中 /// public bool IsTransaction { get { return _IsTransaction; } set { _IsTransaction = value; } } } public partial class AopInfo { private MAction _MAction; /// /// 当前上下文的处理程序。 /// public MAction MAction { get { return _MAction; } set { _MAction = value; } } private List _TableList; /// /// 数据列表 /// public List TableList { get { return _TableList; } set { _TableList = value; } } private MDataTable _Table; /// /// 数据表 /// public MDataTable Table { get { return _Table; } set { _Table = value; } } private MDataRow _Row; /// /// 数据行 /// public MDataRow Row { get { return _Row; } set { _Row = value; } } private object _Where; /// /// 查询条件 /// public object Where { get { return _Where; } set { _Where = value; } } private bool _AutoSetValue; /// /// 自动从Form表单提取值[插入或更新时使用] /// public bool AutoSetValue { get { return _AutoSetValue; } set { _AutoSetValue = value; } } private InsertOp _InsertOp; /// /// 数据插入选项 /// public InsertOp InsertOp { get { return _InsertOp; } set { _InsertOp = value; } } private int _PageIndex; /// /// 分页起始页 /// public int PageIndex { get { return _PageIndex; } set { _PageIndex = value; } } private int _PageSize; /// /// 分页每页条数 /// public int PageSize { get { return _PageSize; } set { _PageSize = value; } } private string _UpdateExpression; /// /// 更新操作的附加表达式。 /// public string UpdateExpression { get { return _UpdateExpression; } set { _UpdateExpression = value; } } private object[] _SelectColumns; /// /// 指定的查询列 /// public object[] SelectColumns { get { return _SelectColumns; } set { _SelectColumns = value; } } private bool _IsSuccess; /// /// Begin方法是否调用成功[在End中使用] /// public bool IsSuccess { get { return _IsSuccess; } set { _IsSuccess = value; } } private int _TotalCount; /// /// 查询时返回的记录总数(分页总数) /// public int TotalCount { get { if (_TotalCount == 0 && _Table != null) { return _Table.RecordsAffected; } return _TotalCount; } set { _TotalCount = value; } } private int _RowCount; /// /// 查询时返回的显示数量 /// public int RowCount { get { if (_RowCount == 0 && _Table != null) { return _Table.Rows.Count; } return _RowCount; } set { _RowCount = value; } } private List _CustomDbPara; /// /// 用户调用SetPara新增加的自定义参数 /// public List CustomDbPara { get { return _CustomDbPara; } set { _CustomDbPara = value; } } } public partial class AopInfo { private MProc _MProc; /// /// 当前上下文的处理程序。 /// public MProc MProc { get { return _MProc; } set { _MProc = value; } } private string _ProcName; /// /// 存储过程名或SQL语句 /// public string ProcName { get { return _ProcName; } set { _ProcName = value; } } private bool _IsProc; /// /// 是否存储过程 /// public bool IsProc { get { return _IsProc; } set { _IsProc = value; } } private DbParameterCollection _DbParameters; /// /// 命令参数 /// public DbParameterCollection DBParameters { get { return _DbParameters; } set { _DbParameters = value; } } private object _ExeResult; /// /// 执行后返回的结果 /// public object ExeResult { get { return _ExeResult; } set { _ExeResult = value; } } } /// /// 设置自定义参数[使用MAction时,对Where条件进行的参数化传参使用] /// public class AopCustomDbPara { private string _ParaName; /// /// 参数名称 /// public string ParaName { get { return _ParaName; } set { _ParaName = value; } } private object _Value; /// /// 参数值 /// public object Value { get { return _Value; } set { _Value = value; } } private DbType _DbType; /// /// 参数类型 /// public DbType ParaDbType { get { return _DbType; } set { _DbType = value; } } //private bool _IsSysPara; ///// ///// 是否系统内部产生的参数 ///// //internal bool IsSysPara //{ // get { return _IsSysPara; } // set { _IsSysPara = value; } //} } }