public void GetAddressNotes(string routeId, int routeDestinationId)
        {
            // Create the manager with the api key
              Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

              NoteParameters noteParameters = new NoteParameters()
              {
            RouteId = routeId,
            AddressId = routeDestinationId
              };

              // Run the query
              string errorString;
              AddressNote[] notes = route4Me.GetAddressNotes(noteParameters, out errorString);

              Console.WriteLine("");

              if (notes != null)
              {
            Console.WriteLine("GetAddressNotes executed successfully, {0} notes returned", notes.Length);
            Console.WriteLine("");
              }
              else
              {
            Console.WriteLine("GetAddressNotes error: {0}", errorString);
            Console.WriteLine("");
              }
        }
Ejemplo n.º 2
0
        public void AddAddressNote(string routeId, int addressId)
        {
            // Create the manager with the api key
              Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

              NoteParameters noteParameters = new NoteParameters()
              {
            RouteId = routeId,
            AddressId = addressId,
            Latitude = 33.132675170898,
            Longitude = -83.244743347168,
            DeviceType = DeviceType.Web.Description(),
            ActivityType = StatusUpdateType.DropOff.Description()
              };

              // Run the query
              string errorString;
              string contents = "Test Note Contents " + DateTime.Now.ToString();
              AddressNote note = route4Me.AddAddressNote(noteParameters, contents, out errorString);

              Console.WriteLine("");

              if (note != null)
              {
            Console.WriteLine("AddAddressNote executed successfully");

            Console.WriteLine("Note ID: {0}", note.NoteId);
              }
              else
              {
            Console.WriteLine("AddAddressNote error: {0}", errorString);
              }
        }
        public void AddAddressNoteWithFile(string routeId, int addressId)
        {
            // Create the manager with the api key
              Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

              NoteParameters noteParameters = new NoteParameters()
              {
            RouteId = routeId,
            AddressId = addressId,
            Latitude = 33.132675170898,
            Longitude = -83.244743347168,
            DeviceType = DeviceType.Web.Description(),
            ActivityType = StatusUpdateType.DropOff.Description()
              };

              string tempFilePath = null;
              using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Route4MeSDKTest.Resources.test.png"))
              {
            var tempFiles = new TempFileCollection();
            {
              tempFilePath = tempFiles.AddExtension("png");
              System.Console.WriteLine(tempFilePath);
              using (Stream fileStream = File.OpenWrite(tempFilePath))
              {
            stream.CopyTo(fileStream);
              }
            }
              }

              // Run the query
              string errorString;
              string contents = "Test Note Contents with Attachment " + DateTime.Now.ToString();
              AddressNote note = route4Me.AddAddressNote(noteParameters, contents, tempFilePath, out errorString);

              Console.WriteLine("");

              if (note != null)
              {
            Console.WriteLine("AddAddressNoteWithFile executed successfully");

            Console.WriteLine("Note ID: {0}", note.NoteId);
              }
              else
              {
            Console.WriteLine("AddAddressNoteWithFile error: {0}", errorString);
              }
        }