コード例 #1
0
        /// <summary>
        /// 取消工作任务
        /// </summary>
        /// <param name="taskId">工作任务Id</param>
        /// <param name="model">取消工作任务原因</param>
        /// <returns></returns>
        public ApiResponse <bool> CancelWorkTask(int taskId, OperateWorkTaskModel model)
        {
            if (taskId < 0)
            {
                Log.Error("无效的工作任务。");
                throw new InvalidOperationException("无效的工作任务。");
            }

            string season = model == null || string.IsNullOrEmpty(model.Comment) ? "任务取消" : model.Comment;

            var response = new ApiResponse <bool>()
            {
                Result = WorkTaskService.Cancel(taskId, season, this.Member)
            };

            return(response);
        }
コード例 #2
0
        public ApiResponse <bool> CloseWorkTask(int taskId, OperateWorkTaskModel model)
        {
            if (taskId < 0)
            {
                Log.Error("无效的工作任务。");
                throw new InvalidOperationException("无效的工作任务。");
            }

            model = model ?? new OperateWorkTaskModel();

            var response = new ApiResponse <bool>()
            {
                Result = WorkTaskService.Do(taskId, WorkTaskStatus.Closed, this.Member, model.Comment)
            };

            return(response);
        }
コード例 #3
0
        public ApiResponse <bool> ModifyWorkTaskComment(int commentId, OperateWorkTaskModel model)
        {
            if (commentId < 0)
            {
                Log.Error("无效的工作任务评论。");
                throw new InvalidOperationException("无效的工作任务评论。");
            }

            model = model ?? new OperateWorkTaskModel();

            var response = new ApiResponse <bool>()
            {
                Result = WorkTaskCommentService.ModifyComment(this.Member, commentId, model.Comment)
            };

            return(response);
        }
コード例 #4
0
        /// <summary>
        /// 转移(指派)工作任务
        /// </summary>
        /// <param name="taskId">工作任务Id</param>
        /// <param name="model">备注</param>
        /// <returns></returns>
        public ApiResponse <bool> TransferWorkTask(int taskId, OperateWorkTaskModel model)
        {
            if (taskId < 0)
            {
                Log.Error("无效的工作任务。");
                throw new InvalidOperationException("无效的工作任务。");
            }

            if (model == null || !model.Executor.HasValue)
            {
                Log.Error("无效的执行人。");
                throw new InvalidOperationException("无效的执行人。");
            }

            var response = new ApiResponse <bool>()
            {
                Result = WorkTaskService.Transfer(taskId, model.Executor.Value, this.Member, model.Comment)
            };

            return(response);
        }