/// <summary>
        /// 审批不同意
        /// </summary>
        /// <param name="taskRecordId"></param>
        /// <param name="opinion"></param>
        public int disagree(int taskRecordId, string opinion)
        {
            // 新增approve record记录
            var approveRecord = new ApproveRecord
            {
                ApproverId = user.UserId,
                CreateTime = DateTime.Now,
                DocId      = taskRecordId,
                Opinion    = opinion,
                Result     = "审批拒绝",
                Type       = 2
            };

            Db.Insertable(approveRecord).ExecuteReturnIdentity();

            // 修改task record状态
            var taskRecord = SimpleDb.GetSingle(u => u.Id == taskRecordId);

            taskRecord.Status = 2;
            SimpleDb.Update(taskRecord);

            // todo 发送相关消息

            return(taskRecord.Id);
        }
Пример #2
0
        /// <summary>
        /// 开始任务操作按钮
        /// </summary>
        /// <param name="taskId"></param>
        public void beginTask(int taskId)
        {
            // 修改任务状态为 进行中
            var task = SimpleDb.AsQueryable().Where(u => u.Id == taskId).First();

            task.Status = 1;
            SimpleDb.Update(task);

            // 新增任务记录:开始任务
            var taskRecord = new TaskRecord
            {
                Status        = 1,
                CreateTime    = DateTime.Now,
                Desc          = "任务开始",
                SubmitterId   = user.UserId,
                SubmitterName = user.UserName,
                TaskId        = taskId
            };

            Db.Insertable(taskRecord).ExecuteCommand();
        }
Пример #3
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="columns">要更新的列的内容</param>
 /// <param name="whereLambda">更新条件</param>
 /// <returns></returns>
 public bool UpdateEntity(Expression <Func <T, T> > columns, Expression <Func <T, bool> > whereLambda)
 {
     return(SimpleDb.Update(columns, whereLambda));
 }
Пример #4
0
 public bool Update(User entity)
 {
     return(SimpleDb.Update(entity));
 }
Пример #5
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public bool UpdateEntity(T t)
 {
     return(SimpleDb.Update(t));
 }