Пример #1
0
        public string FriendRequestAcceptedNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetFriendRequestAcceptedNotificationsForAMember(aMember);


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

                string FriendDisplayName = MemberList[0].DisplayName;


                notification += FriendDisplayName + " accepted your friend request\n\n";
                #endregion
            }
            return(notification);
        }
Пример #2
0
        public string MessageNotifications()
        {
            string notification = "";

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetMessageNotificationForAMember(aMember);

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

                Message aMessage = new Message(NotificationsList[i].MessageId);


                aMessage = notificationDAL.GetMessageDateTime(aMessage);

                notification += MemberList[0].DisplayName + " sent you a message at " + FormatDateTime(aMessage.DateTime) + "\n\n";
            }
            return(notification);
        }
Пример #3
0
        public string EventNotifications()
        {
            string notification = "";

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetEventNotificationsForGroupMembers();

            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                int  postId = NotificationsList[i].PostId;
                Post aPost  = new Post(postId);

                List <Event_Post> EventNameList = new List <Event_Post>();
                EventNameList = notificationDAL.GetEventName(aPost);

                string eventDisplayText = "";
                if (EventNameList[0].EventName.Length > 30)
                {
                    eventDisplayText = EventNameList[0].EventName.Substring(0, 30) + "...";
                }
                else
                {
                    eventDisplayText = EventNameList[0].EventName;
                }

                List <Member> GroupMembersList = new List <Member>();

                Group aGroup = new Group(NotificationsList[i].GroupId);
                GroupMembersList = notificationDAL.GetGroupMembers(aGroup);

                for (int j = 0; j < GroupMembersList.Count; ++j)
                {
                    string friendId = aMember.MemberId; //PERSON WHO IS LOGGED IN

                    //CHECK TO SEE IF PE
                    if (friendId == GroupMembersList[j].MemberId)
                    {
                        List <Member> MemberList = new List <Member>();
                        Member        aFriend    = new Member(NotificationsList[i].MemberId);
                        MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                        List <Group> GroupList = new List <Group>();
                        Group        Group     = new Group(NotificationsList[i].GroupId);
                        GroupList = notificationDAL.GetGroupDescription(Group);

                        notification += MemberList[0].DisplayName + " created the event '" + eventDisplayText + "' in the group '" + GroupList[0].GroupDescription + "'\n\n";
                    }
                }
            }
            return(notification);
        }
Пример #4
0
        public string TagNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetTagNotificationsForAMember(aMember);


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

                string FriendDisplayName = MemberList[0].DisplayName;

                //memberslist
                List <Member> PostOwnerMemberList = new List <Member>();
                Post          aPost = new Post(NotificationsList[i].PostId);
                PostOwnerMemberList = notificationDAL.GetPostOwner(aPost);


                List <Post> PostList = new List <Post>();
                PostList = notificationDAL.GetPostCreateDate(aPost);

                string memberLoggedOn = aMember.MemberId;

                if (memberLoggedOn == PostOwnerMemberList[0].MemberId)
                {
                    notification += FriendDisplayName + " tagged you on your post which you posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                }
                else if (FriendDisplayName == PostOwnerMemberList[0].DisplayName)
                {
                    notification += "You were tagged on " + PostOwnerMemberList[0].DisplayName + "'s post by " + FriendDisplayName + " " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else
                {
                    notification += FriendDisplayName + " tagged you on " + PostOwnerMemberList[0].DisplayName + "'s post which was posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                }


                #endregion
            }
            return(notification);
        }
Пример #5
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);
        }
