/// <summary>Updates a ObjectTree record using Metadata Parameters.</summary> /// <param name="transaction">Contains the parameters and exceptions for this command.</param> public static void Update(ParameterList parameters) { // Accessor for the ObjectTree Table. ServerMarketData.ObjectTreeDataTable objectTreeTable = ServerMarketData.ObjectTree; // Extract the parameters from the command batch. AdoTransaction adoTransaction = parameters["adoTransaction"]; SqlTransaction sqlTransaction = parameters["sqlTransaction"]; object configurationId = parameters["configurationId"].Value; string externalObjectTreeId = ((string)(parameters["objectTreeId"])); object externalChildId = parameters["childId"].Value; object externalParentId = parameters["parentId"].Value; // The row versioning is largely disabled for external operations. long rowVersion = long.MinValue; // Resolve External Identifiers int objectTreeId = ObjectTree.FindRequiredKey(configurationId, "objectTreeId", externalObjectTreeId); object childId = Object.FindOptionalKey(configurationId, "childId", externalChildId); object parentId = Object.FindOptionalKey(configurationId, "parentId", externalParentId); // 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. ServerMarketData.ObjectTreeRow objectTreeRow = objectTreeTable.FindByObjectTreeId(objectTreeId); rowVersion = ((long)(objectTreeRow[objectTreeTable.RowVersionColumn])); // Call the internal method to complete the operation. MarkThree.Guardian.Core.ObjectTree.Update(adoTransaction, sqlTransaction, ref rowVersion, objectTreeId, childId, parentId, null); // Return values. parameters["rowVersion"] = rowVersion; }
/// <summary>Archives a ObjectTree record using Metadata Parameters.</summary> /// <param name="transaction">Contains the parameters and exceptions for this command.</param> public static void Archive(ParameterList parameters) { // Accessor for the ObjectTree Table. ServerMarketData.ObjectTreeDataTable objectTreeTable = ServerMarketData.ObjectTree; // Extract the parameters from the command batch. AdoTransaction adoTransaction = parameters["adoTransaction"]; SqlTransaction sqlTransaction = parameters["sqlTransaction"]; object configurationId = parameters["configurationId"].Value; string externalObjectTreeId = parameters["objectTreeId"]; // The row versioning is largely disabled for external operations. long rowVersion = long.MinValue; // Find the internal identifier using the primar key elements. // identifier is used to determine if a record exists with the same key. int objectTreeId = ObjectTree.FindRequiredKey(configurationId, "objectTreeId", externalObjectTreeId); // 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. ServerMarketData.ObjectTreeRow objectTreeRow = objectTreeTable.FindByObjectTreeId(objectTreeId); rowVersion = ((long)(objectTreeRow[objectTreeTable.RowVersionColumn])); // Call the internal method to complete the operation. MarkThree.Guardian.Core.ObjectTree.Archive(adoTransaction, sqlTransaction, rowVersion, objectTreeId); }