/// <summary>
        /// Begins a local database transaction.
        /// </summary>
        public LocalTransactionScope(Database database, System.Data.IsolationLevel isolationLevel)
        {
            if (database == null)
                throw new ArgumentNullException();

            transaction = database.Transactions;
            transaction.Begin(isolationLevel);
        }
예제 #2
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Initializes the database and collection class that the object is contained within.
        /// </summary>
        /// <param name="objDatabase">
        /// The database that the collection is associated with.
        /// </param>
        /// <param name="objCollection">
        /// The collection that contains the referenced object. The class' MyBase.Object
        /// function is called to load the object.
        /// </param>
        /// --------------------------------------------------------------------------------
        public ObjectReference(Database objDatabase, IDatabaseObjects objCollection)
        {
            if (objDatabase == null)
                throw new ArgumentNullException("Database has not been set");
            else if (objCollection == null)
                throw new ArgumentNullException("Collection has not been set");

            pobjDatabase = objDatabase;
            pobjCollection = objCollection;
        }
예제 #3
0
        /// <summary>
        /// Ensures that a new connection is opened.
        /// If a connection is already opened then the already open connection is utilised.
        /// </summary>
        internal ConnectionScope(Database.ConnectionController connection)
        {
            if (connection == null)
                throw new ArgumentNullException();

            this.connection = connection;

            #pragma warning disable 0618
            connection.Start();
            #pragma warning restore 0618
        }
        public DatabaseObjectLockController(Database objDatabase, string strLockTableName, string strCurrentUserID)
        {
            if (objDatabase == null)
                throw new ArgumentNullException("Database");
            else if (String.IsNullOrEmpty(strCurrentUserID))
                throw new ArgumentNullException("User");
            else if (String.IsNullOrEmpty(strLockTableName))
                throw new ArgumentNullException("Lock table name");

            pobjDatabase = objDatabase;
            pstrCurrentUserID = strCurrentUserID;
            pstrLockTableName = strLockTableName;

            EnsureTableExists();
        }
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new DatabaseObjects with it's associated database.
 /// </summary>
 ///
 /// <param name="objDatabase">
 /// The database that this collection is associated with.
 /// </param>
 /// --------------------------------------------------------------------------------
 protected DatabaseObjectsUsingAttributes(Database objDatabase)
     : base(objDatabase)
 {
 }
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new DatabaseObjects with it's associated database.
 /// </summary>
 ///
 /// <param name="objDatabase">
 /// The database that this collection is associated with.
 /// </param>
 /// --------------------------------------------------------------------------------
 protected DatabaseObjectsEnumerable(Database objDatabase)
     : base(objDatabase)
 {
 }
 /// <summary>
 /// Begins a local database transaction.
 /// </summary>
 public LocalTransactionScope(Database database)
     : this(database, IsolationLevel.Unspecified)
 {
 }
예제 #8
0
 /// <summary>
 /// Ensures that a new connection is opened.
 /// If a connection is already opened then the already open connection is utilised.
 /// </summary>
 public ConnectionScope(Database database)
     : this(GetConnection(database))
 {
 }
예제 #9
0
        /// <summary>
        /// Called by constructor.
        /// </summary>
        private static Database.ConnectionController GetConnection(Database database)
        {
            if (database == null)
                throw new ArgumentNullException();

            return database.Connection;
        }
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance with it's associated database.
 /// </summary>
 ///
 /// <param name="objDatabase">
 /// The database that this collection is associated with.
 /// </param>
 /// --------------------------------------------------------------------------------
 protected DatabaseObjectsVolatile(Database objDatabase)
     : base(objDatabase)
 {
     VolatileItemsLoad();
 }
 /// --------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance with it's associated database and data that
 /// can be used for specifying a subset.
 /// </summary>
 /// <remarks>
 /// The Data propety is set before the items list is loaded.
 /// </remarks>
 ///
 /// <param name="objDatabase">
 /// The database that this collection is associated with.
 /// </param>
 ///
 /// <param name="objData">
 /// An additional object that is usually required so that it can be used
 /// as a filter in the SubSet function.
 /// </param>
 /// --------------------------------------------------------------------------------
 protected DatabaseObjectsVolatile(Database objDatabase, object objData)
     : base(objDatabase)
 {
     pobjData = objData;
     VolatileItemsLoad();
 }