/// <summary>Finds a a PriceType record using a configuration and an external identifier.</summary> /// <param name="configurationId">Specified which mappings (user id columns) to use when looking up external identifiers.</param> /// <param name="externalId">The external identifier for the record.</param> public static int FindRequiredKey(object configurationId, string parameterId, string externalId) { // Look up the internal identifier using the configuration to select the ExternalId column and the external identifier to identify the record int internalId = PriceType.FindKey(configurationId, parameterId, externalId); if ((internalId == int.MinValue)) { throw new Exception(string.Format("The PriceType table does not have a record identified by \'{0}\'", externalId)); } // Return the internal identifier. return internalId; }
/// <summary>Finds a a PriceType record using a configuration and an external identifier.</summary> /// <param name="configurationId">Specified which mappings (user id columns) to use when looking up external identifiers.</param> /// <param name="externalId">The external (user supplied) identifier for the record.</param> public static object FindOptionalKey(object configurationId, string parameterId, object externalId) { // Look up the internal identifier using the the configuration to specify which ExternalId column to use as an index. object internalId = null; if ((externalId != null)) { internalId = PriceType.FindKey(configurationId, parameterId, ((string)(externalId))); if ((((int)(internalId)) == int.MinValue)) { throw new Exception(string.Format("The PriceType table does not have a record identified by \'{0}\'", externalId)); } } // Return the internal identifier. return internalId; }