Esempio n. 1
0
 /// <summary>Updates a Holiday 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 Holiday Table.
     ServerMarketData.HolidayDataTable holidayTable = ServerMarketData.Holiday;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     object externalCountryId = parameters["countryId"].Value;
     object date = parameters["date"].Value;
     string externalHolidayId = ((string)(parameters["holidayId"]));
     object externalHolidayTypeCode = parameters["holidayTypeCode"].Value;
     // The row versioning is largely disabled for external operations.
     long rowVersion = long.MinValue;
     // Resolve External Identifiers
     object countryId = Country.FindOptionalKey(configurationId, "countryId", externalCountryId);
     int holidayId = Holiday.FindRequiredKey(configurationId, "holidayId", externalHolidayId);
     object holidayTypeCode = HolidayType.FindOptionalKey(configurationId, "holidayTypeCode", externalHolidayTypeCode);
     // 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.HolidayRow holidayRow = holidayTable.FindByHolidayId(holidayId);
     rowVersion = ((long)(holidayRow[holidayTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Holiday.Update(adoTransaction, sqlTransaction, ref rowVersion, countryId, date, null, null, holidayId, holidayTypeCode);
     // Return values.
     parameters["rowVersion"] = rowVersion;
 }
Esempio n. 2
0
 /// <summary>Archives a Holiday 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 Holiday Table.
     ServerMarketData.HolidayDataTable holidayTable = ServerMarketData.Holiday;
     // Extract the parameters from the command batch.
     AdoTransaction adoTransaction = parameters["adoTransaction"];
     SqlTransaction sqlTransaction = parameters["sqlTransaction"];
     object configurationId = parameters["configurationId"].Value;
     string externalHolidayId = parameters["holidayId"];
     // 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 holidayId = Holiday.FindRequiredKey(configurationId, "holidayId", externalHolidayId);
     // 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.HolidayRow holidayRow = holidayTable.FindByHolidayId(holidayId);
     rowVersion = ((long)(holidayRow[holidayTable.RowVersionColumn]));
     // Call the internal method to complete the operation.
     MarkThree.Guardian.Core.Holiday.Archive(adoTransaction, sqlTransaction, rowVersion, holidayId);
 }