Exemplo n.º 1
0
        private async void LoadedAction()
        {
            AppThemeService.LoadTheme();

            var histories = await WorkTaskService.GetWorkTaskHistoriesAsync();

            foreach (var history in histories)
            {
                Histories.AddOnScheduler(history);
            }
        }
        public ApiResponse <bool> EditWorkTask(int taskId, NewWorkTaskModel task)
        {
            task.Valid(); //验证Task参数是否有效

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

            return(response);
        }
        public ApiResponse <int> AddWorkTask(NewWorkTaskModel task)
        {
            task.Valid(); //验证Task参数是否有效

            var response = new ApiResponse <int>()
            {
                Result = WorkTaskService.Add(task, this.Member)
            };

            return(response);
        }
Exemplo n.º 4
0
        private async void SaveAction()
        {
            IsBusy.Value = true;

            var result = await WorkTaskService.RegistWorkTaskAsync(Answer.Value);

            Answer.Value = string.Empty;
            Histories.Remove(result.Title);
            Histories.Insert(0, result.Title);

            IsBusy.Value = false;
        }
Exemplo n.º 5
0
 public AppService(AppDbContext db) : base(db)
 {
     User                   = new UserService(db);
     Customer               = new CustomerService(db);
     CustomerUser           = new CustomerUserService(db);
     WorkTask               = new WorkTaskService(db);
     Note                   = new NoteService(db);
     Document               = new DocumentService(db);
     Invoice                = new InvoiceService(db);
     InvoiceElementCategory = new InvoiceElementCategoryService(db);
     CommonInvoiceElement   = new CommonInvoiceElementService(db);
     InvoicePayment         = new InvoicePaymentService(db);
     InvoiceElement         = new InvoiceElementService(db);
 }
        /// <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);
        }
        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);
        }
        /// <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);
        }
Exemplo n.º 9
0
 public WorkTaskController(WorkTaskService workTaskService)
 {
     _workTaskService = workTaskService;
 }