/// <summary> /// GetWorkflowComments /// </summary> /// <param name="workflowCommentsRequest"></param> /// <returns></returns> public ServiceResponse <List <WorkflowCommentDC> > GetWorkflowComments(WorkflowCommentRequestDC workflowCommentsRequest) { ServiceResponse <List <WorkflowCommentDC> > getUserTaskCommentsServiceResponse = new ServiceResponse <List <WorkflowCommentDC> >(); try { SetContext(); List <WorkflowComment> workflowComments = _workflowManager.GetWorkflowComments((ContextEnum)workflowCommentsRequest.ContextId, workflowCommentsRequest.ContextContentId); getUserTaskCommentsServiceResponse.Result = new List <WorkflowCommentDC>(); workflowComments.ForEach( workflowComment => getUserTaskCommentsServiceResponse.Result.Add(Mapper.Map <WorkflowComment, WorkflowCommentDC>(workflowComment)) ); } catch (Exception ex) { HandleError(ex, getUserTaskCommentsServiceResponse); } return(getUserTaskCommentsServiceResponse); }
/// <summary> /// GetUserTaskComments /// </summary> /// <returns></returns> public List <WorkflowCommentModel> GetWorkflowComments(ContextEnum context, int contextContentId) { List <WorkflowCommentModel> workflowComments = new List <WorkflowCommentModel>(); WorkflowCommentRequestDC userTaskCommentsServiceRequest = new WorkflowCommentRequestDC(); userTaskCommentsServiceRequest.ContextId = (int)context; userTaskCommentsServiceRequest.ContextContentId = contextContentId; ServiceResponse <List <WorkflowCommentDC> > UserTaskCommentsServiceResponse = _workflowProxy.Execute(opt => opt.GetWorkflowComments(userTaskCommentsServiceRequest)); if (UserTaskCommentsServiceResponse.Status == ResponseStatus.Success) { foreach (WorkflowCommentDC UserTaskComment in UserTaskCommentsServiceResponse.Result) { workflowComments.Add(Mapper.Map <WorkflowCommentDC, WorkflowCommentModel>(UserTaskComment)); } } else { HandleError(UserTaskCommentsServiceResponse.Status, UserTaskCommentsServiceResponse.ResponseMessage); } return(workflowComments); }