Ejemplo n.º 1
0
 /// <summary>Updates a Province 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 Province Table.
     ServerMarketData.ProvinceDataTable provinceTable = ServerMarketData.Province;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     object abbreviation = parameters["abbreviation"].Value;
     object externalCountryId = parameters["countryId"].Value;
     object name = parameters["name"].Value;
     string externalProvinceId = ((string)(parameters["provinceId"]));
     // The row versioning is largely disabled for external operations.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     object countryId = Country.FindOptionalKey(configurationId, "countryId", externalCountryId);
     int provinceId = Province.FindRequiredKey(configurationId, "provinceId", externalProvinceId);
     // 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.ProvinceRow provinceRow = provinceTable.FindByProvinceId(provinceId);
     rowVersion = ((long)(provinceRow[provinceTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Province.Update(adoTransaction, sqlTransaction, ref rowVersion, abbreviation, countryId, null, null, name, provinceId);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Ejemplo n.º 2
0
 /// <summary>Archives a Province 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 Province Table.
     ServerMarketData.ProvinceDataTable provinceTable = ServerMarketData.Province;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalProvinceId = parameters["provinceId"];
     // 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 provinceId = Province.FindRequiredKey(configurationId, "provinceId", externalProvinceId);
     // 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.ProvinceRow provinceRow = provinceTable.FindByProvinceId(provinceId);
     rowVersion = ((long)(provinceRow[provinceTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Province.Archive(adoTransaction, sqlTransaction, rowVersion, provinceId);
 }