using System;
using System.Xml;
using System.Xml.Serialization;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.Serialization;
using Tdo;
using Tdo.Common;
using Tdo.Common.Entities;
using Tdo.Common.Programmability;
using Tdo.Common.Entities.Tables;
using Tdo.Common.Entities.Views;
using Tdo.Common.Helper;
using Tdo.Common.TdoSqlExpressionDom;
using Tdo.Common.TdoTypes;
namespace Tdo.Common.Helper{
/// <summary>
/// Interface ITdoHelper for all TDOHelper Classes
/// </summary>
[CLSCompliant(true)]
public interface ITdoHelper : IDisposable
{
/// <summary>
/// Sql Connection String
/// </summary>
string ConnectionString { get; set; }
/// <summary>
/// <code>Open DataBase Connection</code>
/// </summary>
void OpenConnection();
/// <summary>
/// Close DataBase Connection
/// </summary>
void CloseConnection();
/// <summary>
/// Begin an commandText-transaction
/// </summary>
/// <param name="isolationLevel">Transaction Isolation Level</param>
/// <param name="transactionName">Transaction Name</param>
void BeginTransaction(System.Data.IsolationLevel isolationLevel, string transactionName);
/// <summary>
/// Begin a commandText-transaction
/// </summary>
/// <param name="isolationLevel">Transaction Isolation Level</param>
void BeginTransaction(System.Data.IsolationLevel isolationLevel);
/// <summary>
/// Begin a commandText-transaction
/// </summary>
void BeginTransaction();
/// <summary>
/// Begin a commandText-transaction
/// </summary>
/// <param name="transactionName">Transaction Name</param>
void BeginTransaction(string transactionName);
/// <summary>
/// Commit current transaction
/// </summary>
void CommitTransaction();
/// <summary>
/// Commit current transaction
/// </summary>
void RollBackTransaction();
/// <summary>
/// Commit transactionName transaction
/// </summary>
/// <param name="transactionName">Transaction Name</param>
void RollBackTransaction(string transactionName);
/// <summary>
/// Reference for current SqlTransaction
/// </summary>
SqlTransaction Transaction { get; }
/// <summary>
/// Get SqlConnection reference
/// </summary>
SqlConnection Connection { get; }
/// <summary>
/// Get or Set SqlCommand time out (default is 60 seconds)
/// </summary>
int CommandTimeOut { get; set; }
/// <summary>
/// Returns an array of ITdoTable
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
ITdoTable[] TdoTables { get; }
/// <summary>
/// Returns an array of ITdoView
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
ITdoView[] TdoViews { get; }
/// <summary>
/// Returns an array of ITdoStoredProcedure
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
ITdoStoredProcedure[] TdoStoredProcedures { get; }
/// <summary>
/// SqlCommand HashTable with async SqlCommands (Begin/End Methods)
/// </summary>
Hashtable SqlCommandAsyncStore { get; }
/// <summary>
/// Creates and returns a System.Data.SqlClient.SqlCommand object associated supplied values.
/// </summary>
/// <param name="commandText">Transact-SQL statement or stored procedure to execute at the data source.</param>
/// <param name="sqlParameters">The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.</param>
/// <returns></returns>
SqlCommand CreateCommand(string commandText, params SqlParameter[] sqlParameters);
/// <summary>
/// Creates and returns a System.Data.SqlClient.SqlCommand object associated supplied values.
/// </summary>
/// <param name="commandText">Transact-SQL statement or stored procedure to execute at the data source.</param>
/// <param name="commandType">a value indicating how the System.Data.SqlClient.SqlCommand.CommandText property is to be interpreted.</param>
/// <param name="sqlParameters">The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.</param>
/// <returns></returns>
SqlCommand CreateCommand(string commandText, CommandType commandType, params SqlParameter[] sqlParameters);
/// <summary>
/// Creates and returns a System.Data.SqlClient.SqlCommand object associated supplied values.
/// </summary>
/// <param name="commandText">Transact-SQL statement or stored procedure to execute at the data source.</param>
/// <param name="commandType">a value indicating how the System.Data.SqlClient.SqlCommand.CommandText property is to be interpreted.</param>
/// <param name="sqlNotificationRequest">a value that specifies the System.Data.Sql.SqlNotificationRequest object bound to this command.</param>
/// <param name="notificationAutoEnlist">[To be supplied.]</param>
/// <param name="sqlParameters">The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.</param>
/// <returns></returns>
SqlCommand CreateCommand(string commandText, CommandType commandType, System.Data.Sql.SqlNotificationRequest sqlNotificationRequest, bool notificationAutoEnlist, params SqlParameter[] sqlParameters);
/// <summary>
/// Gets or Sets if TdoHelper must Open and Close Connection automatically.
/// </summary>
bool AutomaticOpenCloseConnection { get; set; }
/// <summary>
/// Gets or Sets a bool value indicating if TdoHelper must execute Command automatically in Transaction.
/// </summary>
bool AutomaticTransaction { get; set; }
/// <summary>
/// Get Sql Server version
/// </summary>
string ServerVersion { get; }
/// <summary>
/// Prepare Automatic Connection.
/// </summary>
void PrepareAutomaticConnection();
/// <summary>
/// Prepare Automatic Transaction.
/// </summary>
void PrepareAutomaticTransaction();
/// <summary>
/// Unprepare Automatic Connection.
/// </summary>
void UnPrepareAutomaticConnection();
/// <summary>
/// UnPrepare Automatic Transaction.
/// </summary>
void UnPrepareAutomaticTransaction();
/// <summary>
/// Occurs during Fill operations with errors.
/// </summary>
event FillErrorEventHandler FillError;
/// <summary>
/// Occurs when SQL Server connection state change.
/// </summary>
event StateChangeEventHandler ConnectionStateChange;
/// <summary>
/// Occurs when SQL Server returns a warning or informational message.
/// </summary>
event SqlInfoMessageEventHandler InfoMessage;
/// <summary>
/// Occurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires.
/// </summary>
event SqlRowUpdatedEventHandler RowUpdated;
/// <summary>
/// Occurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires.
/// </summary>
event SqlRowUpdatingEventHandler RowUpdating;
/// <summary>
/// Occurs after a command is executed against the data source.
/// </summary>
event StatementCompletedEventHandler StatementCompleted;
/// <summary>
/// [Internal use only].
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void internalStatementCompletedEventHandler(object sender, StatementCompletedEventArgs e);
}
}
|