/// <summary>Updates a TaxLot 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 TaxLot Table. ServerMarketData.TaxLotDataTable taxLotTable = ServerMarketData.TaxLot; // Extract the parameters from the command batch. AdoTransaction adoTransaction = parameters["adoTransaction"]; SqlTransaction sqlTransaction = parameters["sqlTransaction"]; object configurationId = parameters["configurationId"].Value; object externalAccountId = parameters["accountId"].Value; object cost = parameters["cost"].Value; object localCost = parameters["localCost"].Value; object externalPositionTypeCode = parameters["positionTypeCode"].Value; object quantity = parameters["quantity"].Value; object externalSecurityId = parameters["securityId"].Value; object settlementDate = parameters["settlementDate"].Value; string externalTaxLotId = ((string)(parameters["taxLotId"])); object tradeDate = parameters["tradeDate"].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; // The row versioning is largely disabled for external operations. long rowVersion = long.MinValue; // Resolve External Identifiers object accountId = Account.FindOptionalKey(configurationId, "accountId", externalAccountId); object positionTypeCode = PositionType.FindOptionalKey(configurationId, "positionTypeCode", externalPositionTypeCode); object securityId = Security.FindOptionalKey(configurationId, "securityId", externalSecurityId); int taxLotId = TaxLot.FindRequiredKey(configurationId, "taxLotId", externalTaxLotId); // 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.TaxLotRow taxLotRow = taxLotTable.FindByTaxLotId(taxLotId); rowVersion = ((long)(taxLotRow[taxLotTable.RowVersionColumn])); // Call the internal method to complete the operation. MarkThree.Guardian.Core.TaxLot.Update(adoTransaction, sqlTransaction, ref rowVersion, accountId, cost, null, null, null, null, localCost, positionTypeCode, quantity, securityId, settlementDate, taxLotId, tradeDate, userData0, userData1, userData2, userData3, userData4, userData5, userData6, userData7); // Return values. parameters["rowVersion"] = rowVersion; }
/// <summary>Archives a TaxLot 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 TaxLot Table. ServerMarketData.TaxLotDataTable taxLotTable = ServerMarketData.TaxLot; // Extract the parameters from the command batch. AdoTransaction adoTransaction = parameters["adoTransaction"]; SqlTransaction sqlTransaction = parameters["sqlTransaction"]; object configurationId = parameters["configurationId"].Value; string externalTaxLotId = parameters["taxLotId"]; // 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 taxLotId = TaxLot.FindRequiredKey(configurationId, "taxLotId", externalTaxLotId); // 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.TaxLotRow taxLotRow = taxLotTable.FindByTaxLotId(taxLotId); rowVersion = ((long)(taxLotRow[taxLotTable.RowVersionColumn])); // Call the internal method to complete the operation. MarkThree.Guardian.Core.TaxLot.Archive(adoTransaction, sqlTransaction, rowVersion, taxLotId); }