Click or drag to resize

AdministrationClientCreateDistrict Method

Create a new District, from the submitted values.

A District is linked to a Region. The Region RSN can be fetched from the Web Service Method: SelectRegion.

Syntax
C#
public Result CreateDistrict(
	ManagementGroupRequestOfDistrict request
)

Parameters

request
Type: AdministrationServiceManagementGroupRequestOfDistrict

Return Value

Type: Result
Examples
C#
using (var svc = new AdministrationService.AdministrationClient())
{
  var request = new AdministrationService.ManagementGroupRequestOfDistrict();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var district = new AdministrationService.District();
  district.RSN = Guid.NewGuid();//Optional - will be generated if not supplied
  district.Region_RSN = new Guid("e035516c-f3eb-4d78-bd2d-af3211da509a");; //Required - RSN of region
  district.District_Name = "South"; //Required
  district.District_ID = "101"; //Required
  district.DisplayOrder = 1; //Required

  // add district to request
  request.Value = district;//Required

  AdministrationService.Result result = svc.CreateDistrict(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also