Click or drag to resize
OrgUnitService

[This is preliminary documentation and is subject to change.]

Overview of OrgUnitService web service

OrgUnitService diagram
Org Unit Service
GetOrgUnitsSearchByName method

Get a collection of org units whose name starts with 'searchName'

C#
public OrgUnitCollection GetOrgUnitsSearchByName(string config, Guid sessionGuid, string searchName)
GetOrgUnitsSearchByCode method

Get a collection of org units whose code starts with 'searchCode''

C#
public OrgUnitCollection GetOrgUnitsSearchByCode(string config, Guid sessionGuid, string searchCode)
GetOrgUnitsSearchByType method

Get a collection of org units whose type starts with 'searchType'

C#
public OrgUnitCollection GetOrgUnitsSearchByType(string config, Guid sessionGuid, string searchType)
Using OrgUnitService web service

In the following example we login and search for orgunits with type = sgh

Example of searching for orgunits with specified name

C#
// GetOrgUnitsSearchByType method example

string config = "GOP";                        // or "Projektdata" - name of configuration
string domain = "1351";                        // domain for the user we login with
string username = "Admin1351";                // username for the user we login with
string password = "secret";                    // password for the user we login with
string searchType = "sgh";                    // Orgunit type to search for

//first we login
LoginService loginService = new LoginService();
LogOnInfo logOnInfo = loginService.LogInPlainPassword(config, domain, username, password, false);

// then we call OrgunitService using lonOnInfo data to get orgunits matching search name
OrgunitService orgunitService = new OrgunitService();
OrgunitCollection orgunitCollection = orgunitService.GetOrgUnitsSearchByType(logOnInfo.ConfigName, logOnInfo.SessionGuid,searchType);