Touchstone 11.0 API Reference
GetContracts Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : GetContracts Method
Contains a GetContractsRequest that identifies the Touchstone-generated Business Unit Sequential Identifier (SID), SQL Instance SID, and Exposure View SID associated with the list of Contracts that you want to retrieve, along with the desired Paging Info and whether to filter the Contracts by the Exposure View that you have specified.
Retrieves a list of all existing Touchstone® Contracts for a given Exposure View within a specific Business Unit and SQL Server Instance.
Syntax
Public Function GetContracts( _
   ByVal request As GetContractsRequest _
) As GetContractsResponse
Dim instance As ExposureManagementServiceClient
Dim request As GetContractsRequest
Dim value As GetContractsResponse
 
value = instance.GetContracts(request)

Parameters

request
Contains a GetContractsRequest that identifies the Touchstone-generated Business Unit Sequential Identifier (SID), SQL Instance SID, and Exposure View SID associated with the list of Contracts that you want to retrieve, along with the desired Paging Info and whether to filter the Contracts by the Exposure View that you have specified.

Return Value

A GetContractsResponse containing a list of Contracts in the specified Exposure View within the specified SQL Server Instance and Business Unit, as well as information describing the actual paging layout of the returned Contracts.
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 View SID to pass into this method, call the GetExposureViews() method. (To find the Project SID to pass into the GetExposureViews() method, call the GetProjects() method.)

Example
The following example shows how to retrieve a list of all Touchstone Contracts for a given Exposure View within a specific Business Unit and SQL Server Instance using the GetContracts() method:
using AIR.Services.Common.Data;
 using AIR.Services.Common.Exposure.Data;
 using AIR.Services.ExposureManagement.Api;
 using System;
            
 public class SnippetGetContracts
 {
    private static void GetContracts(int businessUnitSid, int sqlInstanceSid, int exposureDataSourceSid, int exposureSetSid)
    {
            
        ExposureManagementServiceClient client = new ExposureManagementServiceClient();
        GetContractsRequest request = new GetContractsRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.ExposureDataSourceSid = exposureDataSourceSid;
        request.ExposureSetSid = exposureSetSid;
        //request.ExposureViewSid = exposureViewSid;
            
        int page = 1; int pageSize = 20;
        request.PagingInfo = new PagingInfo { PageNumber = page, PageSize = pageSize };
        GetContractsResponse response = client.GetContracts(request);
            
        if ((response.Status.Code == StatusCode.Success))
        {
            foreach (Contract contract in response.Contracts)
            {
                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