Esempio n. 1
0
 /// <summary>Updates a TraderVolumeSetting 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 TraderVolumeSetting Table.
     ServerMarketData.TraderVolumeSettingDataTable traderVolumeSettingTable = ServerMarketData.TraderVolumeSetting;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     object autoExecuteQuantity = parameters["autoExecuteQuantity"].Value;
     object thresholdQuantity = parameters["thresholdQuantity"].Value;
     string externalTraderVolumeSettingId = ((string)(parameters["traderVolumeSettingId"]));
     object externalTraderId = parameters["traderId"].Value;
     object externalVolumeCategoryId = parameters["volumeCategoryId"].Value;
     // The row versioning is largely disabled for external operations.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     int traderVolumeSettingId = TraderVolumeSetting.FindRequiredKey(configurationId, "traderVolumeSettingId", externalTraderVolumeSettingId);
     object traderId = Trader.FindOptionalKey(configurationId, "traderId", externalTraderId);
     object volumeCategoryId = VolumeCategory.FindOptionalKey(configurationId, "volumeCategoryId", externalVolumeCategoryId);
     // 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.TraderVolumeSettingRow traderVolumeSettingRow = traderVolumeSettingTable.FindByTraderVolumeSettingId(traderVolumeSettingId);
     rowVersion = ((long)(traderVolumeSettingRow[traderVolumeSettingTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.TraderVolumeSetting.Update(adoTransaction, sqlTransaction, ref rowVersion, null, autoExecuteQuantity, thresholdQuantity, traderVolumeSettingId, traderId, volumeCategoryId);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Esempio n. 2
0
 /// <summary>Archives a TraderVolumeSetting 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 TraderVolumeSetting Table.
     ServerMarketData.TraderVolumeSettingDataTable traderVolumeSettingTable = ServerMarketData.TraderVolumeSetting;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalTraderVolumeSettingId = parameters["traderVolumeSettingId"];
     // 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 traderVolumeSettingId = TraderVolumeSetting.FindRequiredKey(configurationId, "traderVolumeSettingId", externalTraderVolumeSettingId);
     // 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.TraderVolumeSettingRow traderVolumeSettingRow = traderVolumeSettingTable.FindByTraderVolumeSettingId(traderVolumeSettingId);
     rowVersion = ((long)(traderVolumeSettingRow[traderVolumeSettingTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.TraderVolumeSetting.Archive(adoTransaction, sqlTransaction, rowVersion, traderVolumeSettingId);
 }