コード例 #1
0
        public bool AddFriend(FRIEND friend)
        {
            bool returnValue = false;

            friend.REQUEST      = "N";
            friend.BLOCKED      = "N";
            friend.CREATED_DATE = DateTime.Now;
            returnValue         = friendRepo.Add(friend);
            if (returnValue == true)
            {
                var getReturn = notifManager.AddNotification(new NOTIFICATION()
                {
                    RECEIVER_ID = friend.FRIEND_ID,
                    SEEN        = "N",
                    SENDER_ID   = friend.USER_ID,
                    NOTIF_TYPE  = "F"
                });
            }
            return(returnValue);
        }
コード例 #2
0
        public bool AddComment(COMMENT comment, int postOwnerID)
        {
            bool returnValue = false;

            comment.DATE_CREATED = DateTime.Now;
            returnValue          = commentRepo.Add(comment);
            if (comment.POSTER_ID != postOwnerID)
            {
                notifManager.AddNotification(new NOTIFICATION()
                {
                    RECEIVER_ID = postOwnerID,
                    SEEN        = "N",
                    SENDER_ID   = comment.POSTER_ID,
                    NOTIF_TYPE  = "C",
                    POST_ID     = comment.POST_ID,
                    COMMENT_ID  = comment.ID
                });
            }
            return(returnValue);
        }
コード例 #3
0
        public bool LikePost(LIKE like, int postOwnerID)
        {
            bool returnValue = false;
            var  getLike     = likeRepo.Get(x => x.POST_ID == like.POST_ID && x.LIKE_BY == like.LIKE_BY);

            if (getLike == null)
            {
                returnValue = likeRepo.Add(like);

                if (postOwnerID != like.LIKE_BY)
                {
                    notifManager.AddNotification(new NOTIFICATION()
                    {
                        RECEIVER_ID = postOwnerID,
                        SEEN        = "N",
                        SENDER_ID   = like.LIKE_BY,
                        NOTIF_TYPE  = "L",
                        POST_ID     = like.POST_ID
                    });
                }
            }

            return(returnValue);
        }