-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetAddressNotes.vb
43 lines (34 loc) · 1.66 KB
/
GetAddressNotes.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Imports Route4MeSDKLibrary.Route4MeSDK
Imports Route4MeSDKLibrary.Route4MeSDK.DataTypes
Imports Route4MeSDKLibrary.Route4MeSDK.QueryTypes
Namespace Route4MeSDKTest.Examples
Partial Public NotInheritable Class Route4MeExamples
''' <summary>
''' Get the address notes from the route address.
''' </summary>
''' <param name="routeId">Route ID</param>
''' <param name="routeDestinationId">Route destination ID</param>
Public Sub GetAddressNotes(Optional ByVal routeId As String = Nothing,
Optional ByVal routeDestinationId As Integer = Nothing)
' Create the manager with the api key
Dim route4Me = New Route4MeManager(ActualApiKey)
Dim isInnerExample As Boolean = If(routeId Is Nothing, True, False)
If isInnerExample Then CreateAddressNote(routeId, routeDestinationId)
Dim noteParameters = New NoteParameters() With {
.RouteId = routeId,
.AddressId = CInt(routeDestinationId)
}
Dim errorString As String = Nothing
Dim notes As AddressNote() = route4Me.GetAddressNotes(noteParameters, errorString)
Console.WriteLine("")
If notes IsNot Nothing Then
Console.WriteLine("GetAddressNotes executed successfully, {0} notes returned", notes.Length)
Console.WriteLine("")
Else
Console.WriteLine("GetAddressNotes error: {0}", errorString)
Console.WriteLine("")
End If
If isInnerExample Then RemoveTestOptimizations()
End Sub
End Class
End Namespace