Touchstone 11.0 API Reference
GetLocation Method
Example 


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

Parameters

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

Return Value

A GetLocationResponse containing the Touchstone Location that you have requested, including any associated Location Terms.
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 Location SID to pass into this method, call the GetLocations() method.

Example
The following example shows how to retrieve a Touchstone Location using the GetLocation() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetGetLocationRequest
{
    private static void GetLocation(int businessUnitSid, int sqlInstanceSid, int dataSourceSid, int expoureSetSid, int locationSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        GetLocationRequest request = new GetLocationRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.LocationSid = locationSid;
            
        request.ExposureSet = new ExposureSet
        {
            Sid = expoureSetSid,
            DataSourceSid = dataSourceSid
        };
        GetLocationResponse response = exposureManagementClient.GetLocation(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Location location = response.Location;
            Console.WriteLine("------------------   Location SID: " + location.Sid + "  -----------------------");
            Console.WriteLine("ID: " + location.ID);
            Console.WriteLine("Name: " + location.Name);
            Console.WriteLine("Address: " + location.Address);
            Console.WriteLine("Total Replacement Value: " + location.TotalReplacementValue);
            foreach (LocationTerm term in location.Terms)
            {
                Console.WriteLine("            -------------                    ");
                Console.WriteLine("Term SID: " + term.Sid);
                Console.WriteLine("Term Perils: " + term.Perils);
            
                //Do something similar for each type of Deductible.
                if (term.Deductible.GetType() == typeof(LocationPercentOfLossDeductible))
                {
                    Console.WriteLine("Term Building Deductible: " + (term.Deductible as LocationPercentOfLossDeductible).DeductibleBuilding);
                    Console.WriteLine("Term Contents Deductible: " + (term.Deductible as LocationPercentOfLossDeductible).DeductibleContents);
                    Console.WriteLine("Term Business Interruption Deductible: " + (term.Deductible as LocationPercentOfLossDeductible).DeductibleBusinessInterruption);
                }
                else if (term.Deductible.GetType() == typeof(LocationAnnualAmountDeductible))
                {
                    Console.WriteLine("Term Hurricane Deductible: " + (term.Deductible as LocationAnnualAmountDeductible).DeductibleHurricane);
                    Console.WriteLine("Term Other Perils Deductible: " + (term.Deductible as LocationAnnualAmountDeductible).DeductibleOtherPerils);
                }
            
            }
        }
    }
}
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