示例#1
0
        /// <summary>
        /// Get destination from a route.
        /// </summary>
        /// <param name="routeId">Route ID</param>
        /// <param name="routeDestinationId">A route destination ID</param>
        public void GetAddress(string routeId = null, int?routeDestinationId = null)
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            if (routeId == null)
            {
                RunOptimizationSingleDriverRoute10Stops();
                OptimizationsToRemove = new List <string>()
                {
                    SD10Stops_optimization_problem_id
                };
            }

            var addressParameters = new AddressParameters()
            {
                RouteId            = (routeId == null) ? SD10Stops_route_id : routeId,
                RouteDestinationId = (routeDestinationId == null)
                                    ? (int)SD10Stops_route.Addresses[2].RouteDestinationId
                                    : (int)routeDestinationId,
                Notes = true
            };

            // Run the query
            Address destination = route4Me.GetAddress(addressParameters, out string errorString);

            PrintExampleDestination(destination, errorString);

            if (routeId == null)
            {
                RemoveTestOptimizations();
            }
        }
示例#2
0
        public void GetAddress(string routeId, int routeDestinationId)
        {
            // Create the manager with the api key
            Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

            AddressParameters addressParameters = new AddressParameters()
            {
                RouteId            = routeId,
                RouteDestinationId = routeDestinationId,
                Notes = true
            };

            // Run the query
            string  errorString;
            Address dataObject = route4Me.GetAddress(addressParameters, out errorString);

            Console.WriteLine("");

            if (dataObject != null)
            {
                Console.WriteLine("GetAddress executed successfully");
                Console.WriteLine("RouteId: {0}; RouteDestinationId: {1}", dataObject.RouteId, dataObject.RouteDestinationId);
                Console.WriteLine("");
            }
            else
            {
                Console.WriteLine("GetAddress error: {0}", errorString);
                Console.WriteLine("");
            }
        }
        public void GetAddress(string routeId, int routeDestinationId)
        {
            // Create the manager with the api key
              Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

              AddressParameters addressParameters = new AddressParameters()
              {
            RouteId = routeId,
            RouteDestinationId = routeDestinationId,
            Notes = true
              };

              // Run the query
              string errorString;
              Address dataObject = route4Me.GetAddress(addressParameters, out errorString);

              Console.WriteLine("");

              if (dataObject != null)
              {
            Console.WriteLine("GetAddress executed successfully");
            Console.WriteLine("RouteId: {0}; RouteDestinationId: {1}", dataObject.RouteId, dataObject.RouteDestinationId);
            Console.WriteLine("");
              }
              else
              {
            Console.WriteLine("GetAddress error: {0}", errorString);
            Console.WriteLine("");
              }
        }