Touchstone 11.0 API Reference
GetUserLineOfBusinesses Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : GetUserLineOfBusinesses Method
Contains a GetUserLineOfBusinessesRequest that identifies the Business Unit SID, SQL Instance SID, ExposureDataSource SID, Exposure SID, and Exposure Type associated with the list of lines of business to retrieve.
Retrieves a list of all existing user-specified Lines of Business in a given Exposure.
Syntax
Public Function GetUserLineOfBusinesses( _
   ByVal request As GetUserLineOfBusinessesRequest _
) As GetUserLineOfBusinessesResponse
Dim instance As ExposureManagementServiceClient
Dim request As GetUserLineOfBusinessesRequest
Dim value As GetUserLineOfBusinessesResponse
 
value = instance.GetUserLineOfBusinesses(request)

Parameters

request
Contains a GetUserLineOfBusinessesRequest that identifies the Business Unit SID, SQL Instance SID, ExposureDataSource SID, Exposure SID, and Exposure Type associated with the list of lines of business to retrieve.

Return Value

A GetUserLineOfBusinessesResponse containing a list of user-specified Lines of Business 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.

To find the Data Source SID to pass into this method, call the GetDataSources() method.

To find the Exposure SID to pass into this method, call the GetExposureSets() method.

Example
The following example shows how to retrieve user-specified lines of business using the GetUserLineOfBusinesses() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetGetUserLineOfBusinessesRequest
{
    private static void GetUserLineOfBusinesses(int businessUnitSid, int sqlInstanceSid, int dataSourceSid, int targetSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        GetUserLineOfBusinessesRequest request = new GetUserLineOfBusinessesRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        //Set the required ExposureType property to "CON" for a Contract or "EVW" for an Exposure View
        request.ExposureType = "CON";
        //Set the required ExposureSid property
        request.ExposureSid = targetSid;
        //Set the ExposureDataSourceSid property (if the ExposureType is "CON")
        request.ExposureDataSourceSid = dataSourceSid;
        GetUserLineOfBusinessesResponse response = exposureManagementClient.GetUserLineOfBusinesses(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            foreach (string lob in response.LinesOfBusiness)
            {
                Console.WriteLine("Line of Business: " + lob);
            }
        }
    }
}
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