private WorkflowItem AddWorkflowItem(Document document, User user, WorkflowDecisions workflowDecision, string message) { WorkflowItem workflowItem = new WorkflowItem(); workflowItem.Decision = (int)workflowDecision; workflowItem.DecisionDate = DateTime.Now; workflowItem.Document = document; workflowItem.Message = message; workflowItem.User = user; return workflowItem; }
private void AddDocumentReviewQueueItem(User user, Document document, WorkflowItem workflowItem) { DocumentReviewQueueItem reviewQueueItem = new DocumentReviewQueueItem(); if (user.UserLevel == (int)UserLevels.TeamManager) { reviewQueueItem.ForManagement = true; reviewQueueItem.ForDirector = false; reviewQueueItem.User = null; } else if (user.UserLevel == (int)UserLevels.ManagementTeamMember) { reviewQueueItem.ForManagement = false; reviewQueueItem.ForDirector = true; reviewQueueItem.User = null; } else { reviewQueueItem.ForManagement = false; reviewQueueItem.ForDirector = false; reviewQueueItem.User = _userService.GetUserSuperior(user); } reviewQueueItem.WorkflowItem = workflowItem; document.DocumentReviewQueueItems.Add(reviewQueueItem); }