Touchstone 11.0 API Reference
CreateContract Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : CreateContract Method
Contains a CreateContractRequest that identifies the properties of the Contract that you want to create, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.
Creates a new Touchstone® Contract.
Syntax
Public Function CreateContract( _
   ByVal request As CreateContractRequest _
) As CreateContractResponse
Dim instance As ExposureManagementServiceClient
Dim request As CreateContractRequest
Dim value As CreateContractResponse
 
value = instance.CreateContract(request)

Parameters

request
Contains a CreateContractRequest that identifies the properties of the Contract that you want to create, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.

Return Value

A CreateContractResponse containing the Contract SID, which uniquely identifies the Contract that you have created.
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 create a Touchstone Contract using the CreateContract() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetCreateContractRequest
{
    private static void CreateContract(int businessUnitSid, int sqlInstanceSid, string contractId, int exposureSetSid, int dataSourceSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        CreateContractRequest request = new CreateContractRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.Contract = new Contract
        {
            ID = contractId,
            Type = ContractType.PrimaryProperty,
            Status = ContractStatus.Submitted,
            InceptionDate = new DateTime(2014, 1, 1),
            ExpirationDate = new DateTime(2014, 12, 31),
            Currency = "USD",
            Perils = PerilSetCode.TropicalCyclone,
            ExposureSet = new ExposureSet { Sid = exposureSetSid, DataSourceSid = dataSourceSid }
        };
            
        CreateContractResponse response = exposureManagementClient.CreateContract(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Console.WriteLine(" Contract: " + contractId + " created with SID: " + response.ContractSid);
        }
    }
}
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

ExposureManagementServiceClient Class
ExposureManagementServiceClient Members