Пример #6
0
        public string TagNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

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

                string FriendDisplayName = MemberList[0].DisplayName;

                //memberslist
                List<Member> PostOwnerMemberList = new List<Member>();
                Post aPost = new Post(NotificationsList[i].PostId);
                PostOwnerMemberList = notificationDAL.GetPostOwner(aPost);

                List<Post> PostList = new List<Post>();
                PostList = notificationDAL.GetPostCreateDate(aPost);

                string memberLoggedOn = aMember.MemberId;

                if (memberLoggedOn == PostOwnerMemberList[0].MemberId)
                {
                    notification += FriendDisplayName + " tagged you on your post which you posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                }
                else if (FriendDisplayName == PostOwnerMemberList[0].DisplayName)
                {
                    notification += "You were tagged on " + PostOwnerMemberList[0].DisplayName + "'s post by " + FriendDisplayName + " " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else
                {
                    notification += FriendDisplayName + " tagged you on " + PostOwnerMemberList[0].DisplayName + "'s post which was posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                }

                #endregion
            }
            return notification;
        }
Пример #7
0
        public string PostRatingNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            ArrayList ArrayPosts;
            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                #region PostRating

                List<Member> MemberList = new List<Member>();
                Member aFriend = new Member(NotificationsList[i].MemberId);
                MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                List<Post> PostList = new List<Post>();
                Post aPost = new Post(NotificationsList[i].PostId);
                PostList = notificationDAL.GetPostType(aPost);

                if (PostList[0].PostType == "Event")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Event_Post aEvent_Post;
                    aEvent_Post = (Event_Post)ArrayPosts[i];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aEvent_Post.EventName.Length > 30)
                    {
                        postDisplayText = aEvent_Post.EventName.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aEvent_Post.EventName;
                    }

                    notification += MemberList[0].DisplayName + " liked your event '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Text")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Text_Post aText_Post;
                    aText_Post = (Text_Post)ArrayPosts[0];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aText_Post.PostText.Length > 30)
                    {
                        postDisplayText = aText_Post.PostText.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aText_Post.PostText;
                    }

                    notification += MemberList[0].DisplayName + " liked your post '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Photo")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Photo_Post aPhoto_Post;
                    aPhoto_Post = (Photo_Post)ArrayPosts[0];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aPhoto_Post.PhotoCaption.Length > 30)
                    {
                        postDisplayText = aPhoto_Post.PhotoCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aPhoto_Post.PhotoCaption;
                    }

                    notification += MemberList[0].DisplayName + " liked your photo '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Article")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Article_Post aArticle_Post;
                    aArticle_Post = (Article_Post)ArrayPosts[0];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aArticle_Post.Title.Length > 30)
                    {
                        postDisplayText = aArticle_Post.Title.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aArticle_Post.Title;
                    }

                    notification += MemberList[0].DisplayName + " liked your article '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Video")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Video_Post aVideo_Post;
                    aVideo_Post = (Video_Post)ArrayPosts[0];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aVideo_Post.VideoCaption.Length > 30)
                    {
                        postDisplayText = aVideo_Post.VideoCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aVideo_Post.VideoCaption;
                    }

                    notification += MemberList[0].DisplayName + " liked your video '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "File")
                {
                    aPost = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    File_Post aFile_Post;
                    aFile_Post = (File_Post)ArrayPosts[0];

                    PostList = new List<Post>();
                    aPost = new Post(NotificationsList[i].PostId);

                    PostList = new List<Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aFile_Post.FileCaption.Length > 30)
                    {
                        postDisplayText = aFile_Post.FileCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aFile_Post.FileCaption;
                    }

                    notification += MemberList[0].DisplayName + " liked your file post '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                #endregion
            }
            return notification;
        }
Пример #8
0
        public string MessageNotifications()
        {
            string notification = "";

            NotificationDAL notificationDAL = new NotificationDAL();

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

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

                Message aMessage = new Message(NotificationsList[i].MessageId);

                aMessage = notificationDAL.GetMessageDateTime(aMessage);

                notification += MemberList[0].DisplayName + " sent you a message at " + FormatDateTime(aMessage.DateTime) + "\n\n";
            }
            return notification;
        }
Пример #9
0
        public string FriendRequestSentNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

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

                string FriendDisplayName = MemberList[0].DisplayName;

                notification += FriendDisplayName + " sent you a friend request\n\n";
                #endregion
            }
            return notification;
        }
Пример #10
0
        public string CommentNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

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

                string FriendDisplayName = MemberList[0].DisplayName;

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

                List<Post> PostList = new List<Post>();
                PostList = notificationDAL.GetPostCreateDate(aPost);

                List<Post> PostTypeList = new List<Post>();
                PostTypeList = notificationDAL.GetPostType(aPost);

                string postType = "";
                if (PostTypeList[0].PostType == "Event")
                {
                    postType = "event";
                }
                else if (PostTypeList[0].PostType == "Text")
                {
                    postType = "post";
                }
                else if (PostTypeList[0].PostType == "Photo")
                {
                    postType = "photo";
                }
                else if (PostTypeList[0].PostType == "Article")
                {
                    postType = "article";
                }
                else if (PostTypeList[0].PostType == "Video")
                {
                    postType = "video";
                }
                else if (PostTypeList[0].PostType == "File")
                {
                    postType = "file post";
                }
                notification += FriendDisplayName + " commented on your " + postType + " which you posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                #endregion
            }
            return notification;
        }
Пример #11
0
        public string EventNotifications()
        {
            string notification = "";

            NotificationDAL notificationDAL = new NotificationDAL();

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

            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                int postId = NotificationsList[i].PostId;
                Post aPost = new Post(postId);

                List<Event_Post> EventNameList = new List<Event_Post>();
                EventNameList = notificationDAL.GetEventName(aPost);

                string eventDisplayText = "";
                if (EventNameList[0].EventName.Length > 30)
                {
                    eventDisplayText = EventNameList[0].EventName.Substring(0, 30) + "...";
                }
                else
                {
                    eventDisplayText = EventNameList[0].EventName;
                }

                List<Member> GroupMembersList = new List<Member>();

                Group aGroup = new Group(NotificationsList[i].GroupId);
                GroupMembersList = notificationDAL.GetGroupMembers(aGroup);

                for (int j = 0; j < GroupMembersList.Count; ++j)
                {
                    string friendId = aMember.MemberId; //PERSON WHO IS LOGGED IN

                    //CHECK TO SEE IF PE
                    if (friendId == GroupMembersList[j].MemberId)
                    {
                        List<Member> MemberList = new List<Member>();
                        Member aFriend = new Member(NotificationsList[i].MemberId);
                        MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                        List<Group> GroupList = new List<Group>();
                        Group Group = new Group(NotificationsList[i].GroupId);
                        GroupList = notificationDAL.GetGroupDescription(Group);

                        notification += MemberList[0].DisplayName + " created the event '" + eventDisplayText + "' in the group '" + GroupList[0].GroupDescription + "'\n\n";
                    }
                }
            }
            return notification;
        }
