Touchstone Re 2023 API Reference
GetCompanies Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > CompanyManagementServiceClient Class : GetCompanies Method
Contains a GetCompaniesRequest that identifies the Business Unit Sequential Identifier (SID) and SQL Instance SID associated with the list of companies to retrieve.
Retrieves a list of the existing Touchstone Re Companies in a given Business Unit and SQL Server Instance.
Syntax
Public Function GetCompanies( _
   ByVal request As GetCompaniesRequest _
) As GetCompaniesResponse
Dim instance As CompanyManagementServiceClient
Dim request As GetCompaniesRequest
Dim value As GetCompaniesResponse
 
value = instance.GetCompanies(request)

Parameters

request
Contains a GetCompaniesRequest that identifies the Business Unit Sequential Identifier (SID) and SQL Instance SID associated with the list of companies to retrieve.

Return Value

A GetCompaniesResponse that contains a list of companies in the specified SQL server instance and business unit.
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.

A company is a container for exposure data, company loss files, reinsurance programs, and loss results that you want to keep together.

Example
The following example shows how to retrieve a list of existing Companies using the GetCompanies() method:
using AIR.Services.Common.Data;
using AIR.Services.Reinsurance.CompanyManagement.Api;
using System;
            
class SnippetGetCompanies
{
    private static void GetCompanies(int businessUnitSid, int sqlInstanceSid, string companyName)
    {
        CompanyManagementServiceClient client = new CompanyManagementServiceClient();
        GetCompaniesRequest request = new GetCompaniesRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        GetCompaniesResponse response = client.GetCompanies(request);
        if (response.Status.Code == StatusCode.Success)
        {
            foreach (var company in response.Companies)
            {
                Console.WriteLine("    *****    Company: " + company.CompanyName + "     *****    ");
                Console.WriteLine("Sid: " + company.Sid);
                Console.WriteLine("Exposure Sets Count: " + company.ExposureSetCount);
                Console.WriteLine("Latest Exposure Year: " + company.LatestExposureYear);
                Console.WriteLine("Loss Sets Count: " + company.CLFSetCount);
                Console.WriteLine("Programs Count: " + company.ReinsuranceProgramsCount);
            }
        }
    }
}
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

CompanyManagementServiceClient Class
CompanyManagementServiceClient Members