Difference between revisions of "PAV I VB"

From CDYNE Wiki
Jump to navigation Jump to search
imported>Bdriggers
(Created page with "Button click handler: <code type=vb.net> Private Sub button1_Click(sender As Object, e As RoutedEventArgs) Dim request As New PavIntService.AddressInternationa...")
(No difference)

Revision as of 12:55, 22 May 2012

Button click handler:

Private Sub button1_Click(sender As Object, e As RoutedEventArgs)

       Dim request As New PavIntService.AddressInternationalRequest()

'Check each textbox and add corresponding field if the textbox is not empty Dim availableFields As New List(Of KeyValue)() AddKeyValue(availableFields, ORGANISATION, "ORGANISATION") AddKeyValue(availableFields, SUBBUILDING, "SUBBUILDING") AddKeyValue(availableFields, BUILDINGNAME, "BUILDINGNAME") AddKeyValue(availableFields, BUILDINGNUMBER, "BUILDINGNUMBER") AddKeyValue(availableFields, DEPSTREET, "DEPSTREET") AddKeyValue(availableFields, STREET, "STREET") AddKeyValue(availableFields, DEPLOCALITY, "DEPLOCALITY") AddKeyValue(availableFields, LOCALITY, "LOCALITY") AddKeyValue(availableFields, POSTTOWN, "POSTTOWN") AddKeyValue(availableFields, COUNTY, "COUNTY") AddKeyValue(availableFields, POSTCODE, "POSTCODE") AddKeyValue(availableFields, ADDR, "ADDR")

'Check what output fields are required on return Dim returnFields As New List(Of String)() GetReturnFields(returnFields)

'Convert to array and add to the request request.AddressFields = availableFields.ToArray() request.ReturnFields = returnFields.ToArray()

'Set License key request.LicenseKey = "ADD VALID LICENSE KEY HERE"

'Check if native output is requested request.ReturnNativeOutput = (chkNATIVE.IsChecked = True)

'Call the service Dim response As AddressInternationalResponse = service.VerifyAddressInternational(request)

'Update UI with the results UpdateUI(response.AddressFields) End Sub