Example #1
0
        /// <summary>Inserts a AccountBase record using Metadata Parameters.</summary>
        /// <param name="parameters">Contains the metadata parameters.</param>
        public new static void Archive(ParameterList parameters)
        {
            // Extract the parameters from the command batch.
            AdoTransaction adoTransaction = parameters["adoTransaction"];
            SqlTransaction sqlTransaction = parameters["sqlTransaction"];
            long           rowVersion     = parameters["rowVersion"];
            int            accountBaseId  = parameters["accountBaseId"];

            // Call the internal method to complete the operation.
            AccountBase.Archive(adoTransaction, sqlTransaction, rowVersion, accountBaseId);
        }
Example #2
0
        /// <summary>Archives a AccountGroup record.</summary>
        /// <param name="transaction">Commits or rejects a set of commands as a unit</param>
        /// <param name="rowVersion">The version number of this row.</param>
        /// <param name="accountGroupId">The value for the AccountGroupId column.</param>
        /// <param name="archive">true to archive the object, false to unarchive it.</param>
        public new static void Archive(AdoTransaction adoTransaction, SqlTransaction sqlTransaction, long rowVersion, int accountGroupId)
        {
            // Accessor for the AccountGroup Table.
            ServerMarketData.AccountGroupDataTable accountGroupTable = ServerMarketData.AccountGroup;
            // Rule #1: Make sure the record exists before updating it.
            ServerMarketData.AccountGroupRow accountGroupRow = accountGroupTable.FindByAccountGroupId(accountGroupId);
            if ((accountGroupRow == null))
            {
                throw new Exception(string.Format("The AccountGroup table does not have an element identified by {0}", accountGroupId));
            }
            // Rule #2: Optimistic Concurrency Check
            if ((accountGroupRow.RowVersion != rowVersion))
            {
                throw new System.Exception("This record is busy.  Please try again later.");
            }
            // Delete the base class record.  Note that optimistic concurrency is only used
            // by the top level type in the hierarchy, it is bypassed after you pass the first test.
            long baseRowVersion = accountGroupRow.AccountBaseRow.RowVersion;

            AccountBase.Archive(adoTransaction, sqlTransaction, baseRowVersion, accountGroupId);
        }
Example #3
0
 /// <summary>Collects the table lock request(s) for an Update operation</summary>
 /// <param name="adoTransaction">A list of locks required for this operation.</param>
 public new static void Archive(AdoTransaction adoTransaction)
 {
     // Lock the tables at the base level of the object hierarchy.
     AccountBase.Archive(adoTransaction);
 }