Beispiel #1
0
 /// <summary>Updates a BlotterMap 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 BlotterMap Table.
     ServerDataModel.BlotterMapDataTable blotterMapTable = ServerDataModel.BlotterMap;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalBlotterMapId = ((string)(parameters["blotterMapId"]));
     object externalSecurityId = parameters["securityId"].Value;
     object externalBlotterId = parameters["blotterId"].Value;
     object minimumQuantity = parameters["minimumQuantity"].Value;
     object maximumQuantity = parameters["maximumQuantity"].Value;
     // The row versioning is largely disabled for external operations.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     int blotterMapId = BlotterMap.FindRequiredKey(configurationId, "blotterMapId", externalBlotterMapId);
     object securityId = Security.FindOptionalKey(configurationId, "securityId", externalSecurityId);
     object blotterId = Blotter.FindOptionalKey(configurationId, "blotterId", externalBlotterId);
     // 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.
     ServerDataModel.BlotterMapRow blotterMapRow = blotterMapTable.FindByBlotterMapId(blotterMapId);
     rowVersion = ((long)(blotterMapRow[blotterMapTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Quasar.Core.BlotterMap.Update(adoTransaction, sqlTransaction, ref rowVersion, blotterMapId, securityId, blotterId, minimumQuantity, maximumQuantity, null, null);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Beispiel #2
0
 /// <summary>Archives a BlotterMap 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 BlotterMap Table.
     ServerDataModel.BlotterMapDataTable blotterMapTable = ServerDataModel.BlotterMap;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalBlotterMapId = parameters["blotterMapId"];
     // 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 blotterMapId = BlotterMap.FindRequiredKey(configurationId, "blotterMapId", externalBlotterMapId);
     // 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.
     ServerDataModel.BlotterMapRow blotterMapRow = blotterMapTable.FindByBlotterMapId(blotterMapId);
     rowVersion = ((long)(blotterMapRow[blotterMapTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Quasar.Core.BlotterMap.Archive(adoTransaction, sqlTransaction, rowVersion, blotterMapId);
 }