Пример #12
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;
        }
Пример #13
0
        public string CommentNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetCommentedOnPostNotification(aMember);


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

                string FriendDisplayName = MemberList[0].DisplayName;

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

                List <Post> PostList = new List <Post>();
                PostList = notificationDAL.GetPostCreateDate(aPost);

                List <Post> PostTypeList = new List <Post>();
                PostTypeList = notificationDAL.GetPostType(aPost);

                string postType = "";
                if (PostTypeList[0].PostType == "Event")
                {
                    postType = "event";
                }
                else if (PostTypeList[0].PostType == "Text")
                {
                    postType = "post";
                }
                else if (PostTypeList[0].PostType == "Photo")
                {
                    postType = "photo";
                }
                else if (PostTypeList[0].PostType == "Article")
                {
                    postType = "article";
                }
                else if (PostTypeList[0].PostType == "Video")
                {
                    postType = "video";
                }
                else if (PostTypeList[0].PostType == "File")
                {
                    postType = "file post";
                }
                notification += FriendDisplayName + " commented on your " + postType + " which you posted " + FormatDateTime(PostList[0].CreateDate) + " \n\n";
                #endregion
            }
            return(notification);
        }
Пример #14
0
        public string PostRatingNotifications()
        {
            string notification = "";

            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetPostRatingNotificationsForAMember(aMember);


            ArrayList ArrayPosts;

            for (int i = 0; i < NotificationsList.Count; ++i)
            {
                #region PostRating

                List <Member> MemberList = new List <Member>();
                Member        aFriend    = new Member(NotificationsList[i].MemberId);
                MemberList = notificationDAL.GetMemberDisplayName(aFriend);

                List <Post> PostList = new List <Post>();
                Post        aPost    = new Post(NotificationsList[i].PostId);
                PostList = notificationDAL.GetPostType(aPost);

                if (PostList[0].PostType == "Event")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Event_Post aEvent_Post;
                    aEvent_Post = (Event_Post)ArrayPosts[i];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aEvent_Post.EventName.Length > 30)
                    {
                        postDisplayText = aEvent_Post.EventName.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aEvent_Post.EventName;
                    }

                    notification += MemberList[0].DisplayName + " liked your event '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Text")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Text_Post aText_Post;
                    aText_Post = (Text_Post)ArrayPosts[0];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aText_Post.PostText.Length > 30)
                    {
                        postDisplayText = aText_Post.PostText.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aText_Post.PostText;
                    }

                    notification += MemberList[0].DisplayName + " liked your post '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Photo")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Photo_Post aPhoto_Post;
                    aPhoto_Post = (Photo_Post)ArrayPosts[0];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);


                    string postDisplayText = "";
                    if (aPhoto_Post.PhotoCaption.Length > 30)
                    {
                        postDisplayText = aPhoto_Post.PhotoCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aPhoto_Post.PhotoCaption;
                    }

                    notification += MemberList[0].DisplayName + " liked your photo '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Article")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Article_Post aArticle_Post;
                    aArticle_Post = (Article_Post)ArrayPosts[0];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);

                    string postDisplayText = "";
                    if (aArticle_Post.Title.Length > 30)
                    {
                        postDisplayText = aArticle_Post.Title.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aArticle_Post.Title;
                    }

                    notification += MemberList[0].DisplayName + " liked your article '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "Video")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    Video_Post aVideo_Post;
                    aVideo_Post = (Video_Post)ArrayPosts[0];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);


                    string postDisplayText = "";
                    if (aVideo_Post.VideoCaption.Length > 30)
                    {
                        postDisplayText = aVideo_Post.VideoCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aVideo_Post.VideoCaption;
                    }

                    notification += MemberList[0].DisplayName + " liked your video '" + postDisplayText + "' which you posted " + FormatDateTime(PostList[0].CreateDate) + "\n\n";
                }
                else if (PostList[0].PostType == "File")
                {
                    aPost      = new Post(NotificationsList[i].PostId, PostList[0].PostType);
                    ArrayPosts = notificationDAL.GetPostCaption(aPost);

                    File_Post aFile_Post;
                    aFile_Post = (File_Post)ArrayPosts[0];

                    PostList = new List <Post>();
                    aPost    = new Post(NotificationsList[i].PostId);

                    PostList = new List <Post>();
                    PostList = notificationDAL.GetPostCreateDate(aPost);


                    string postDisplayText = "";
                    if (aFile_Post.FileCaption.Length > 30)
                    {
                        postDisplayText = aFile_Post.FileCaption.Substring(0, 30) + "...";
                    }
                    else
                    {
                        postDisplayText = aFile_Post.FileCaption;
                    }

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