Пример #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 void DeleteAPost(int postID)
        {
            NewsfeedDAL newsfeedDAL = new NewsfeedDAL();
            Post        aPost       = new Post(postID);

            newsfeedDAL.FlagPost(aPost);


            //Updating all Clients
            Clients.removeDeletedPost(Context.ConnectionId, postID);
        }
Пример #3
0
        public int CountCommentNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetCommentedOnPostNotification(aMember);

            return(NotificationsList.Count);
        }
Пример #4
0
        public int CountFriendRequestAcceptedNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetFriendRequestAcceptedNotificationsForAMember(aMember);

            return(NotificationsList.Count);
        }
Пример #5
0
        public int CountTagNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            NotificationsList = notificationDAL.GetTagNotificationsForAMember(aMember);

            return(NotificationsList.Count);
        }
Пример #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 void DeleteAComment(string sessionMemberID, int postID, int commentID)
        {
            NewsfeedDAL dal      = new NewsfeedDAL();
            Comments    aComment = new Comments(commentID);

            dal.FlagComment(aComment);
            Post   aPost        = new Post(postID);
            string commentCount = messageDAL.CountComments(aPost).ToString();


            //Updating all Clients
            Clients.removeDeletedComment(Context.ConnectionId, commentCount, commentID, postID);
        }
Пример #8
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);
        }
Пример #9
0
        public int CountTagNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            return NotificationsList.Count;
        }
Пример #10
0
        public int CountFriendRequestAcceptedNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            return NotificationsList.Count;
        }
Пример #11
0
        public int CountCommentNotifications()
        {
            NewsfeedDAL newsFeedDAL = new NewsfeedDAL();

            NotificationDAL notificationDAL = new NotificationDAL();

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

            return NotificationsList.Count;
        }
Пример #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 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;
        }
Пример #14
0
        public void DeleteAComment(string sessionMemberID, int postID, int commentID)
        {
            NewsfeedDAL dal = new NewsfeedDAL();
             Comments aComment = new Comments(commentID);
             dal.FlagComment(aComment);
             Post aPost = new Post(postID);
               string commentCount =  messageDAL.CountComments(aPost).ToString();

               //Updating all Clients
               Clients.removeDeletedComment(Context.ConnectionId, commentCount, commentID, postID);
        }
Пример #15
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);
        }
Пример #16
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;
        }
Пример #17
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;
        }
Пример #18
0
        public void DeleteAPost(int postID)
        {
            NewsfeedDAL newsfeedDAL = new NewsfeedDAL();
             Post aPost = new Post(postID);
             newsfeedDAL.FlagPost(aPost);

             //Updating all Clients
             Clients.removeDeletedPost(Context.ConnectionId, postID);
        }
Пример #19
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;
        }
Пример #20
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);
        }