Exemple #1
0
        /// <summary>
        /// Returns the number of rows affected [used to insert update or delete], and returns -2 if an exception is executed
        /// <para>返回受影响的行数[用于更新或删除],执行异常时返回-2</para>
        /// </summary>
        public int ExeNonQuery()
        {
            CheckDisposed();
            AopResult aopResult = SetAopResult(AopEnum.ExeNonQuery);

            if (aopResult == AopResult.Return)
            {
                return(_aop.Para.RowCount);
            }
            else
            {
                if (aopResult != AopResult.Break)
                {
                    switch (dalHelper.DataBaseType)
                    {
                    case DalType.Txt:
                    case DalType.Xml:
                        _aop.Para.RowCount = _noSqlCommand.ExeNonQuery();
                        break;

                    default:
                        _aop.Para.RowCount = dalHelper.ExeNonQuery(_procName, _isProc);
                        break;
                    }
                    _aop.Para.IsSuccess = _aop.Para.RowCount > 0;
                }
                if (aopResult != AopResult.Default)
                {
                    _aop.End(AopEnum.ExeNonQuery);
                }
                return(_aop.Para.RowCount);
            }
        }
Exemple #2
0
        /// <summary>
        /// Returns the number of rows affected [used to insert update or delete], and returns -2 if an exception is executed
        /// <para>返回受影响的行数[用于更新或删除],执行异常时返回-2</para>
        /// </summary>
        public int ExeNonQuery()
        {
            CheckDisposed();
            AopResult aopResult = SetAopResult(AopEnum.ExeNonQuery);

            if (aopResult == AopResult.Return)
            {
                return(_aop.Para.RowCount);
            }
            else
            {
                if (aopResult != AopResult.Break)
                {
                    _aop.Para.RowCount  = dalHelper.ExeNonQuery(_procName, _isProc);
                    _aop.Para.IsSuccess = _aop.Para.RowCount > 0;
                }
                if (aopResult != AopResult.Default)
                {
                    _aop.End(AopEnum.ExeNonQuery);
                }
                return(_aop.Para.RowCount);
            }
        }