protected void DisplayAddress(PostCodeAnywhere.AddressResults address)
        {
            txtAddressLine1.Text = address.Results[0].Line1;
            txtAddressLine2.Text = address.Results[0].Line2;
            txtAddressLine3.Text = address.Results[0].Line3;
            txtPostTown.Text     = address.Results[0].PostTown;
            txtPostCode.Text     = address.Results[0].Postcode;
            txtCounty.Text       = address.Results[0].County;
            txtLatitude.Text     = address.Results[0].GeographicData.WGS84Latitude.ToString();
            txtLongitude.Text    = address.Results[0].GeographicData.WGS84Longitude.ToString();

            txtLocationName.Text = m_organisationName + " - " + txtPostTown.Text;

            this.hdnSetPointRadius.Value = "true";

            if (cboClosestTown.SelectedValue == "")
            {
                Facade.IPostTown  facPostTown = new Facade.Point();
                Entities.PostTown postTown    = facPostTown.GetPostTownForTownName(txtPostTown.Text);

                if (postTown != null)
                {
                    RadComboBoxItem item = new RadComboBoxItem(txtPostTown.Text, postTown.TownId.ToString());
                    cboClosestTown.Items.Add(item);
                    item.Selected = true;
                }
            }
        }
Example #2
0
        protected void DisplayAddress(PostCodeAnywhere.AddressResults address)
        {
            add1 = txtAddressLine1.Text = address.Results[0].Line1;

            txtAddressLine2.Text = address.Results[0].Line2;
            txtAddressLine3.Text = address.Results[0].Line3;
            txtPostTown.Text     = address.Results[0].PostTown;
            txtPostCode.Text     = address.Results[0].Postcode;
            txtCounty.Text       = address.Results[0].County;
            hidLat.Value         = address.Results[0].GeographicData.WGS84Latitude.ToString();
            hidLon.Value         = address.Results[0].GeographicData.WGS84Longitude.ToString();

            int countryID = Int32.Parse(cboCountry.SelectedValue);

            this.hdnSetPointRadius.Value = "true";

            if (cboClosestTown.SelectedValue == "")
            {
                cboClosestTown.Text = txtPostTown.Text;
                Facade.IPostTown  facPostTown = new Facade.Point();
                Entities.PostTown postTown    = facPostTown.GetPostTownForTownName(txtPostTown.Text, countryID);
                if (postTown != null)
                {
                    cboClosestTown.SelectedValue = postTown.TownId.ToString();
                    txtDescription.Text          = string.Concat(cboNewPointOwner.Text, " - ", cboClosestTown.Text);
                }

                cboClosestTown.Focus();
            }
        }
        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;
        }
Example #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();
        }