Touchstone Re 2023 API Reference
GetContract Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : GetContract Method
Contains a GetContractRequest that identifies the Touchstone-generated Contract Sequential Identifier (SID) of the Contract that you want to retrieve, along with the associated Exposure Set, Business Unit SID, and SQL Instance SID.
Retrieves a single existing Touchstone® Contract.
Syntax
Public Function GetContract( _
   ByVal request As GetContractRequest _
) As GetContractResponse
Dim instance As ExposureManagementServiceClient
Dim request As GetContractRequest
Dim value As GetContractResponse
 
value = instance.GetContract(request)
public GetContractResponse GetContract( 
   GetContractRequest request
)

Parameters

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

Return Value

A GetContractResponse containing the Touchstone Contract that you have requested.
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.

To find the Exposure Set to pass into this method, call the GetExposureSets() method. (To find the Data Source SID to pass into the GetExposureSets() method, call the GetDataSources() method.)

To find the Contract SID to pass into this method, call the GetContracts() method.

Example
The following example shows how to retrieve a Touchstone Contract using the GetContract() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetGetContractRequest
{
    private static void GetContract(int businessUnitSid, int sqlInstanceSid, int contractSid, int exposureSetSid, int datasourceSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        GetContractRequest request = new GetContractRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.ContractSid = contractSid;
        request.ExposureSet = new ExposureSet
        {
            Sid = exposureSetSid,
            DataSourceSid = datasourceSid
        };
        GetContractResponse response = exposureManagementClient.GetContract(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Contract contract = response.Contract;
            Console.WriteLine("------------------   Contract SID: " + contract.Sid + "  -----------------------");
            Console.WriteLine("ID: " + contract.ID);
            Console.WriteLine("Insured Name: " + contract.InsuredName);
            Console.WriteLine("Inception Date: " + contract.InceptionDate);
            Console.WriteLine("Expiration Date: " + contract.ExpirationDate);
            Console.WriteLine("Total Location Count: " + contract.LocationCount);
            Console.WriteLine("Total Replacement Value: " + contract.TotalReplacementValue);
            Console.WriteLine("            ----------------------                    ");
        }
    }
}
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