예제 #1
0
        /// <summary>
        /// Assigns the task comment attachments.
        /// </summary>
        /// <param name="taskPresenter">The task presenter.</param>
        private void AssignTaskCommentAttachments(TaskPresenter taskPresenter)
        {
            if (taskPresenter.TaskComments != null)
            {
                foreach (TaskCommentDetail commentDetail in taskPresenter.TaskComments)
                {
                    commentDetail.AssignCommentAttachmentList(this.taskService.RetrieveTaskAttachmentList(null, commentDetail.TaskCommentID));
                    IList<int> commentAttachmentIds = new List<int>();

                    foreach (var attachment in commentDetail.CommentAttachmentList)
                    {
                        commentAttachmentIds.Add(attachment.TaskAttachmentID);
                    }

                    string attachmentIds = string.Join(",", commentAttachmentIds);
                    taskPresenter.CommentAttachmentIds.Add(attachmentIds);
                }

                taskPresenter.AssignCommentAttachmentList(taskPresenter.CommentAttachmentIds);
            }
        }