Exemplo n.º 1
0
        /// <summary>
        /// Executes the query.
        /// </summary>
        /// <param name="structure">The structure.</param>
        /// <returns></returns>
        internal override DbDataReader ExecuteQuery(DbSqlStructure structure)
        {
            DbCommand command = null;

            try
            {
                if (Connection.State != ConnectionState.Open)
                {
                    Connection.Open();
                }
                command                = Connection.CreateCommand();
                command.CommandText    = structure.Sql;
                command.Transaction    = Transaction;
                command.CommandType    = structure.SqlType;
                command.CommandTimeout = 0;
                return(ClientHelper.ExecuteQueryCommand(command, null, CommandBehavior.CloseConnection));
            }
            catch
            {
                throw;
            }
            finally
            {
                if (command != null)
                {
                    command.Dispose();
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Executes the non query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 internal override int ExecuteNonQuery(DbSqlStructure structure)
 {
     try
     {
         if (Connection.State != ConnectionState.Open)
         {
             Connection.Open();
         }
         DbCommand command = this.Connection.CreateCommand();
         command.CommandText    = structure.Sql;
         command.Transaction    = this.Transaction;
         command.CommandType    = structure.SqlType;
         command.CommandTimeout = 0;
         return(this.ClientHelper.ExecuteNonQueryCommand(command, (List <DbInputParameter>)null));
     }
     catch
     {
         throw;
     }
     finally
     {
         if (Connection != null)
         {
             Connection.Close();
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Executes the non query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="hasOutputValue">if set to <c>true</c> [has output value].</param>
 /// <param name="outparametername">The outparametername.</param>
 /// <returns></returns>
 internal override int ExecuteNonQuery(DbSqlStructure structure, List <DbInputParameter> parameters, bool hasOutputValue, string outparametername)
 {
     try
     {
         if (Connection.State != ConnectionState.Open)
         {
             Connection.Open();
         }
         DbCommand command = Connection.CreateCommand();
         command.CommandText    = structure.Sql;
         command.CommandType    = structure.SqlType;
         command.Transaction    = Transaction;
         command.CommandTimeout = 0;
         int num = ClientHelper.ExecuteNonQueryCommand(command, parameters);
         if (hasOutputValue && command.Parameters.Contains(outparametername))
         {
             num = int.Parse(command.Parameters[outparametername].Value.ToString());
         }
         return(num);
     }
     catch
     {
         throw;
     }
     finally
     {
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the one value.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 internal override object GetOneValue(DbSqlStructure structure)
 {
     try
     {
         if (Connection.State != ConnectionState.Open)
         {
             Connection.Open();
         }
         DbCommand command = Connection.CreateCommand();
         command.CommandText = structure.Sql;
         command.CommandType = structure.SqlType;
         command.Transaction = Transaction;
         object obj = ClientHelper.ExecuteScalarCommand(command);
         if (obj != null && obj != DBNull.Value)
         {
             return(obj);
         }
         return(null);
     }
     catch
     {
         throw;
     }
     finally
     {
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Executes the report query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 internal override DbDataAdapter ExecuteReportQuery(DbSqlStructure structure, List <DbInputParameter> parameters)
 {
     try
     {
         if (Connection.State != ConnectionState.Open)
         {
             Connection.Open();
         }
         DbCommand command = Connection.CreateCommand();
         command.CommandText    = structure.Sql;
         command.CommandType    = structure.SqlType;
         command.CommandTimeout = 0;
         ClientHelper.AttachParameters(command, parameters);
         DbDataAdapter dataAdapter = Factory.CreateDataAdapter();
         dataAdapter.SelectCommand = command;
         return(dataAdapter);
     }
     catch
     {
         throw;
     }
     finally
     {
         if (Connection != null)
         {
             Connection.Close();
         }
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Executes the query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 internal override DbDataReader ExecuteQuery(DbSqlStructure structure, List <DbInputParameter> parameters)
 {
     try
     {
         if (Connection.State != ConnectionState.Open)
         {
             Connection.Open();
         }
         DbCommand command = Connection.CreateCommand();
         command.CommandText    = structure.Sql;
         command.Transaction    = Transaction;
         command.CommandType    = structure.SqlType;
         command.CommandTimeout = 0;
         return(ClientHelper.ExecuteQueryCommand(command, parameters, CommandBehavior.Default));
     }
     catch
     {
         throw;
     }
     finally
     {
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Executes the disconnected.
        /// </summary>
        /// <param name="structure">The structure.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns></returns>
        internal override DataTable ExecuteDisconnected(DbSqlStructure structure, List <DbInputParameter> parameters)
        {
            DbDataAdapter dbDataAdapter = (DbDataAdapter)null;
            DataTable     dataTable     = new DataTable();

            try
            {
                if (Connection.State != ConnectionState.Open)
                {
                    Connection.Open();
                }
                DbCommand command = this.Connection.CreateCommand();
                command.CommandText    = structure.Sql;
                command.CommandType    = structure.SqlType;
                command.CommandTimeout = 0;
                ClientHelper.AttachParameters(command, parameters);
                dbDataAdapter = this.Factory.CreateDataAdapter();
                dbDataAdapter.SelectCommand = command;
                dbDataAdapter.Fill(dataTable);
                return(dataTable);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (dbDataAdapter != null)
                {
                    dbDataAdapter.Dispose();
                }
                if (Connection != null)
                {
                    Connection.Close();
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Executes the disconnected.
        /// </summary>
        /// <param name="structure">The structure.</param>
        /// <returns></returns>
        internal override DataTable ExecuteDisconnected(DbSqlStructure structure)
        {
            DbDataAdapter dbDataAdapter = null;
            DataTable     dataTable     = new DataTable();

            try
            {
                if (Connection.State != ConnectionState.Open)
                {
                    Connection.Open();
                }
                DbCommand command = Connection.CreateCommand();
                command.CommandText         = structure.Sql;
                command.CommandType         = structure.SqlType;
                command.CommandTimeout      = 0;
                dbDataAdapter               = Factory.CreateDataAdapter();
                dbDataAdapter.SelectCommand = command;
                dbDataAdapter.Fill(dataTable);
                return(dataTable);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (dbDataAdapter != null)
                {
                    dbDataAdapter.Dispose();
                }
                if (Connection != null)
                {
                    Connection.Close();
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Gets the one value.
        /// </summary>
        /// <param name="structure">The structure.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns></returns>
        internal override object GetOneValue(DbSqlStructure structure, List <DbInputParameter> parameters)
        {
            DbCommand command = null;

            try
            {
                if (Connection.State != ConnectionState.Open)
                {
                    Connection.Open();
                }
                command             = Connection.CreateCommand();
                command.CommandText = structure.Sql;
                command.CommandType = structure.SqlType;
                object obj = ClientHelper.ExecuteScalarCommand(command, parameters);
                if (obj != null && obj != DBNull.Value)
                {
                    return(obj);
                }
                return(null);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (command != null)
                {
                    command.Dispose();
                }
                if (Connection != null)
                {
                    Connection.Close();
                }
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// Executes the query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 internal abstract DbDataReader ExecuteQuery(DbSqlStructure structure, List <DbInputParameter> parameters);
Exemplo n.º 11
0
 /// <summary>
 /// Executes the report query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 internal virtual DbDataAdapter ExecuteReportQuery(DbSqlStructure structure, List <DbInputParameter> parameters)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 /// <summary>
 /// Gets the one value.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 internal abstract object GetOneValue(DbSqlStructure structure, List <DbInputParameter> parameters);
Exemplo n.º 13
0
 /// <summary>
 /// Gets the one value.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 internal abstract object GetOneValue(DbSqlStructure structure);
Exemplo n.º 14
0
 /// <summary>
 /// Executes the non query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="hasOutputValue">if set to <c>true</c> [has output value].</param>
 /// <param name="outparametername">The outparametername.</param>
 /// <returns></returns>
 internal abstract int ExecuteNonQuery(DbSqlStructure structure, List <DbInputParameter> parameters, bool hasOutputValue, string outparametername);
Exemplo n.º 15
0
 /// <summary>
 /// Executes the non query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 internal abstract int ExecuteNonQuery(DbSqlStructure structure, List <DbInputParameter> parameters);
Exemplo n.º 16
0
 /// <summary>
 /// Executes the non query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 internal abstract int ExecuteNonQuery(DbSqlStructure structure);
Exemplo n.º 17
0
 /// <summary>
 /// Executes the disconnected.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 internal virtual DataTable ExecuteDisconnected(DbSqlStructure structure)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 18
0
 /// <summary>
 /// Executes the disconnected.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 internal virtual DataTable ExecuteDisconnected(DbSqlStructure structure, List <DbInputParameter> parameters)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 19
0
 /// <summary>
 /// Executes the query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 internal abstract DbDataReader ExecuteQuery(DbSqlStructure structure);
Exemplo n.º 20
0
 /// <summary>
 /// Executes the report query.
 /// </summary>
 /// <param name="structure">The structure.</param>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 internal virtual DbDataAdapter ExecuteReportQuery(DbSqlStructure structure)
 {
     throw new NotImplementedException();
 }