GetValues() public method

Gets the values.
public GetValues ( Rock location ) : void
location Rock The location.
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the _btnSelect control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void _btnSelect_Click(object sender, EventArgs e)
        {
            var editedLocation = new Location();

            _acAddress.GetValues(editedLocation);

            var locationService = new LocationService(new RockContext());

            string validationMessage;

            var isValid = locationService.ValidateAddressRequirements(editedLocation, out validationMessage);

            if (!isValid)
            {
                _addressRequirementsValidator.ErrorMessage = validationMessage;
                _addressRequirementsValidator.IsValid      = false;

                return;
            }

            var location = locationService.Get(editedLocation.Street1, editedLocation.Street2, editedLocation.City, editedLocation.State, editedLocation.County, editedLocation.PostalCode, editedLocation.Country, null);

            this.Location = location;

            _btnPickerLabel.InnerHtml = string.Format("<i class='fa fa-map-marker-alt'></i>{0}<b class='fa fa-caret-down pull-right'></b>", this.AddressSummaryText);

            ShowDropDown = false;

            if (this.SelectGeography != null)
            {
                SelectGeography(sender, e);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the _btnSelect control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void _btnSelect_Click(object sender, EventArgs e)
        {
            var editedLocation = new Location();

            _acAddress.GetValues(editedLocation);

            var locationService = new LocationService(new RockContext());

            var location = locationService.Get(editedLocation.Street1, editedLocation.Street2, editedLocation.City, editedLocation.State, editedLocation.PostalCode, editedLocation.Country);

            this.Location = location;

            _btnPickerLabel.InnerHtml = string.Format("<i class='fa fa-map-marker-alt'></i>{0}<b class='fa fa-caret-down pull-right'></b>", this.AddressSummaryText);

            ShowDropDown = false;

            if (this.SelectGeography != null)
            {
                SelectGeography(sender, e);
            }
        }