Exemple #1
0
        /// <summary>ArchiveChildrens a AccountBase 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="accountBaseId">The value for the AccountBaseId column.</param>
        /// <param name="archive">true to archive the object, false to unarchive it.</param>
        internal static void ArchiveChildren(AdoTransaction adoTransaction, SqlTransaction sqlTransaction, long rowVersion, int accountBaseId)
        {
            // Accessor for the AccountBase Table.
            ServerMarketData.AccountBaseDataTable accountBaseTable = ServerMarketData.AccountBase;
            // This record can be used to iterate through all the children.
            ServerMarketData.AccountBaseRow accountBaseRow = accountBaseTable.FindByAccountBaseId(accountBaseId);
            // Archive the child records.
            for (int index = 0; (index < accountBaseRow.GetAccountRows().Length); index = (index + 1))
            {
                ServerMarketData.AccountRow childAccountRow = accountBaseRow.GetAccountRows()[index];
                Account.ArchiveChildren(adoTransaction, sqlTransaction, childAccountRow.RowVersion, childAccountRow.AccountId);
            }
            for (int index = 0; (index < accountBaseRow.GetAccountGroupRows().Length); index = (index + 1))
            {
                ServerMarketData.AccountGroupRow childAccountGroupRow = accountBaseRow.GetAccountGroupRows()[index];
                AccountGroup.ArchiveChildren(adoTransaction, sqlTransaction, childAccountGroupRow.RowVersion, childAccountGroupRow.AccountGroupId);
            }
            // Increment the row version
            rowVersion = ServerMarketData.RowVersion.Increment();
            // Delete the record in the ADO database.
            accountBaseRow[accountBaseTable.RowVersionColumn] = rowVersion;
            adoTransaction.DataRows.Add(accountBaseRow);
            accountBaseRow.Delete();
            // Archive the record in the SQL database.
            SqlCommand sqlCommand = new SqlCommand("update \"AccountBase\" set \"IsArchived\" = 1 where \"AccountBaseId\"=@accountBaseId");

            sqlCommand.Connection  = sqlTransaction.Connection;
            sqlCommand.Transaction = sqlTransaction;
            sqlCommand.Parameters.Add(new SqlParameter("@accountBaseId", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, accountBaseId));
            sqlCommand.ExecuteNonQuery();
        }
