Exemplo n.º 1
0
 private void SetDalBase(DalBase dalBase, bool isClearPara)
 {
     if (dalHelper == null && dalBase != null)
     {
         dalHelper = dalBase;
         if (dalHelper.IsOnExceptionEventNull)
         {
             dalHelper.OnExceptionEvent += new DalBase.OnException(helper_OnExceptionEvent);
         }
     }
     else if (isClearPara && dalHelper != null)
     {
         dalHelper.ClearParameters();
     }
     if (dalHelper != null)
     {
         switch (dalHelper.DataBaseType)
         {
         case DalType.Txt:
         case DalType.Xml:
             _noSqlCommand = null;
             _noSqlCommand = new NoSqlCommand(_procName, dalHelper);
             break;
         }
     }
     //Aop.IAop myAop = Aop.InterAop.Instance.GetFromConfig();//试图从配置文件加载自定义Aop
     //if (myAop != null)
     //{
     //    SetAop(myAop);
     //}
 }
Exemplo n.º 2
0
 protected override DbCommand CreateDbCommand()
 {
     if (Command == null)
     {
         Command = new NoSqlCommand(null, this);
     }
     return(Command);
 }
Exemplo n.º 3
0
        /// <summary>


        /// <param name="isClearPara">IsClearParameters
        /// <para>是否清除参数</para></param>
        public void ResetProc(object procNameOrSql, bool isClearPara)
        {
            _procName = procNameOrSql.ToString().Trim();
            if (isClearPara)
            {
                dalHelper.ClearParameters();
            }
            _isProc = _procName.IndexOf(' ') == -1;//不包含空格
            switch (dalHelper.dalType)
            {
            case DalType.Txt:
            case DalType.Xml:
                _noSqlCommand = null;
                _noSqlCommand = new NoSqlCommand(_procName, dalHelper);
                break;
            }
        }
Exemplo n.º 4
0
 private void SetDbBase(DbBase dbBase)
 {
     dalHelper = dbBase;
     if (dalHelper.IsOnExceptionEventNull)
     {
         dalHelper.OnExceptionEvent += new DbBase.OnException(helper_OnExceptionEvent);
     }
     switch (dalHelper.dalType)
     {
     case DalType.Txt:
     case DalType.Xml:
         _noSqlCommand = new NoSqlCommand(_procName, dalHelper);
         break;
     }
     //Aop.IAop myAop = Aop.InterAop.Instance.GetFromConfig();//试图从配置文件加载自定义Aop
     //if (myAop != null)
     //{
     //    SetAop(myAop);
     //}
 }
Exemplo n.º 5
0
 /// <summary>
 ///  表切存储过程,在操作完A存储过程后,如果需要操作B存储过程,不需要重新new一个MProc,可直接换用本函数切换
 /// 用法参考MAction的ResetTable
 /// </summary>
 /// <param name="procNameOrSql">存储过程名或Sql语句</param>
 /// <param name="isClearParaAndisFixProc">允许多两个bool参数:1:是否清除参数;2:是否为存储过程</param>
 public void ResetProc(object procNameOrSql, params bool[] isClearParaAndisFixProc)
 {
     _procName = procNameOrSql.ToString().Trim();
     if (isClearParaAndisFixProc.Length > 0 && isClearParaAndisFixProc[0])
     {
         dalHelper.ClearParameters();
     }
     if (isClearParaAndisFixProc.Length > 1)
     {
         _isProc = isClearParaAndisFixProc[1];
     }
     else
     {
         _isProc = _procName.IndexOf(' ') == -1;//不包含空格
     }
     switch (dalHelper.dalType)
     {
     case DalType.Txt:
     case DalType.Xml:
         _noSqlCommand = null;
         _noSqlCommand = new NoSqlCommand(_procName, dalHelper);
         break;
     }
 }