コード例 #1
0
        private DataSet FindAddressByCompanyAndTown(string companyName, string townName)
        {
            PostCodeAnywhere.LookupUK lookUp = new PostCodeAnywhere.LookupUK();

            DataSet ds = null;

            ds = lookUp.ByOrganisation_DataSet(companyName, townName, false, accountCode, licenseKey, "");

            return(ds);
        }
コード例 #2
0
        void lstAddress_SelectedIndexChanged(object sender, EventArgs e)
        {
            PostCodeAnywhere.LookupUK       lookUp  = new PostCodeAnywhere.LookupUK();
            PostCodeAnywhere.AddressResults address = null;

            address = lookUp.FetchAddress(lstAddress.SelectedValue, PostCodeAnywhere.enLanguage.enLanguageEnglish, PostCodeAnywhere.enContentType.enContentGeographicAddress, accountCode, licenseKey, "");

            DisplayAddress(address);
            pnlAddressList.Visible = false;
            pnlAddress.Visible     = true;
        }
コード例 #3
0
        private DataSet FindAddressNoPostCodeByStreet(string streetName, string townName)
        {
            DataSet results = new DataSet();

            PostCodeAnywhere.LookupUK lookUp = new PostCodeAnywhere.LookupUK();

            PostCodeAnywhere.InterimResults properties = lookUp.ByStreet(streetName, townName, false, accountCode, licenseKey, "");

            if (properties.Results.Length > 0)
            {
                results = lookUp.ByStreetKey_DataSet(properties.Results[0].Id, accountCode, licenseKey, "");
            }

            return(results);
        }
コード例 #4
0
        private void DisplayAddress()
        {
            PostCodeAnywhere.LookupUK       lookUp  = new PostCodeAnywhere.LookupUK();
            PostCodeAnywhere.AddressResults address = null;

            address = lookUp.FetchAddress(lstAddress.SelectedValue, PostCodeAnywhere.enLanguage.enLanguageEnglish, PostCodeAnywhere.enContentType.enContentGeographicAddress, accountCode, licenseKey, "");

            string addressText = string.Empty;

            addressText = address.Results[0].OrganisationName;
            addressText = AddAddressLine(address.Results[0].Line1, addressText);
            addressText = AddAddressLine(address.Results[0].Line2, addressText);
            addressText = AddAddressLine(address.Results[0].Line3, addressText);
            addressText = AddAddressLine(address.Results[0].Line4, addressText);
            addressText = AddAddressLine(address.Results[0].Line5, addressText);
            addressText = AddAddressLine(address.Results[0].PostTown, addressText);
            addressText = AddAddressLine(address.Results[0].County, addressText);
            addressText = AddAddressLine(address.Results[0].Postcode, addressText);
            SetAddressValues(address.Results[0]);
            lblAddress.Text = addressText;

            // Display the points that share this points long/lat.
            Facade.IPoint facPoint         = new Facade.Point();
            DataSet       dsMatchingPoints = facPoint.GetAllForLongLat(address.Results[0].GeographicData.WGS84Longitude, address.Results[0].GeographicData.WGS84Latitude);

            if (dsMatchingPoints.Tables[0].Rows.Count > 0)
            {
                repExistingAddresses.DataSource = dsMatchingPoints;
                repExistingAddresses.DataBind();
                pnlExistingAddresses.Visible = true;
                pnlHideFinishButton.Visible  = true;
            }
            else
            {
                pnlExistingAddresses.Visible = false;
                pnlHideFinishButton.Visible  = false;
            }

            setPanel(ePanel.Address);

            lblGridReference.Text = address.Results[0].GeographicData.WGS84Latitude.ToString() + ", " + address.Results[0].GeographicData.WGS84Longitude.ToString();
        }
コード例 #5
0
        private DataSet FindAddressByPostCode(int attempt, string postcode)
        {
            PostCodeAnywhere.LookupUK lookUp = new PostCodeAnywhere.LookupUK();

            DataSet ds = null;

            try
            {
                ds = lookUp.ByPostcode_DataSet(postcode, accountCode, licenseKey, "");
                return(ds);
            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (attempt < 3)
                {
                    return(FindAddressByPostCode(attempt++, postcode));
                }
                else
                {
                    throw (ex);
                }
            }
        }