Exemple #2
0
 /// <summary>Updates a Account record using Metadata Parameters.</summary>
 /// <param name="transaction">Contains the parameters and exceptions for this command.</param>
 public new static void Update(ParameterList parameters)
 {
     // Accessor for the Account Table.
     ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     object description = parameters["description"].Value;
     object groupPermission = parameters["groupPermission"].Value;
     object hidden = parameters["hidden"].Value;
     object name = parameters["name"].Value;
     object owner = parameters["owner"].Value;
     object ownerPermission = parameters["ownerPermission"].Value;
     object readOnly = parameters["readOnly"].Value;
     object worldPermission = parameters["worldPermission"].Value;
     object address0 = parameters["address0"].Value;
     object address1 = parameters["address1"].Value;
     object address2 = parameters["address2"].Value;
     object city = parameters["city"].Value;
     object externalCountryId = parameters["countryId"].Value;
     object externalCurrencyId = parameters["currencyId"].Value;
     object mnemonic = parameters["mnemonic"].Value;
     object postalCode = parameters["postalCode"].Value;
     object externalProvinceId = parameters["provinceId"].Value;
     object externalUserId = parameters["userId"].Value;
     object userData0 = parameters["userData0"].Value;
     object userData1 = parameters["userData1"].Value;
     object userData2 = parameters["userData2"].Value;
     object userData3 = parameters["userData3"].Value;
     object userData4 = parameters["userData4"].Value;
     object userData5 = parameters["userData5"].Value;
     object userData6 = parameters["userData6"].Value;
     object userData7 = parameters["userData7"].Value;
     string externalAccountId = ((string)(parameters["accountId"]));
     object externalLotHandlingCode = parameters["lotHandlingCode"].Value;
     object externalTypeCode = parameters["typeCode"].Value;
     // The row versioning is largely disabled for external operations.  The value is returned to the caller in the
     // event it's needed for operations within the batch.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     object countryId = Country.FindOptionalKey(configurationId, "countryId", externalCountryId);
     object currencyId = Security.FindOptionalKey(configurationId, "currencyId", externalCurrencyId);
     object provinceId = Province.FindOptionalKey(configurationId, "provinceId", externalProvinceId);
     object userId = User.FindOptionalKey(configurationId, "userId", externalUserId);
     int accountId = AccountBase.FindRequiredKey(configurationId, "accountId", externalAccountId);
     object lotHandlingCode = LotHandling.FindOptionalKey(configurationId, "lotHandlingCode", externalLotHandlingCode);
     object typeCode = Type.FindOptionalKey(configurationId, "typeCode", externalTypeCode);
     // This disables the concurrency checking logic by finding the current row version and passing it to the
     // internal method.
     ServerMarketData.AccountRow accountRow = accountTable.FindByAccountId(accountId);
     rowVersion = ((long)(accountRow[accountTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Account.Update(adoTransaction, sqlTransaction, ref rowVersion, description, null, null, null, null, null, null, null, null, groupPermission, hidden, name, owner, ownerPermission, readOnly, worldPermission, address0, address1, address2, city, countryId, currencyId, mnemonic, postalCode, provinceId, userId, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7, accountId, lotHandlingCode, typeCode);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Exemple #3
0
        /// <summary>Archives a Account 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="accountId">The value for the AccountId 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 accountId)
        {
            // Accessor for the Account Table.
            ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
            // Rule #1: Make sure the record exists before updating it.
            ServerMarketData.AccountRow accountRow = accountTable.FindByAccountId(accountId);
            if ((accountRow == null))
            {
                throw new Exception(string.Format("The Account table does not have an element identified by {0}", accountId));
            }
            // Rule #2: Optimistic Concurrency Check
            if ((accountRow.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 = accountRow.AccountBaseRow.RowVersion;

            AccountBase.Archive(adoTransaction, sqlTransaction, baseRowVersion, accountId);
        }
Exemple #4
0
 /// <summary>Archives a Account record using Metadata Parameters.</summary>
 /// <param name="transaction">Contains the parameters and exceptions for this command.</param>
 public new static void Archive(ParameterList parameters)
 {
     // Accessor for the Account Table.
     ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalAccountId = parameters["accountId"];
     // The row versioning is largely disabled for external operations.  The value is returned to the caller in the
     // event it's needed for operations within the batch.
     long rowVersion = long.MinValue;
     // Find the internal identifier using the primary key elements.
     // identifier is used to determine if a record exists with the same key.
     int accountId = Account.FindRequiredKey(configurationId, "accountId", externalAccountId);
     // This disables the concurrency checking logic by finding the current row version and passing it to the
     // internal method.
     ServerMarketData.AccountRow accountRow = accountTable.FindByAccountId(accountId);
     rowVersion = ((long)(accountRow[accountTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Account.Archive(adoTransaction, sqlTransaction, rowVersion, accountId);
 }
Exemple #5
0
        /// <summary>Archives a LotHandling 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="lotHandlingCode">The value for the LotHandlingCode column.</param>
        /// <param name="archive">true to archive the object, false to unarchive it.</param>
        public static void Archive(AdoTransaction adoTransaction, SqlTransaction sqlTransaction, long rowVersion, int lotHandlingCode)
        {
            // Accessor for the LotHandling Table.
            ServerMarketData.LotHandlingDataTable lotHandlingTable = ServerMarketData.LotHandling;
            // Rule #1: Make sure the record exists before updating it.
            ServerMarketData.LotHandlingRow lotHandlingRow = lotHandlingTable.FindByLotHandlingCode(lotHandlingCode);
            if ((lotHandlingRow == null))
            {
                throw new Exception(string.Format("The LotHandling table does not have an element identified by {0}", lotHandlingCode));
            }
            // Rule #2: Optimistic Concurrency Check
            if ((lotHandlingRow.RowVersion != rowVersion))
            {
                throw new System.Exception("This record is busy.  Please try again later.");
            }
            // Archive the child records.
            for (int index = 0; (index < lotHandlingRow.GetAccountRows().Length); index = (index + 1))
            {
                ServerMarketData.AccountRow childAccountRow = lotHandlingRow.GetAccountRows()[index];
                Account.ArchiveChildren(adoTransaction, sqlTransaction, childAccountRow.RowVersion, childAccountRow.AccountId);
            }
            // Increment the row version
            rowVersion = ServerMarketData.RowVersion.Increment();
            // Delete the record in the ADO database.
            lotHandlingRow[lotHandlingTable.RowVersionColumn] = rowVersion;
            adoTransaction.DataRows.Add(lotHandlingRow);
            lotHandlingRow.Delete();
            // Archive the record in the SQL database.
            SqlCommand sqlCommand = new SqlCommand("update \"LotHandling\" set \"IsArchived\" = 1 where \"LotHandlingCode\"=@lotHandlingCod" +
                                                   "e");

            sqlCommand.Connection  = sqlTransaction.Connection;
            sqlCommand.Transaction = sqlTransaction;
            sqlCommand.Parameters.Add(new SqlParameter("@lotHandlingCode", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, lotHandlingCode));
            sqlCommand.ExecuteNonQuery();
        }
Exemple #6
0
        /// <summary>Updates a Account record.</summary>
        /// <param name="transaction">Commits or rejects a set of commands as a unit</param>
        /// <param name="rowVersion">The version number of the row</param>
        /// <param name="description">The value for the Description column.</param>
        /// <param name="externalId0">The value for the ExternalId0 column.</param>
        /// <param name="externalId1">The value for the ExternalId1 column.</param>
        /// <param name="externalId2">The value for the ExternalId2 column.</param>
        /// <param name="externalId3">The value for the ExternalId3 column.</param>
        /// <param name="externalId4">The value for the ExternalId4 column.</param>
        /// <param name="externalId5">The value for the ExternalId5 column.</param>
        /// <param name="externalId6">The value for the ExternalId6 column.</param>
        /// <param name="externalId7">The value for the ExternalId7 column.</param>
        /// <param name="groupPermission">The value for the GroupPermission column.</param>
        /// <param name="hidden">The value for the Hidden column.</param>
        /// <param name="name">The value for the Name column.</param>
        /// <param name="owner">The value for the Owner column.</param>
        /// <param name="ownerPermission">The value for the OwnerPermission column.</param>
        /// <param name="readOnly">The value for the ReadOnly column.</param>
        /// <param name="worldPermission">The value for the WorldPermission column.</param>
        /// <param name="address0">The value for the Address0 column.</param>
        /// <param name="address1">The value for the Address1 column.</param>
        /// <param name="address2">The value for the Address2 column.</param>
        /// <param name="city">The value for the City column.</param>
        /// <param name="countryId">The value for the CountryId column.</param>
        /// <param name="currencyId">The value for the CurrencyId column.</param>
        /// <param name="mnemonic">The value for the Mnemonic column.</param>
        /// <param name="postalCode">The value for the PostalCode column.</param>
        /// <param name="provinceId">The value for the ProvinceId column.</param>
        /// <param name="userId">The value for the UserId column.</param>
        /// <param name="userData0">The value for the UserData0 column.</param>
        /// <param name="userData1">The value for the UserData1 column.</param>
        /// <param name="userData2">The value for the UserData2 column.</param>
        /// <param name="userData3">The value for the UserData3 column.</param>
        /// <param name="userData4">The value for the UserData4 column.</param>
        /// <param name="userData5">The value for the UserData5 column.</param>
        /// <param name="userData6">The value for the UserData6 column.</param>
        /// <param name="userData7">The value for the UserData7 column.</param>
        /// <param name="accountId">The value for the AccountId column.</param>
        /// <param name="lotHandlingCode">The value for the LotHandlingCode column.</param>
        /// <param name="typeCode">The value for the TypeCode column.</param>
        public static void Update(
            AdoTransaction adoTransaction,
            SqlTransaction sqlTransaction,
            ref long rowVersion,
            object description,
            object externalId0,
            object externalId1,
            object externalId2,
            object externalId3,
            object externalId4,
            object externalId5,
            object externalId6,
            object externalId7,
            object groupPermission,
            object hidden,
            object name,
            object owner,
            object ownerPermission,
            object readOnly,
            object worldPermission,
            object address0,
            object address1,
            object address2,
            object city,
            object countryId,
            object currencyId,
            object mnemonic,
            object postalCode,
            object provinceId,
            object userId,
            object userData0,
            object userData1,
            object userData2,
            object userData3,
            object userData4,
            object userData5,
            object userData6,
            object userData7,
            int accountId,
            object lotHandlingCode,
            object typeCode)
        {
            // Accessor for the Account Table.
            ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
            // Rule #1: Make sure the record exists before updating it.
            ServerMarketData.AccountRow accountRow = accountTable.FindByAccountId(accountId);
            if ((accountRow == null))
            {
                throw new Exception(string.Format("The Account table does not have an element identified by {0}", accountId));
            }
            // Rule #2: Optimistic Concurrency Check
            if ((accountRow.RowVersion != rowVersion))
            {
                throw new System.Exception("This record is busy.  Please try again later.");
            }
            // Apply Defaults
            if ((lotHandlingCode == null))
            {
                lotHandlingCode = accountRow[accountTable.LotHandlingCodeColumn];
            }
            // Insert the base members using the base class.  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 = accountRow.AccountBaseRow.RowVersion;

            AccountBase.Update(adoTransaction, sqlTransaction, ref baseRowVersion, description, externalId0, externalId1, externalId2, externalId3, externalId4, externalId5, externalId6, externalId7, groupPermission, hidden, name, owner, ownerPermission, readOnly, worldPermission, accountId, address0, address1, address2, city, countryId, currencyId, mnemonic, postalCode, provinceId, typeCode, userId, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7);
            // Increment the row version
            rowVersion = ServerMarketData.RowVersion.Increment();
            // Update the record in the ADO database.
            accountRow[accountTable.RowVersionColumn]      = rowVersion;
            accountRow[accountTable.LotHandlingCodeColumn] = lotHandlingCode;
            adoTransaction.DataRows.Add(accountRow);
            // Update the record in the SQL database.
            SqlCommand sqlCommand = new SqlCommand("update \"Account\" set \"RowVersion\"=@rowVersion,\"LotHandlingCode\"=@lotHandlingCode " +
                                                   "where \"AccountId\"=@accountId");

            sqlCommand.Connection  = sqlTransaction.Connection;
            sqlCommand.Transaction = sqlTransaction;
            sqlCommand.Parameters.Add(new SqlParameter("@rowVersion", SqlDbType.BigInt, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, rowVersion));
            sqlCommand.Parameters.Add(new SqlParameter("@accountId", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, accountId));
            sqlCommand.Parameters.Add(new SqlParameter("@lotHandlingCode", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, lotHandlingCode));
            // Update the record in the SQL database.
            sqlCommand.ExecuteNonQuery();
        }
Exemple #7
0
        /// <summary>Inserts a Account record.</summary>
        /// <param name="transaction">Commits or rejects a set of commands as a unit</param>
        /// <param name="rowVersion">The version number of the row.</param>
        /// <param name="description">The value for the Description column.</param>
        /// <param name="externalId0">The value for the ExternalId0 column.</param>
        /// <param name="externalId1">The value for the ExternalId1 column.</param>
        /// <param name="externalId2">The value for the ExternalId2 column.</param>
        /// <param name="externalId3">The value for the ExternalId3 column.</param>
        /// <param name="externalId4">The value for the ExternalId4 column.</param>
        /// <param name="externalId5">The value for the ExternalId5 column.</param>
        /// <param name="externalId6">The value for the ExternalId6 column.</param>
        /// <param name="externalId7">The value for the ExternalId7 column.</param>
        /// <param name="groupPermission">The value for the GroupPermission column.</param>
        /// <param name="hidden">The value for the Hidden column.</param>
        /// <param name="name">The value for the Name column.</param>
        /// <param name="owner">The value for the Owner column.</param>
        /// <param name="ownerPermission">The value for the OwnerPermission column.</param>
        /// <param name="readOnly">The value for the ReadOnly column.</param>
        /// <param name="worldPermission">The value for the WorldPermission column.</param>
        /// <param name="address0">The value for the Address0 column.</param>
        /// <param name="address1">The value for the Address1 column.</param>
        /// <param name="address2">The value for the Address2 column.</param>
        /// <param name="city">The value for the City column.</param>
        /// <param name="countryId">The value for the CountryId column.</param>
        /// <param name="currencyId">The value for the CurrencyId column.</param>
        /// <param name="mnemonic">The value for the Mnemonic column.</param>
        /// <param name="postalCode">The value for the PostalCode column.</param>
        /// <param name="provinceId">The value for the ProvinceId column.</param>
        /// <param name="userId">The value for the UserId column.</param>
        /// <param name="userData0">The value for the UserData0 column.</param>
        /// <param name="userData1">The value for the UserData1 column.</param>
        /// <param name="userData2">The value for the UserData2 column.</param>
        /// <param name="userData3">The value for the UserData3 column.</param>
        /// <param name="userData4">The value for the UserData4 column.</param>
        /// <param name="userData5">The value for the UserData5 column.</param>
        /// <param name="userData6">The value for the UserData6 column.</param>
        /// <param name="userData7">The value for the UserData7 column.</param>
        /// <param name="lotHandlingCode">The value for the LotHandlingCode column.</param>
        /// <param name="typeCode">The value for the TypeCode column.</param>
        public static int Insert(
            AdoTransaction adoTransaction,
            SqlTransaction sqlTransaction,
            ref long rowVersion,
            object description,
            object externalId0,
            object externalId1,
            object externalId2,
            object externalId3,
            object externalId4,
            object externalId5,
            object externalId6,
            object externalId7,
            object groupPermission,
            object hidden,
            string name,
            object owner,
            object ownerPermission,
            object readOnly,
            object worldPermission,
            object address0,
            object address1,
            object address2,
            object city,
            object countryId,
            int currencyId,
            object mnemonic,
            object postalCode,
            object provinceId,
            int userId,
            object userData0,
            object userData1,
            object userData2,
            object userData3,
            object userData4,
            object userData5,
            object userData6,
            object userData7,
            object lotHandlingCode,
            object typeCode)
        {
            // Accessor for the Account Table.
            ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
            // Apply Defaults
            if ((lotHandlingCode == null))
            {
                lotHandlingCode = System.DBNull.Value;
            }
            if ((typeCode == null))
            {
                typeCode = "Account";
            }
            // Insert the base members using the base class.
            int accountId = AccountBase.Insert(adoTransaction, sqlTransaction, ref rowVersion, description, externalId0, externalId1, externalId2, externalId3, externalId4, externalId5, externalId6, externalId7, groupPermission, hidden, name, owner, ownerPermission, readOnly, worldPermission, address0, address1, address2, city, countryId, currencyId, mnemonic, postalCode, provinceId, typeCode, userId, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7);

            // Increment the row version
            rowVersion = ServerMarketData.RowVersion.Increment();
            // Insert the record into the ADO database.
            ServerMarketData.AccountRow accountRow = accountTable.NewAccountRow();
            accountRow[accountTable.RowVersionColumn]      = rowVersion;
            accountRow[accountTable.AccountIdColumn]       = accountId;
            accountRow[accountTable.LotHandlingCodeColumn] = lotHandlingCode;
            accountTable.AddAccountRow(accountRow);
            adoTransaction.DataRows.Add(accountRow);
            // Insert the record into the SQL database.
            SqlCommand sqlCommand = new SqlCommand("insert \"Account\" (\"rowVersion\",AccountId,LotHandlingCode) values (@rowVersion,@ac" +
                                                   "countId,@lotHandlingCode)");

            sqlCommand.Connection  = sqlTransaction.Connection;
            sqlCommand.Transaction = sqlTransaction;
            sqlCommand.Parameters.Add(new SqlParameter("@rowVersion", SqlDbType.BigInt, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, rowVersion));
            sqlCommand.Parameters.Add(new SqlParameter("@accountId", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, accountId));
            sqlCommand.Parameters.Add(new SqlParameter("@lotHandlingCode", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, lotHandlingCode));
            sqlCommand.ExecuteNonQuery();
            // Return Statements
            return(accountRow.AccountId);
        }
Exemple #8
0
 /// <summary>Loads a Account record using Metadata Parameters.</summary>
 /// <param name="transaction">Contains the parameters and exceptions for this command.</param>
 public new static void Load(ParameterList parameters)
 {
     // Accessor for the Account Table.
     ServerMarketData.AccountDataTable accountTable = ServerMarketData.Account;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     object description = parameters["description"].Value;
     object groupPermission = parameters["groupPermission"].Value;
     object hidden = parameters["hidden"].Value;
     string name = parameters["name"];
     object owner = parameters["owner"].Value;
     object ownerPermission = parameters["ownerPermission"].Value;
     object readOnly = parameters["readOnly"].Value;
     object worldPermission = parameters["worldPermission"].Value;
     object address0 = parameters["address0"].Value;
     object address1 = parameters["address1"].Value;
     object address2 = parameters["address2"].Value;
     object city = parameters["city"].Value;
     object externalCountryId = parameters["countryId"].Value;
     string externalCurrencyId = parameters["currencyId"];
     object mnemonic = parameters["mnemonic"].Value;
     object postalCode = parameters["postalCode"].Value;
     object externalProvinceId = parameters["provinceId"].Value;
     string externalUserId = parameters["userId"];
     object userData0 = parameters["userData0"].Value;
     object userData1 = parameters["userData1"].Value;
     object userData2 = parameters["userData2"].Value;
     object userData3 = parameters["userData3"].Value;
     object userData4 = parameters["userData4"].Value;
     object userData5 = parameters["userData5"].Value;
     object userData6 = parameters["userData6"].Value;
     object userData7 = parameters["userData7"].Value;
     string externalAccountId = parameters["accountId"];
     object externalLotHandlingCode = parameters["lotHandlingCode"].Value;
     object externalTypeCode = parameters["typeCode"].Value;
     // The row versioning is largely disabled for external operations.  The value is returned to the caller in the
     // event it's needed for operations within the batch.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     object countryId = Country.FindOptionalKey(configurationId, "countryId", externalCountryId);
     int currencyId = Security.FindRequiredKey(configurationId, "currencyId", externalCurrencyId);
     object provinceId = Province.FindOptionalKey(configurationId, "provinceId", externalProvinceId);
     int userId = User.FindRequiredKey(configurationId, "userId", externalUserId);
     int accountId = AccountBase.FindKey(configurationId, "accountId", externalAccountId);
     object lotHandlingCode = LotHandling.FindOptionalKey(configurationId, "lotHandlingCode", externalLotHandlingCode);
     object typeCode = Type.FindOptionalKey(configurationId, "typeCode", externalTypeCode);
     ServerMarketData.AccountRow accountRow = accountTable.FindByAccountId(accountId);
     // The load operation will create a record if it doesn't exist, or update an existing record.  The external
     // identifier is used to determine if a record exists with the same key.
     if ((accountRow == null))
     {
         // Populate the 'externalId' varaibles so that the external identifier can be used to find the row when an
         // external method is called with the same 'configurationId' parameter.
         int externalKeyIndex = Account.GetExternalKeyIndex(configurationId, "accountId");
         object[] externalIdArray = new object[8];
         externalIdArray[externalKeyIndex] = externalAccountId;
         object externalId0 = externalIdArray[0];
         object externalId1 = externalIdArray[1];
         object externalId2 = externalIdArray[2];
         object externalId3 = externalIdArray[3];
         object externalId4 = externalIdArray[4];
         object externalId5 = externalIdArray[5];
         object externalId6 = externalIdArray[6];
         object externalId7 = externalIdArray[7];
         // Call the internal method to complete the operation.
         MarkThree.Guardian.Core.Account.Insert(adoTransaction, sqlTransaction, ref rowVersion, description, externalId0, externalId1, externalId2, externalId3, externalId4, externalId5, externalId6, externalId7, groupPermission, hidden, name, owner, ownerPermission, readOnly, worldPermission, address0, address1, address2, city, countryId, currencyId, mnemonic, postalCode, provinceId, userId, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7, lotHandlingCode, typeCode);
     }
     else
     {
         // While the optimistic concurrency checking is disabled for the external methods, the internal methods
         // still need to perform the check.  This ncurrency checking logic by finding the current row version to be
         // will bypass the coused when the internal method is called.
         rowVersion = ((long)(accountRow[accountTable.RowVersionColumn]));
         // Call the internal method to complete the operation.
         MarkThree.Guardian.Core.Account.Update(adoTransaction, sqlTransaction, ref rowVersion, description, null, null, null, null, null, null, null, null, groupPermission, hidden, name, owner, ownerPermission, readOnly, worldPermission, address0, address1, address2, city, countryId, currencyId, mnemonic, postalCode, provinceId, userId, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7, accountId, lotHandlingCode, typeCode);
     }
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }