Ejemplo n.º 1
0
        public Place AddIndoorPlace(Place indoorPlace, string address, string contactNumber, string website,
                                    bool hasBoulder, bool hasLead, bool hasTopRope)
        {
            indoorPlace.MessageBoardID  = InsertNewMessageBoard();
            indoorPlace.FriendlyUrlName = indoorPlace.Name.GetFriendlyUrlName();

            PlaceDA placeDA = new PlaceDA();

            Place place = placeDA.Insert(indoorPlace);

            IndoorPlaceDA indoorPlaceDA = new IndoorPlaceDA();

            indoorPlaceDA.Insert(new IndoorPlace {
                ID         = place.ID, Address = address, MapAddress = address, Contact = contactNumber,
                HasBoulder = hasBoulder, HasLead = hasLead, HasTopRope = hasTopRope, LogoImageFile = "Default.jpg", Latitude = 0, Longitude = 0, Website = website
            });

            AddPlaceAreaTag(place.ID, GetAreaTagForCountry((Nation)place.CountryID).ID);

            //-- Send app notification email
            CFLogger.RecordModerateAddPlace(CurrentClimber.ID, indoorPlace.Name, indoorPlace.CountryID, indoorPlace.ClimbfindUrl);

            //-- Refresh the cache
            CFDataCache.CacheAllIndoorPlaces();

            return(place);
        }
Ejemplo n.º 2
0
        public void SaveIndoorPlaceLogo(IndoorPlace place, string imageFileName, byte[] imageBytes)
        {
            place.LogoImageFile = ImageManager.SaveIndoorPlaceLogo(imageFileName, imageBytes, place.ID, place.FriendlyUrlName);
            new IndoorPlaceDA().Update(place);

            Place basePlace = new PlaceDA().GetByID(place.ID);

            basePlace.PrimaryImageFile = place.LogoImageFile;
            new PlaceDA().Update(basePlace);

            //-- Refresh the cache
            CFDataCache.CacheAllIndoorPlaces();
        }
Ejemplo n.º 3
0
        public void DeleteIndoorPlaceCompletely(int ID)
        {
            if (!IsAdmin)
            {
                throw new Exception("Only admin can delete places");
            }
            Place place = new PlaceDA().GetByID(ID);

            new IndoorPlaceDA().Delete(ID);
            new PlaceDA().Delete(ID);

            CFDataCache.CacheAllIndoorPlaces();

            CFLogger.RecordModerateDeletePlace(CurrentClimber.ID, place.Name, place.CountryID, place.ClimbfindUrl);
        }