Touchstone 11.0 API Reference
CreateLocation Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : CreateLocation Method
Contains a CreateLocationRequest that identifies the properties of the Location that you want to create, along with the associated Touchstone-generated Contract Sequential Identifier (SID), Business Unit SID, and SQL Instance SID.
Creates a new Touchstone® Location. This Location can include Location Terms.
Syntax
Public Function CreateLocation( _
   ByVal request As CreateLocationRequest _
) As CreateLocationResponse
Dim instance As ExposureManagementServiceClient
Dim request As CreateLocationRequest
Dim value As CreateLocationResponse
 
value = instance.CreateLocation(request)

Parameters

request
Contains a CreateLocationRequest that identifies the properties of the Location that you want to create, along with the associated Touchstone-generated Contract Sequential Identifier (SID), Business Unit SID, and SQL Instance SID.

Return Value

A CreateLocationResponse containing the Location SID, which uniquely identifies the Location that you have created.
Remarks
If you do not specify a value for a given location field, Touchstone saves a NULL value for the field.

To associate Locations and Sublimits using the Sublimit Area property, create the desired Layers and Sublimits first and include the desired Sublimit Area value when creating the Sublimit(s). Then, create the corresponding Locations, supplying the appropriate Sublimit Area value when creating these Locations.

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 Contract SID to pass into this method, call the GetContracts() method.

Example
The following example shows how to create a Touchstone Location using the CreateLocation() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
using System.Collections.Generic;
            
class SnippetCreateLocationRequest
{
    private static void CreateLocation(int businessUnitSid, int sqlInstanceSid, string locationId, int contractSid, int exposureSetSid, int dataSourceSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        CreateLocationRequest request = new CreateLocationRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.ContractSid = contractSid;
        request.Location = new Location
        {
            ID = locationId,
            Address = "131 Dartmouth Street",
            AreaName = "MA",
            City = "Boston",
            PostalCode = "02116",
            CountryName = "US",
            CountryCode = "US",
            Currency = "USD",
            InceptionDate = new DateTime(2014, 1, 1),
            ExpirationDate = new DateTime(2014, 12, 31),
            ExposureSet = new ExposureSet
            {
                Sid = exposureSetSid,
                DataSourceSid = dataSourceSid
            },
            ConstructionCode = 101,
            OccupancyCode = 300,
            YearBuilt = 2012,
            Stories = 7,
            GrossArea = 10000,
            ReplacementValueA = 400000000,
            ReplacementValueB = 40000000,
            ReplacementValueC = 4000000,
            ReplacementValueD = 4000,
            
            LocationFeature = new LocationFeature
            {
                Wall = Wall.CastInPlaceConcrete,
                RoofYearBuilt = 2012
            },
            
            Terms = new List<LocationTerm>(){
                    new LocationTerm(){
                         Perils = PerilSetCode.TropicalCyclone | PerilSetCode.Earthquake,
                         Participation = 1,
                         CededParticipation = 1,
                         Deductible = new LocationCoverageDeductible{ 
                            DeductibleBuilding = 100,
                            DeductibleBusinessInterruption = 21000,
                            DeductibleContents = 22000,
                            DeductibleOther = 5000
                         },
                         Limit = new LocationCoverageLimit{
                            LimitBuilding = 22000,
                            LimitBusinessInterruption = 32000,
                            LimitContents = 42000,
                         }
                    }
                }
            
        };
            
        CreateLocationResponse response = exposureManagementClient.CreateLocation(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Console.WriteLine(" Location: " + locationId + " created with SID: " + response.LocationSid);
        }
    }
}
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