Пример #1
0
 protected void btnAddressByZIP_Click(object sender, EventArgs e)
 {
     if (StaticUtilities.IsAppSettingTrue("AddressByZipEnabled"))
     {
         var addressByZip       = new AddressByZip(AddressByZipUrl, txtZIP.Text);
         var addressByZipResult = JsonConvert.DeserializeObject <AddressByZipResult>(addressByZip.Execute());
         lblStatus.Text = (addressByZipResult == null ? "Invalid" : "City: " + addressByZipResult.city + " State: " + addressByZipResult.state + " Country: " + addressByZipResult.country);
     }
 }
Пример #2
0
 protected void btn_Click(object sender, EventArgs e)
 {
     if (StaticUtilities.IsAppSettingTrue("ZipPlus4Enabled"))
     {
         VerifyAddressZipPlus4 = new VerifyAddressZipPlus4(ZipPlus4Url, ZipPlus4AuthId, ZipPlus4AuthToken, txtStreet.Text, txtCity.Text, txtState.Text, txtZIP.Text);
         string rawResponse = VerifyAddressZipPlus4.Execute();
         var    candidates  = JsonConvert.DeserializeObject <CandidateAddress[]>(rawResponse);
         lblStatus.Text = (candidates.Length == 0 ? "Invalid" : "Latitude: " + candidates[0].Metadata.Latitude + " Longitude: " + candidates[0].Metadata.Longitude);
     }
 }