protected void RemindStatus(TaskMaster task, TaskStatus taskStatus) { #region 获取用户列表 StringBuilder users = new StringBuilder(); if (taskStatus.IsRemindCreateUser) { users.Append(task.CreateUserId.ToString()); if (!string.IsNullOrEmpty(task.SubmitUserId.ToString())) { users.Append(ISIConstants.ISI_USER_SEPRATOR); users.Append(task.SubmitUserId.ToString()); } } if (taskStatus.IsRemindAssignUser) { if (!string.IsNullOrEmpty(task.AssignUserId.ToString())) { if (users.Length != 0) { users.Append(ISIConstants.ISI_USER_SEPRATOR); } users.Append(task.AssignUserId.ToString()); } else if (task.AssignUserId != null) { if (users.Length != 0) { users.Append(ISIConstants.ISI_USER_SEPRATOR); } users.Append(task.AssignUserId.ToString()); } } if (taskStatus.IsRemindStartUser && task.StartedUser != null) { if (users.Length != 0) { users.Append(ISIConstants.ISI_USER_SEPRATOR); } users.Append(task.StartedUser); } if (taskStatus.IsRemindCommentUser) { //所有评论人 // var commentList = commentDetailMgrE.GetComment(task.Code); var commentList = new List<CommentDetail>(); if (commentList != null && commentList.Count > 0) { string commentUsers = string.Join(";", commentList.Select(t => t.CreateUser).Distinct().ToArray<string>()); if (users.Length != 0) { users.Append(ISIConstants.ISI_USER_SEPRATOR); } users.Append(commentUsers); task.CommentDetail = commentList[0]; } } #endregion User operationUser = new User(); operationUser.Id = taskStatus.LastModifyUserId; operationUser.FirstName = taskStatus.LastModifyUserName; IList<UserSub> userSubList = this.GenerateUserSub(task, users.ToString(), false, operationUser); task.TaskStatus = taskStatus; this.Remind(task, ISIConstants.ISI_LEVEL_STATUS, 0, userSubList, operationUser); }
public void UpdateTaskStatus(TaskStatus taskStatus, TaskMaster task) { task.Flag = taskStatus.Flag; task.Color = taskStatus.Color; task.LastModifyDate = taskStatus.LastModifyDate; task.LastModifyUserId = taskStatus.LastModifyUserId; task.LastModifyUserName = taskStatus.LastModifyUserName; this.UpdateTask(task); }
public ActionResult _TaskStatusNew(TaskStatus taskStatus) { if (ModelState.IsValid) { taskMgr.CreateTaskStatus(taskStatus, this.CurrentUser, false); SaveSuccessMessage(Resources.ISI.TaskStatus.TaskStatus_Added); return RedirectToAction("_TaskStatusEdit/" + taskStatus.Id); } return PartialView(taskStatus); }
public void CreateTaskStatus(TaskStatus taskStatus,User currentUser,bool isComplete) { TaskMaster task = genericMgr.FindById<TaskMaster>(taskStatus.TaskCode); //自动开始此任务 if (task.Status == CodeMaster.TaskStatus.Assign) { this.ConfirmTask(task.Code, currentUser); } genericMgr.Create(taskStatus); if (taskStatus.IsCurrentStatus || taskStatus.IsRemindAssignUser || taskStatus.IsRemindCommentUser || taskStatus.IsRemindCreateUser || taskStatus.IsRemindStartUser || isComplete) { if (taskStatus.IsCurrentStatus || isComplete) { if (isComplete && task.Status == CodeMaster.TaskStatus.InProcess) { CompleteTask(task, currentUser); } this.UpdateTaskStatus(taskStatus, task); } this.RemindStatus(task, taskStatus); } }
public ActionResult _TaskStatusNew(string taskCode) { TaskStatus taskStatus = new TaskStatus(); TaskMaster task = genericMgr.FindById<TaskMaster>(taskCode); taskStatus.TaskCode = taskCode; taskStatus.Color = task.Color; taskStatus.Description1 = task.Description1; taskStatus.Priority = task.Priority; taskStatus.Subject = task.Subject; taskStatus.StatusDescription = task.StatusDescription; taskStatus.TaskAddress = task.TaskAddress; taskStatus.TaskSubType = task.TaskSubType; return PartialView(taskStatus); }