Beispiel #1
0
        public string RenderHTMLPostTopDetails()
        {
            Place place = CFDataCache.GetPlace(PlaceID);

            return(string.Format(@"<label>{0}</label><br /><i>climbing</i> {1} @ <img src='{2}' /><a href='{3}'>{4}</a>",
                                 TagString, ClimbingDateTime.ToCFDateString(), place.FlagImageUrl2, place.ClimbfindUrl, place.Name));
        }
Beispiel #2
0
        public string RenderHTMLPostTopDetailsForPartnerPage()
        {
            Place place = CFDataCache.GetPlace(PlaceID);

            return(string.Format(@"<label>{0}</label><br /><i>climbing</i> {1}",
                                 TagString, ClimbingDateTime.ToCFDateString()));
        }
        public string RenderHTMLPostTopDetails()
        {
            Place place = CFDataCache.GetPlace(PlaceID);

            return(string.Format(@"<br /><b>{0}</b><br /><i>taken</i> @ <img src='{1}' /><a href='{2}'>{3}</a>",
                                 PlaceMedia.Name, place.FlagImageUrl2, place.ClimbfindUrl, place.Name));
        }
Beispiel #4
0
        protected void Page_Init(Object s, EventArgs e)
        {
            mapPlace  = CFDataCache.GetPlace(ViewData.Model.ID);
            FeedPosts = cfController.GetPlacesLatestFeedActivity(place.ID);
            if (!UserLoggedIn)
            {
                UserClimbsHere = false;
            }
            else
            {
                UserClimbsHere = cfController.UserClimbAtPlace(UserID, place.ID);
            }

            Crags          = (from c in cfController.GetCragsAtPlace(place.ID) orderby c.Name select c).ToList();
            AuthoritySites = cfController.GetOutdoorPlacesAuthoriySites(place.ID);

            //-- Get contributing users
            if (place.DescriptionByUserID != null)
            {
                descriptionLastUpdatedByUser = CFDataCache.GetClimberFromCache(place.DescriptionByUserID.Value);
            }
            if (place.DescriptionImageFileByUserID != null)
            {
                descriptionImageFile1ByUser = CFDataCache.GetClimberFromCache(place.DescriptionImageFileByUserID.Value);
            }
            if (place.DescriptionImageFile2 != null)
            {
                descriptionImageFile2ByUser = CFDataCache.GetClimberFromCache(place.DescriptionImageFile2ByUserID.Value);
            }
            if (place.DescriptionImageFile3 != null)
            {
                descriptionImageFile3ByUser = CFDataCache.GetClimberFromCache(place.DescriptionImageFile3ByUserID.Value);
            }
        }
        public FeedClimbingPost SaveFeedIntroductionPost(FeedClimbingPost newPost)
        {
            //-- Add that place to user's profile
            List <int> placeIDs = (from c in GetPlacesUserClimbs(newPost.UserID) select c.ID).ToList();

            if (!placeIDs.Contains(newPost.PlaceID))
            {
                SavePlaceUserClimbsAt(newPost.UserID, newPost.PlaceID);
            }

            //-- Save the post
            newPost.PostedDateTime   = DateTime.Now;
            newPost.ClimbingDateTime = DateTime.Now;
            newPost.TagID            = 52;
            FeedClimbingPost post = new FeedClimbingPostDA().Insert(newPost);

            //-- Send off notifications
            List <ClimberProfile> usersSubscribedToPlace
                = new ClimberProfileDA().GetPartnerEmailSubscribedUsers(newPost.PlaceID);

            Place          place  = CFDataCache.GetPlace(newPost.PlaceID);
            ClimberProfile poster = CFDataCache.GetClimberFromCache(newPost.UserID);

            foreach (ClimberProfile cp in usersSubscribedToPlace)
            {
                MailMan.SendFeedPostIntroductionNotificationEmail(cp, poster, post, place.Name);
            }

            //-- Subscribe them to this place too
            SubscribeToPartnerCallsByEmail(newPost.UserID, place.ID);

            return(post);
        }
 protected void Page_Init(Object s, EventArgs e)
 {
     mapPlace  = CFDataCache.GetPlace(ViewData.Model.ID);
     FeedPosts = cfController.GetPlacesLatestFeedActivity(place.ID);
     if (!UserLoggedIn)
     {
         UserClimbsHere = false;
     }
     else
     {
         UserClimbsHere = cfController.UserClimbAtPlace(UserID, place.ID);
     }
 }
Beispiel #7
0
        private void SendPartnerCallNotificationEmails(PartnerCall call, List <int> placeIDs)
        {
            Dictionary <ClimberProfile, int> usersSubscribedToAtLeastOnePlace
                = new ClimberProfileDA().GetPartnerCallEmailSubscribedUsers(placeIDs);

            foreach (ClimberProfile cp in usersSubscribedToAtLeastOnePlace.Keys)
            {
                if (cp.Email != User.Name)
                {
                    Place place = CFDataCache.GetPlace(usersSubscribedToAtLeastOnePlace[cp]);
                    MailMan.SendPartnerCallNotificationEmail(cp, call, place.Name, call.PlacesNamesString, cp.Email);
                }
            }
        }
        public static SyndicationItem GetSyndicationItem(this FeedClimbingPost p)
        {
            Place  place     = CFDataCache.GetPlace(p.PlaceID);
            string placeLink = string.Format("{0}{1}", CFSettings.WebAddress, place.ClimbfindUrl);

            return(new SyndicationItem(
                       string.Format("{0} wants to climb {1} @ {2}, {3}", p.User.FullName, p.ClimbingDateTime.ToString("dd MMM"),
                                     place.ShortName, FlagList.GetCountryName((Nation)place.CountryID), placeLink),
                       string.Format("{0}", p.Message),
                       new Uri(placeLink),
                       string.Format("ClimbingPost[{0}]", p.ID),
                       p.PostedDateTime)
            {
                PublishDate = p.PostedDateTime
            });
        }
        public void Page_Load(Object o, EventArgs e)
        {
            Settings = new CFController().GetUsersFeedViewSettings(UserID);

            if ((FeedChannel)Settings.CurrentChannelType == FeedChannel.Area)
            {
                CurrentCountry = (Nation)CFDataCache.GetAreaTag(Settings.AreaID.Value).CountryID;
            }
            else if ((FeedChannel)Settings.CurrentChannelType == FeedChannel.Place)
            {
                CurrentCountry = (Nation)CFDataCache.GetPlace(Settings.PlaceID.Value).CountryID;
            }
            else
            {
                CurrentCountry = Nation.Afghanistan;
            }
        }
        public FeedClimbingPost SaveFeedPost(FeedClimbingPost newPost)
        {
            newPost.PostedDateTime = DateTime.Now;
            FeedClimbingPost post = new FeedClimbingPostDA().Insert(newPost);

            List <ClimberProfile> usersSubscribedToPlace
                = new ClimberProfileDA().GetPartnerEmailSubscribedUsers(newPost.PlaceID);

            Place          place  = CFDataCache.GetPlace(newPost.PlaceID);
            ClimberProfile poster = CFDataCache.GetClimberFromCache(newPost.UserID);

            foreach (ClimberProfile cp in usersSubscribedToPlace)
            {
                MailMan.SendPartnerFeedPostNotificationEmail(cp, poster, post, place.Name);
            }

            return(post);
        }
        /// <summary>
        /// Place stuff
        /// </summary>
        ///

        public Place GetPlace(int id)
        {
            return(CFDataCache.GetPlace(id));
        }