Exemplo n.º 1
0
        public int TagAPost(int postID, string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //Tag method here
            Member m;
            Post   p;

            bool isTagged = tagDAL.TagFriend(p = new Post(postID), m = new Member(friendID));


            // INSERT NOTIFICATION
            string friendId = friendID;
            Member aFriend  = new Member(friendId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);

            aPost.PostId = postID;

            notificationDAL.InsertTagNotification(aMember, aFriend, aPost);
            //return number of tags
            int numberoftags = newsFeedDAL.CountPostTags(aPost);

            return(numberoftags);
        }
Exemplo n.º 2
0
        private void CloseWrapper()
        {
            #region CLOSING WRAPPER

            int numberofPostLikes = bl.CountPostLikes(aPost);
            int numberofPostTags  = bl.CountPostTags(aPost);

            //ContentArea Closing AND Wrapper oppening+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            if (aPost.PostType != "Article")
            {
                concatinater.Append("<div class='clr' ></div> </div> </div><div class='commentWrapper'> ");

                //buttons  Right
                concatinater.Append("<div class='btnHomePost width50% floatright '><a class='button left big floatLeft homeLikeBtn");

                RateAndTagDAL dal = new RateAndTagDAL();



                try
                {
                    tempMemberID = Context.Session["memberID"].ToString();
                }
                catch
                {
                    tempMemberID = ClientUpdateMemberID;
                }

                aMember = new Member(tempMemberID);

                //Check if member not liked
                if (dal.PostRatingExists(aMember, aPost) == 0)
                {
                    //if member not liked
                    //concatinater.Append(" homeLikeBtn");
                    concatinater.Append("' title='");
                    concatinater.Append("Like this post");
                    concatinater.Append("'  >");
                    concatinater.Append("Like");
                }
                else
                {
                    //if member is liked
                    concatinater.Append("' title='");
                    concatinater.Append("Unlike this post");
                    concatinater.Append("'  >");
                    concatinater.Append("Unlike");
                }

                //Post button
                concatinater.Append("</a><a class='button middle big floatLeft homeCommentBtn' title='Comment on this post' >Comment</a>");
                //report Button
                concatinater.Append("<a class='button middle big floatLeft reportPost' title='Report this post' >Report</a>");
                //tag button
                concatinater.Append("<a class='button right big floatLeft homeTagBtn open tag'  title='Tag a friend'  >Tag </a>");

                concatinater.Append("</div>");

                List <Member> AllLikedMembers = dal.GetPeopleLikedPost(aPost);
                //Details Left
                concatinater.Append("<div class='postinfo width50% floatLeft tip'> <a title='");

                foreach (var Member in AllLikedMembers)
                {
                    concatinater.Append(Member.DisplayName);
                    concatinater.Append("<br />");
                }

                concatinater.Append("' href='#'>Likes</a>: <span class='likesCount'> " + numberofPostLikes);
                concatinater.Append("</span>, <a href='#'>Tags</a>: <span class='tagsCount'>" + numberofPostTags);

                concatinater.Append("</span>,   <a  class='btnViewComments' title='View all comments'>Comments</a>: <span class='commentCount'>" + bl.CountComments(aPost) + "</span> </div>");


                concatinater.Append("</div>" // Wrapper End

                                             //Buiding the  Comments section
                                    + "<div class='allComments'><h4>All Comments</h4></div>"
                                             //Buiding the  Comments section
                                    + "<div class='commentSection' style='display:none; padding: 7px;'><div>"
                                    + "<textarea title='Write a comment...'  placeholder='Write a comment...' class=' commentBox floatLeft input BorberRad3'"
                                    + " style='width: 100%; height: 30px; font-size: 0.85em; margin: 5px 0pt 7px;' rows='2' cols='20'></textarea>"
                                    + " <a class='button big floatLeft btnSendComment floatright '  style='font-size: 0.9em; margin-right: -10px; '  >Comment</a></div></div></div>");

                #endregion
            }
            #endregion
        }