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

            comment.State = this.AvailableStates[type];
        }
Exemple #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;
            }
        }
Exemple #3
0
 public void CalculateState(Comment comment, int currentUserId, ActiontType actionType, AuthorType authorType)
 {
     this._commentActionStrategyFactory.GetRequestStateStrategy(authorType).CalculateSate(comment, currentUserId, actionType);
 }
Exemple #4
0
 public void CalculateSate(Comment comment, int CurrentUserId, ActiontType actionType)
 {
     this.CalculateCommentState(comment, actionType);
 }