Exemple #1
0
        public int CountCommentRatingNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

            List <Notification> NotificationsList = new List <Notification>();

            NotificationsList = notificationDAL.GetCommentRatingNotificationsForAMember(aMember);

            return(NotificationsList.Count);
        }
Exemple #2
0
        public string CommentRatingNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

            List <Notification> NotificationsList = new List <Notification>();

            NotificationsList = notificationDAL.GetCommentRatingNotificationsForAMember(aMember);


            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                #region CommentRating
                //memberlist
                List <Member> MemberList = new List <Member>();
                Member        aFriend    = new Member(NotificationsList[i].MemberId);
                MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                string FriendDisplayName = MemberList[0].DisplayName;

                List <Comments> CommentList = new List <Comments>();
                Comments        aComment    = new Comments(NotificationsList[i].CommentId);
                CommentList = notificationDAL.GetCommentTextAndCreateDate(aComment);

                //memberslist
                MemberList = new List <Member>();
                Post aPost = new Post(CommentList[0].PostId);
                MemberList = notificationDAL.GetPostOwner(aPost);

                string postDisplayText = "";
                if (CommentList[0].CommentText.Length > 30)
                {
                    postDisplayText = CommentList[0].CommentText.Substring(0, 30) + "...";
                }
                else
                {
                    postDisplayText = CommentList[0].CommentText;
                }

                notification += FriendDisplayName + " liked your comment '" + postDisplayText + "' which you posted " + FormatDateTime(CommentList[0].CreateDate) + " on " + MemberList[0].DisplayName + " post\n\n";
                #endregion
            }
            return(notification);
        }
        public int CountCommentRatingNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

            List<Notification> NotificationsList = new List<Notification>();
            NotificationsList = notificationDAL.GetCommentRatingNotificationsForAMember(aMember);

            return NotificationsList.Count;
        }
        public string CommentRatingNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

            List<Notification> NotificationsList = new List<Notification>();
            NotificationsList = notificationDAL.GetCommentRatingNotificationsForAMember(aMember);

            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                #region CommentRating
                //memberlist
                List<Member> MemberList = new List<Member>();
                Member aFriend = new Member(NotificationsList[i].MemberId);
                MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                string FriendDisplayName = MemberList[0].DisplayName;

                List<Comments> CommentList = new List<Comments>();
                Comments aComment = new Comments(NotificationsList[i].CommentId);
                CommentList = notificationDAL.GetCommentTextAndCreateDate(aComment);

                //memberslist
                MemberList = new List<Member>();
                Post aPost = new Post(CommentList[0].PostId);
                MemberList = notificationDAL.GetPostOwner(aPost);

                string postDisplayText = "";
                if (CommentList[0].CommentText.Length > 30)
                {
                    postDisplayText = CommentList[0].CommentText.Substring(0, 30) + "...";
                }
                else
                {
                    postDisplayText = CommentList[0].CommentText;
                }

                notification += FriendDisplayName + " liked your comment '" + postDisplayText + "' which you posted " + FormatDateTime(CommentList[0].CreateDate) + " on " + MemberList[0].DisplayName + " post\n\n";
                #endregion
            }
            return notification;
        }