Exemplo n.º 1
0
        protected void CalculateCommentState(Comment comment, ActiontType type)
        {
            if (!this.AvailableStates.ContainsKey(type))
            {
                comment.State = CommentState.Rejected;
            }

            comment.State = this.AvailableStates[type];
        }
Exemplo n.º 2
0
        public void CalculateSate(Comment comment, int CurrentUserId, ActiontType type)
        {
            switch (type)
            {
            case ActiontType.Edit:
                var authorId = comment.Actions.Where(x => x.Action == ActiontType.Add).FirstOrDefault().UserId;
                if (CurrentUserId != authorId)
                {
                    comment.State = CommentState.Rejected;
                }
                break;

            default:
                this.CalculateCommentState(comment, type);
                break;
            }
        }
Exemplo n.º 3
0
 public void CalculateState(Comment comment, int currentUserId, ActiontType actionType, AuthorType authorType)
 {
     this._commentActionStrategyFactory.GetRequestStateStrategy(authorType).CalculateSate(comment, currentUserId, actionType);
 }
Exemplo n.º 4
0
 public void CalculateSate(Comment comment, int CurrentUserId, ActiontType actionType)
 {
     this.CalculateCommentState(comment, actionType);
 }