Ejemplo n.º 1
0
 /// <summary>Updates a BrokerAccount 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 BrokerAccount Table.
     ServerMarketData.BrokerAccountDataTable brokerAccountTable = ServerMarketData.BrokerAccount;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalBrokerAccountId = ((string)(parameters["brokerAccountId"]));
     object externalBrokerId = parameters["brokerId"].Value;
     object description = parameters["description"].Value;
     object mnemonic = parameters["mnemonic"].Value;
     object externalTraderId = parameters["traderId"].Value;
     // The row versioning is largely disabled for external operations.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     int brokerAccountId = BrokerAccount.FindRequiredKey(configurationId, "brokerAccountId", externalBrokerAccountId);
     object brokerId = Broker.FindOptionalKey(configurationId, "brokerId", externalBrokerId);
     object traderId = Trader.FindOptionalKey(configurationId, "traderId", externalTraderId);
     // 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.BrokerAccountRow brokerAccountRow = brokerAccountTable.FindByBrokerAccountId(brokerAccountId);
     rowVersion = ((long)(brokerAccountRow[brokerAccountTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.BrokerAccount.Update(adoTransaction, sqlTransaction, ref rowVersion, brokerAccountId, brokerId, description, null, null, null, null, mnemonic, traderId);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Ejemplo n.º 2
0
 /// <summary>Archives a BrokerAccount 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 BrokerAccount Table.
     ServerMarketData.BrokerAccountDataTable brokerAccountTable = ServerMarketData.BrokerAccount;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalBrokerAccountId = parameters["brokerAccountId"];
     // 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 brokerAccountId = BrokerAccount.FindRequiredKey(configurationId, "brokerAccountId", externalBrokerAccountId);
     // 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.BrokerAccountRow brokerAccountRow = brokerAccountTable.FindByBrokerAccountId(brokerAccountId);
     rowVersion = ((long)(brokerAccountRow[brokerAccountTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.BrokerAccount.Archive(adoTransaction, sqlTransaction, rowVersion, brokerAccountId);
 }