Exemple #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);
     }
 }
Exemple #2
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);
                }
            }
        }
Exemple #3
0
 protected void Page_Load(Object o, EventArgs e)
 {
     MapCoordinatePickerUC.SetPoint(place.Latitude, place.Longitude);
 }