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