Пример #1
0
 public object ExecuteScalar(ICommand command)
 {
     if (command == null)
     {
         throw new ArgumentNullException("command");
     }
     if (command.Transaction == null)
     {
         using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
             command.Transaction = transaction;
             return(command.DbCommand.ExecuteScalar());
         }
     }
     return(command.DbCommand.ExecuteScalar());
 }
Пример #2
0
        public DataSet GetDataSet(ICommand command, DataSet dataSet, string[] tables)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            if (command.Transaction == null)
            {
                using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
                    command.Transaction = transaction;
                    return(GetDataSetInternal(command, dataSet, tables));
                }
            }
            return(GetDataSetInternal(command, dataSet, tables));
        }
Пример #3
0
 public object ExecuteScalar(string spName)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(this.ExecuteScalar(spName, transaction));
     }
 }
Пример #4
0
 public object ExecuteScalar(string spName, params IDataParameter[] parameters)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(this.ExecuteScalar(spName, transaction, parameters));
     }
 }
Пример #5
0
 public object ExecuteScalar(string command, CommandType commandType, params IDataParameter[] parameters)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(ExecuteScalar(command, commandType, transaction, parameters));
     }
 }
Пример #6
0
 public object ExecuteScalar(string command, CommandType commandType)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(ExecuteScalar(command, commandType, transaction));
     }
 }
Пример #7
0
 public int ExecuteNonQuery(string spName)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(this.ExecuteNonQuery(spName, transaction));
     }
 }
Пример #8
0
 public int ExecuteNonQuery(string spName, params IDataParameter[] parameters)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(this.ExecuteNonQuery(spName, transaction, parameters));
     }
 }
Пример #9
0
 public int ExecuteNonQuery(string command, CommandType commandType)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(ExecuteNonQuery(command, commandType, transaction));
     }
 }
Пример #10
0
 public DataSet ExecuteDataSet(string spName)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(this.ExecuteDataSet(spName, transaction));
     }
 }
Пример #11
0
 public DataSet ExecuteDataSet(string command, CommandType commandType)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(ExecuteDataSet(command, commandType, transaction));
     }
 }
Пример #12
0
 public int UpdateDataSet(DataSet dataSet, ICommand insertCommand, ICommand updateCommand, ICommand deleteCommand, string tableName)
 {
     using (ITransaction transaction = TransactionFactory.GetTransaction(this, false)) {
         return(UpdateDataSet(dataSet, insertCommand, updateCommand, deleteCommand, tableName, transaction));
     }
 }