Retrieves a list of all existing Touchstone®
Contracts for a given
Exposure View within a specific
Business Unit and
SQL Server Instance.
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.
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(" ---------------------- ");
}
}
}
}
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