Ejemplo n.º 1
0
        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="workTaskInsNextOperEntity">实体</param>
        public int UpdateEntity(WorkTaskInsNextOperEntity workTaskInsNextOperEntity)
        {
            var sqlBuilder = new SQLBuilder(DBProvider);

            sqlBuilder.BeginUpdate(this.CurrentTableName);
            this.SetEntity(sqlBuilder, workTaskInsNextOperEntity);
            sqlBuilder.SetWhere(WorkTaskInsNextOperTable.FieldNextOperId, workTaskInsNextOperEntity.NextOperId);
            return(sqlBuilder.EndUpdate());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="sqlBuilder">Sql语句生成器</param>
 /// <param name="workTaskInsNextOperEntity">实体</param>
 private void SetEntity(SQLBuilder sqlBuilder, WorkTaskInsNextOperEntity workTaskInsNextOperEntity)
 {
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldWorkFlowId, workTaskInsNextOperEntity.WorkFlowId);
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldWorkTaskId, workTaskInsNextOperEntity.WorkTaskId);
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldWorkFlowInsId, workTaskInsNextOperEntity.WorkFlowInsId);
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldWorkTaskInsId, workTaskInsNextOperEntity.WorkTaskInsId);
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldUserId, workTaskInsNextOperEntity.UserId);
     sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldUserName, workTaskInsNextOperEntity.UserName);
 }
        /// <summary>
        /// 动态指定新的任务实例处理人
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体-加签处理人、下一处理人(一般用于动态指定)</param>
        /// <returns>主键</returns>
        public string CreateWorkTaskInsNextOper(UserInfo userInfo, WorkTaskInsNextOperEntity entity)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_CreateWorkTaskInsNextOper);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInsNextOperManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.AddEntity(entity);
            });
            return(returnValue);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="workTaskInsNextOperEntity">实体</param>
        public string AddEntity(WorkTaskInsNextOperEntity workTaskInsNextOperEntity)
        {
            var sequence = string.Empty;

            this.Identity = false;
            if (!string.IsNullOrEmpty(workTaskInsNextOperEntity.NextOperId))
            {
                sequence = workTaskInsNextOperEntity.NextOperId.ToString();
            }
            var sqlBuilder = new SQLBuilder(DBProvider, this.Identity, this.ReturnId);

            sqlBuilder.BeginInsert(this.CurrentTableName, WorkTaskInsNextOperTable.FieldNextOperId);
            if (!this.Identity)
            {
                if (string.IsNullOrEmpty(workTaskInsNextOperEntity.NextOperId))
                {
                    sequence = BusinessLogic.NewGuid();
                    workTaskInsNextOperEntity.NextOperId = sequence;
                }
                sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldNextOperId, workTaskInsNextOperEntity.NextOperId);
            }
            else
            {
                if (!this.ReturnId && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                {
                    if (DBProvider.CurrentDbType == CurrentDbType.Oracle)
                    {
                        sqlBuilder.SetFormula(WorkTaskInsNextOperTable.FieldNextOperId, "SEQ_" + this.CurrentTableName.ToUpper() + ".NEXTVAL ");
                    }
                    if (DBProvider.CurrentDbType == CurrentDbType.DB2)
                    {
                        sqlBuilder.SetFormula(WorkTaskInsNextOperTable.FieldNextOperId, "NEXT VALUE FOR SEQ_" + this.CurrentTableName.ToUpper());
                    }
                }
                else
                {
                    if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                    {
                        if (string.IsNullOrEmpty(workTaskInsNextOperEntity.NextOperId))
                        {
                            if (string.IsNullOrEmpty(sequence))
                            {
                                var sequenceManager = new CiSequenceManager(DBProvider, this.Identity);
                                sequence = sequenceManager.GetSequence(this.CurrentTableName);
                            }
                            workTaskInsNextOperEntity.NextOperId = sequence;
                        }
                        sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldNextOperId, workTaskInsNextOperEntity.NextOperId);
                    }
                }
            }
            this.SetEntity(sqlBuilder, workTaskInsNextOperEntity);
            if (UserInfo != null)
            {
                sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldCreateUserId, UserInfo.Id);
                sqlBuilder.SetValue(WorkTaskInsNextOperTable.FieldCreateBy, UserInfo.RealName);
            }
            sqlBuilder.SetDBNow(WorkTaskInsNextOperTable.FieldCreateOn);
            if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.SqlServer || DBProvider.CurrentDbType == CurrentDbType.Access))
            {
                sequence = sqlBuilder.EndInsert().ToString();
            }
            else
            {
                sqlBuilder.EndInsert();
            }
            return(sequence);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="workTaskInsNextOperEntity">实体</param>
 public int Update(WorkTaskInsNextOperEntity workTaskInsNextOperEntity)
 {
     return(this.UpdateEntity(workTaskInsNextOperEntity));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="workTaskInsNextOperEntity">实体</param>
 /// <param name="identity">自增量方式</param>
 /// <param name="returnId">返回主键</param>
 /// <returns>主键</returns>
 public string Add(WorkTaskInsNextOperEntity workTaskInsNextOperEntity, bool identity, bool returnId)
 {
     this.Identity = identity;
     this.ReturnId = returnId;
     return(this.AddEntity(workTaskInsNextOperEntity));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="workTaskInsNextOperEntity">实体</param>
 /// <returns>主键</returns>
 public string Add(WorkTaskInsNextOperEntity workTaskInsNextOperEntity)
 {
     return(this.AddEntity(workTaskInsNextOperEntity));
 }