Exemplo n.º 1
0
 protected virtual void Dispose(bool isDisposing)
 {
     if (!_isDisposed)
     {
         if (isDisposing)
         {
             if (_connectionProvider != null)
             {
                 ((IDisposable)_connectionProvider).Dispose();
                 _connectionProvider = null;
             }
         }
     }
     _isDisposed = true;
 }
Exemplo n.º 2
0
        ///<Summary>
        ///Delete all by foreign key
        ///This method deletes all rows in the table technician with a given foreign key
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///HelpDesk_TxConnectionProvider connectionProvider, Int32? roleid
        ///</parameters>
        public static void DeleteAllByRoleid(HelpDesk_TxConnectionProvider connectionProvider, Int32?roleid)
        {
            SqlCommand command = new SqlCommand();

            command.CommandText = InlineProcs.ctprtechnician_DeleteAllByRoleid;
            command.CommandType = CommandType.Text;
            command.Connection  = connectionProvider.Connection;
            command.Transaction = connectionProvider.CurrentTransaction;

            try
            {
                command.Parameters.Add(new SqlParameter("@roleid", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, (object)roleid ?? (object)DBNull.Value));

                command.ExecuteNonQuery();
            }
            catch
            {
                throw;
            }
            finally
            {
                command.Dispose();
            }
        }