Touchstone Re 2023 API Reference
UpdateProgram Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ReinsuranceProgramManagementServiceClient Class : UpdateProgram Method
Contains an UpdateProgramRequest that identifies the properties of the program to update, along with the Business Unit SID and SQL Instance SID associated with the program.
Updates an existing Touchstone Re Reinsurance Program.
Syntax
Public Function UpdateProgram( _
   ByVal request As UpdateProgramRequest _
) As UpdateProgramResponse
Dim instance As ReinsuranceProgramManagementServiceClient
Dim request As UpdateProgramRequest
Dim value As UpdateProgramResponse
 
value = instance.UpdateProgram(request)

Parameters

request
Contains an UpdateProgramRequest that identifies the properties of the program to update, along with the Business Unit SID and SQL Instance SID associated with the program.

Return Value

An UpdateProgramResponse that contains the details of the program that you updated.
Remarks

To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

Example
The following example shows how to update an existing Program using the UpdateProgram() method:
using AIR.Services.Common.Data;
using AIR.Services.Reinsurance.ProgramManagement.Api;
using System;
using System.Collections.Generic;
            
class SnippetUpdateProgram
{
 private static void UpdateProgram(int businessUnitSid, int sqlInstanceSid, int programSid)
        {
            
            
           ReinsuranceProgramManagementServiceClient client = new ReinsuranceProgramManagementServiceClient(); 
            GetProgramRequest request = new GetProgramRequest();
            
            request.BusinessUnitSid = _businessUnitSid;
            
            request.SqlInstanceSid = _sqlServerSid;
            
            request.ProgramSid = programSid;
            
            GetProgramResponse response = TouchstoneClients.ReinsuranceProgramManagementClient.GetProgram(request);
            if (response.Status.Code == StatusCode.Success)
            
            {
                var program = response.Program;
                program.Name = "Updated "+ program.Name + "-" + DateTime.Now.Ticks;
                program.Description = "API Description - " + DateTime.Now.Ticks;
                program.Layers[0].Premium = 2000;
                program.Layers[0].Reinstatement = 0;
                program.Layers[0].ReinstatementPremiums.Clear()
                program.Layers[0].ReinstatementPremiums[0].PercentOfInitialPremium = 11;
                program.Layers[0].ReinstatementPremiums[0].TimeProvisionPercent = "12";
                program.Layers[0].ReinstatementPremiums[0].AmountProvisionPercent = "13";
                var Layers = new List()
                {
                    new Layer()
                        {
                           PerilSetCode = PerilSetCode.Earthquake,
                           AggregateResetDay = 18,
                            OccurrenceRetention= 57,
                            ID = "updated layer - 1",
            
                           AppliesToArea = new AIR.Services.Reinsurance.Common.Data.ReinsuranceAppliesToArea()
                            {
                               Name = "UK",
                                GeographyItems = new List()
                                {
                               new AIR.Services.Geography.Data.GeographyLeafItem()
                                   {
                                    GeographySid=233,
                                        CededPercentage = 25.333
                                   }
                             }
                            },
                
                            AppliesToEventsFilters=new List()
                           {
                            new AIR.Services.Reinsurance.Common.Data.ReinsuranceAppliesToEventsFilter()
                               {
                                   GeographySids =  new List
                                  {
                                       234,233
                                   },
                                 Name = "UK geo",
                                    EventParameters = new List()
            
                                 {
                                        new AIR.Services.LossAnalysis.EventFilter.Data.FilterByRule()
                                    {
                                               EventAttributeID = 1,
                                            OperatorID = AIR.Services.LossAnalysis.EventFilter.Data.Operator.IsLessThan,
                                                Value1 = 45,
            
                                        },
                                        new AIR.Services.LossAnalysis.EventFilter.Data.FilterByRule()
                                       {
                                               EventAttributeID = 12,
                                              OperatorID = AIR.Services.LossAnalysis.EventFilter.Data.Operator.IsEqualTo,
                                                Value1 = 0
                                       },
                                      new AIR.Services.LossAnalysis.EventFilter.Data.FilterByRule()
                                        {
                                               EventAttributeID = 8,
                                               OperatorID = AIR.Services.LossAnalysis.EventFilter.Data.Operator.IsEqualTo,
                                                Value1 = 0
                                        }
                                    }
                               }
                            }
            
                       }
                };
                program.Layers.AddRange(Layers);
            
                UpdateProgramRequest updateRequest = new UpdateProgramRequest();
                
                updateRequest.BusinessUnitSid = _businessUnitSid;
                
                updateRequest.SqlInstanceSid = _sqlServerSid;
                
		updateRequest.Program = program;
                
                UpdateProgramResponse updateResponse = TouchstoneClients.ReinsuranceProgramManagementClient.UpdateProgram(updateRequest);
                if (response.Status.Code == StatusCode.Success) 
                {
                    Console.WriteLine("Update Status: " + updateResponse.Status.Description);
                }
            }
        }
 }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ReinsuranceProgramManagementServiceClient Class
ReinsuranceProgramManagementServiceClient Members