/// <summary> /// Processes the coverage. /// </summary> /// <param name="xiapSectionDetail">The xiap section detail.</param> /// <param name="externalCoverage">The external coverage.</param> private void ProcessCoverage(SectionDetail xiapSectionDetail, IUWCoverage externalCoverage) { Coverage coverage = null; CoverageVersion coverageVersion = (CoverageVersion)this.GetCoverageForExternalRef(xiapSectionDetail, externalCoverage.ExternalReference); if (coverageVersion == null) { // No Coverage already exists on the GeniusX policy that matches the External Reference so we create one, via the Product definition. ProductCoverage productCoverage = ObjectFactory.Resolve<IMetadataQuery>().GetProductCoverage(xiapSectionDetail.ProductSectionDetailID.Value, externalCoverage.CoverageTypeCode); if (productCoverage != null) { coverage = xiapSectionDetail.AddNewCoverage(productCoverage.ProductCoverageID); this.UpdateCoverage(coverage, externalCoverage); } } }
/// <summary> /// Updates the coverage passed in with the title from the Genius external policy coverage. /// </summary> /// <param name="xiapCoverage">The xiap coverage.</param> /// <param name="externalCoverage">The external coverage.</param> private void UpdateCoverage(Coverage xiapCoverage, IUWCoverage externalCoverage) { xiapCoverage.ExternalReference = externalCoverage.ExternalReference; CoverageVersion coverageVersion = (CoverageVersion)xiapCoverage.GetLatestVersion(); if (coverageVersion != null) { coverageVersion.CoverageTitle = externalCoverage.CoverageTitle; } }