Exemple #1
0
        public void Comment(string statusId, string cmtMessage)
        {
            this.Init();
            var commentId = SequentialGuid.Create();
            var comment   = new DemoSignalRChat.Models.Comment
            {
                CommentId   = commentId,
                Content     = cmtMessage,
                StatusId    = statusId,
                UserId      = this._curUserChat.UserId,
                TimeComment = DateTime.Now
            };

            this._commentRepository.AddComment(comment);

            var      newFeedId = SequentialGuid.Create();
            NewFeeds newfeed   = new NewFeeds
            {
                UserId             = this._curUserChat.UserId,
                NewFeedId          = newFeedId,
                TypeActionId       = TypeAction.COMMENT,
                StatusId_Or_UserId = commentId
            };

            this._newFeedRepository.AddNewFeed(newfeed);


            string commentDisplay = ProcessComment.ProcessNewComment(this._curUserChat, cmtMessage);

            Clients.Clients(this._allUserRelate_ConnectionId).comment(this._curUserChat.Displayname, statusId, commentDisplay);
        }
Exemple #2
0
        public void Comment(string statusId, string cmtMessage)
        {
            this.Init();
            var commentId = SequentialGuid.Create();
            var comment = new DemoSignalRChat.Models.Comment
            {
                CommentId = commentId,
                Content = cmtMessage,
                StatusId = statusId,
                UserId = this._curUserChat.UserId,
                TimeComment = DateTime.Now
            };

            this._commentRepository.AddComment(comment);

            var newFeedId = SequentialGuid.Create();
            NewFeeds newfeed = new NewFeeds
            {
                UserId = this._curUserChat.UserId,
                NewFeedId = newFeedId,
                TypeActionId = TypeAction.COMMENT,
                StatusId_Or_UserId = commentId
            };
            this._newFeedRepository.AddNewFeed(newfeed);

            string commentDisplay = ProcessComment.ProcessNewComment(this._curUserChat, cmtMessage);

            Clients.Clients(this._allUserRelate_ConnectionId).comment(this._curUserChat.Displayname, statusId, commentDisplay);
        }
 public void AddComment(Comment comment)
 {
     this._db.Comments.Add(comment);
     this.Save();
 }