Exemplo n.º 1
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();
        }