Exemplo n.º 1
0
        /// <summary>
        /// Gets the activity comment.
        /// </summary>
        /// <param name="activity">The activity.</param>
        /// <param name="commentFlag">The comment flag.</param>
        /// <param name="commentBy">The user making the comment.</param>
        /// <param name="comment">The comment content.</param>
        /// <param name="args">Optional arguments to use as replacement values in the comment text.</param>
        /// <returns></returns>
        private TicketComment GetActivityComment(TicketActivity activity, TicketCommentFlag commentFlag, string comment, string assignedTo, string[] notificationSubscribers, params string[] args)
        {
            TicketComment c = new TicketComment();
            c.Comment = comment;
            c.CommentedBy = Security.CurrentUserName;
            c.CommentedDate = DateTime.Now;
            c.CommentEvent = TicketTextUtility.GetCommentText(activity, commentFlag, args);
            c.IsHtml = false;


            var isNewOrGiveUp = (assignedTo == null) && (activity == TicketActivity.GiveUp || activity == TicketActivity.Create || activity == TicketActivity.CreateOnBehalfOf);
            Notification.AddTicketEventNotifications(c, isNewOrGiveUp, notificationSubscribers);

            return c;
        }