Beispiel #1
0
 protected void ContinueToMap_Click(Object o, EventArgs e)
 {
     if (PeterBlum.VAM.Globals.Page.IsValid)
     {
         AreaTag tag = cfController.GetAreaTagForCountry(NationalityDDLUC.SelectedNation);
         MapCoordinatePickerUC.SetMapStartPosition(tag.Latitude, tag.Longitude, tag.DefaultVirtualEarthZoom);
         AddPlaceMV.SetActiveView(VIEWPlotOnMap);
     }
 }
        protected void GoToAreaTags_Click(Object sender, EventArgs e)
        {
            Place place = cfController.GetPlace(NewPlaceID);

            List <AreaTag> tagsForCountry = cfController.GetAllAreaTagsInCountry((Nation)place.CountryID);

            if (tagsForCountry.Count == 1)
            {
                GoToPlacePage_Click(sender, e);
            }                                                                  // no point in screen if no tags available to add

            AddPlaceMV.SetActiveView(VIEWAddAreaTags);
            AreaTxB.Country = (Nation)place.CountryID;

            BindAreaTags();
        }
Beispiel #3
0
        protected void CreatePlace_Click(Object sender, EventArgs e)
        {
            if (PeterBlum.VAM.Globals.Page.IsValid)
            {
                string friendlyUrlName     = NameTxB.Text.Trim().Replace(" ", "-").ToLower();
                string friendlyUrlLocation = NationalityDDLUC.SelectedNation.GetCountryFriendlyUrl();

                Place existingPlace = cfController.GetPlace(friendlyUrlLocation, friendlyUrlName);

                if (existingPlace != null)
                {
                    //-- Incase user clicks button twice this is to stop an exception
                    RedirectTo <ModerateController>(c => c.EditIndoorPlace(existingPlace.ID));
                }
                else
                {
                    string address = AddressTxB.Text.Replace("'", ""); // Stop virtual earth javascript from crashing

                    Place place = cfController.AddIndoorPlace(new Place
                    {
                        CreatedByUserID     = UserID,
                        CountryID           = (short)NationalityDDLUC.SelectedNation,
                        Description         = "",
                        FriendlyUrlLocation = friendlyUrlLocation,
                        IsIndoor            = true,
                        Latitude            = MapCoordinatePickerUC.Latitude,
                        Longitude           = MapCoordinatePickerUC.Longitude,
                        Name      = NameTxB.Text.Trim(),
                        ShortName = ShortNameTxB.Text.Trim(),
                    }, address, "", WebsiteTxB.Text, BoulderCB.Checked, LeadClimbCB.Checked,
                                                              TopRopeCB.Checked);

                    PlaceIDHD.Value = place.ID.ToString();

                    if (IsRegularRB.Checked)
                    {
                        cfController.SavePlaceUserClimbsAt(UserID, NewPlaceID);
                    }

                    //-- Continue to map
                    AreaTag tag = cfController.GetAreaTagForCountry(NationalityDDLUC.SelectedNation);
                    MapCoordinatePickerUC.SetMapStartPosition(tag.Latitude, tag.Longitude, tag.DefaultVirtualEarthZoom);
                    AddPlaceMV.SetActiveView(VIEWPlotOnMap);
                }
            }
        }
 protected void ContinueToDetails_Click(Object o, EventArgs e)
 {
     AddPlaceMV.SetActiveView(VIEWAddDetails);
 }