Exemplo n.º 1
0
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="sqlBuilder">Sql语句生成器</param>
 /// <param name="workTaskControlsEntity">实体</param>
 private void SetEntity(SQLBuilder sqlBuilder, WorkTaskControlsEntity workTaskControlsEntity)
 {
     sqlBuilder.SetValue(WorkTaskControlsTable.FieldWorkflowId, workTaskControlsEntity.WorkflowId);
     sqlBuilder.SetValue(WorkTaskControlsTable.FieldWorkTaskId, workTaskControlsEntity.WorkTaskId);
     sqlBuilder.SetValue(WorkTaskControlsTable.FieldUserControlId, workTaskControlsEntity.UserControlId);
     sqlBuilder.SetValue(WorkTaskControlsTable.FieldControlType, workTaskControlsEntity.ControlType);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="workTaskControlsEntity">实体</param>
        public int UpdateEntity(WorkTaskControlsEntity workTaskControlsEntity)
        {
            var sqlBuilder = new SQLBuilder(DBProvider);

            sqlBuilder.BeginUpdate(this.CurrentTableName);
            this.SetEntity(sqlBuilder, workTaskControlsEntity);
            sqlBuilder.SetWhere(WorkTaskControlsTable.FieldTaskControlId, workTaskControlsEntity.TaskControlId);
            return(sqlBuilder.EndUpdate());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 任务节点绑定表单
        /// </summary>
        /// <param name="userCtrlId">表单id</param>
        /// <param name="workflowid">流程模版Id</param>
        /// <param name="worktaskId">任务节点id</param>
        /// <returns>绑定成功返回主键</returns>
        public string SetTaskUserCtrls(string userCtrlId, string workflowid, string worktaskId)
        {
            string returnStr = string.Empty;

            try
            {
                //string sqlStr = "insert WorkTaskControls(UserControlId,workflowid,WorktaskId) values (@UserControlId,@workflowid,@WorktaskId)";
                var entity = new WorkTaskControlsEntity
                {
                    UserControlId = userCtrlId,
                    WorkflowId    = workflowid,
                    WorkTaskId    = worktaskId
                };
                returnStr = new WorkTaskControlsManager(this.DBProvider).AddEntity(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(returnStr);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="workTaskControlsEntity">实体</param>
        public string AddEntity(WorkTaskControlsEntity workTaskControlsEntity)
        {
            var sequence = string.Empty;

            this.Identity = false;
            if (!string.IsNullOrEmpty(workTaskControlsEntity.TaskControlId))
            {
                sequence = workTaskControlsEntity.TaskControlId.ToString(CultureInfo.InvariantCulture);
            }
            var sqlBuilder = new SQLBuilder(DBProvider, this.Identity, this.ReturnId);

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