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);
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        public void ReplyToPartnerCall(Guid partnerCallID, Guid replyingUserID, string message)
        {
            PartnerCall call = new PartnerCallDA().GetByID(partnerCallID);

            if (call.CreatorUserID == replyingUserID)
            {
                throw new Exception(string.Format("You cannot reply to your own partner call. call[{0}]", call.ID));
            }

            PartnerCallReply reply = new PartnerCallReplyDA().Insert(new PartnerCallReply
            {
                ID             = Guid.NewGuid(),
                ReplyDateTime  = DateTime.Now,
                ReplyingUserID = replyingUserID,
                PartnerCallID  = partnerCallID,
                Message        = message
            });

            ClimberProfile poster  = CFDataCache.GetClimberFromCache(call.ClimberProfileID);
            ClimberProfile replyer = CFDataCache.GetClimberFromCache(replyingUserID);

            MailMan.SendReplyToPartnerCall(call, reply, replyer, replyer.Email, poster.Email);

            CFLogger.RecordPartnerCallReply(replyingUserID, partnerCallID);
        }
        public FeedPostComment SaveFeedPostComment(FeedPostComment comment)
        {
            comment.PostedDateTime = DateTime.Now;
            FeedPostComment  newComment = new FeedPostCommentDA().Insert(comment);
            FeedClimbingPost post       = new FeedClimbingPostDA().GetByID(comment.FeedPostID);

            //-- Send notification to the poster
            FeedSettings postersFeedSettings = GetUsersFeedViewSettings(post.UserID);

            if (postersFeedSettings.NotifyOnPostComment && comment.UserID != post.UserID)
            {
                MailMan.SendCommentOnMyFeedPostNotification(post.ID, comment.User, post.User, comment.Message);
            }

            List <Guid> uniqueCommentingUserIDs = (from c in post.Comments where c.UserID != post.UserID select c.UserID).Distinct().ToList();

            //-- Send notifications to other commentors
            foreach (Guid userID in uniqueCommentingUserIDs)
            {
                FeedSettings commentorsFeedSettings = GetUsersFeedViewSettings(userID);
                if (commentorsFeedSettings.NotifyOnPostsICommentedOn && comment.UserID != userID)
                {
                    MailMan.SendCommentOnAFeedPostICommentedOnNotification(post.ID, comment.User, post.User,
                                                                           CFDataCache.GetClimberFromCache(userID), comment.Message);
                }
            }

            return(newComment);
        }
        public void SendClimberWatchRequest(Guid watchedUserID, Guid watchingUserID)
        {
            FeedClimberChannelRequest watchedClimberEntry = new FeedClimberChannelRequestDA().Insert(
                new FeedClimberChannelRequest()
            {
                WatchedUserID  = watchedUserID,
                WatchingUserID = watchingUserID, RequestedDateTime = DateTime.Now
            });

            MailMan.SendWatchRequestEmail(watchedClimberEntry.ID, CFDataCache.GetClimberFromCache(watchingUserID),
                                          CFDataCache.GetClimberFromCache(watchedUserID));
        }
        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);
        }
Exemple #7
0
        //public List<OutdoorCrag> Crags { get { return ; } }

        protected void Page_Init(Object s, EventArgs e)
        {
            place = cfController.GetOutdoorPlace(Crag.PlaceID);
            MessageBoardUC.RenderMessageBoard(cfController.GetMessageBoard(Crag.MessageBoardID));

            ////-- Get contributing users
            if (Crag.DescriptionImageFile1ByUserID != null)
            {
                descriptionImageFile1ByUser = CFDataCache.GetClimberFromCache(Crag.DescriptionImageFile1ByUserID.Value);
            }
            if (Crag.DescriptionImageFile2ByUserID != null)
            {
                descriptionImageFile2ByUser = CFDataCache.GetClimberFromCache(Crag.DescriptionImageFile2ByUserID.Value);
            }
            if (Crag.DescriptionImageFile3ByUserID != null)
            {
                descriptionImageFile3ByUser = CFDataCache.GetClimberFromCache(Crag.DescriptionImageFile3ByUserID.Value);
            }

            OtherCrags = (from c in cfController.GetCragsAtPlace(place.ID) where c.ID != Crag.ID select c).ToList();
        }
 protected ClimberProfile GetC(FeedClimberChannelRequest c)
 {
     return(CFDataCache.GetClimberFromCache(c.WatchedUserID));
 }
Exemple #9
0
 protected string GetUsersPic(Guid userID)
 {
     return(CFDataCache.GetClimberFromCache(userID).ProfilePictureUrlMini);
 }
Exemple #10
0
 protected string GetUsersFullName(Guid userID)
 {
     return(CFDataCache.GetClimberFromCache(userID).FullName);
 }
 protected string GetClimberName(Guid id)
 {
     return(CFDataCache.GetClimberFromCache(id).NickName);
 }
Exemple #12
0
 public ClimberProfile GetProfile(Guid userID)
 {
     return(CFDataCache.GetClimberFromCache(userID));
 }