/// <summary> /// Get Avoidance Zone /// </summary> /// <param name="territoryId"> Avoidance Zone Id </param> public void GetAvoidanceZone(string territoryId) { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); AvoidanceZoneQuery avoidanceZoneQuery = new AvoidanceZoneQuery() { TerritoryId = territoryId }; // Run the query string errorString; AvoidanceZone avoidanceZone = route4Me.GetAvoidanceZone(avoidanceZoneQuery, out errorString); Console.WriteLine(""); if (avoidanceZone != null) { Console.WriteLine("GetAvoidanceZone executed successfully"); Console.WriteLine("Territory ID: {0}", avoidanceZone.TerritoryId); } else { Console.WriteLine("GetAvoidanceZone error: {0}", errorString); } }
/// <summary> /// Get Avoidance Zone /// </summary> /// <param name="territoryId"> Avoidance Zone Id </param> public void GetAvoidanceZone(string territoryId) { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); AvoidanceZoneQuery avoidanceZoneQuery = new AvoidanceZoneQuery() { TerritoryId = territoryId }; // Run the query string errorString; AvoidanceZone avoidanceZone = route4Me.GetAvoidanceZone(avoidanceZoneQuery, out errorString); Console.WriteLine(""); if (avoidanceZone != null) { Console.WriteLine("GetAvoidanceZone executed successfully"); Console.WriteLine("Territory ID: {0}", avoidanceZone.TerritoryId); } else { Console.WriteLine("GetAvoidanceZone error: {0}", errorString); } }
/// <summary> /// Get Avoidance Zone /// </summary> /// <param name="territoryId"> Avoidance Zone Id </param> public void GetAvoidanceZone(string territoryId = null) { // Create the manager with the api key var route4Me = new Route4MeManager(ActualApiKey); bool isInnerExample = territoryId == null ? true : false; if (isInnerExample) { CreateAvoidanceZone(); territoryId = this.avoidanceZone.TerritoryId; } var avoidanceZoneQuery = new AvoidanceZoneQuery() { TerritoryId = territoryId }; // Run the query AvoidanceZone avoidanceZone = route4Me.GetAvoidanceZone( avoidanceZoneQuery, out string errorString); PrintExampleAvoidanceZone(avoidanceZone, errorString); if (isInnerExample) { RemoveAvidanceZone(territoryId); } }