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

            sqlBuilder.BeginUpdate(this.CurrentTableName);
            this.SetEntity(sqlBuilder, workFlowEventEntity);
            sqlBuilder.SetWhere(WorkFlowEventTable.FieldGuid, workFlowEventEntity.Guid);
            return(sqlBuilder.EndUpdate());
        }
        /// <summary>
        /// 更新事件通知
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">事件通知实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateWorkFlowEvent(UserInfo userInfo, WorkFlowEventEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_UpdateWorkFlowEvent);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowEventManager(dbProvider, userInfo);
                returnValue = manager.UpdateWorkFlowEvent(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 得到事件通知列表实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskid">工作任务Id</param>
        /// <returns>事件通知列表实体</returns>
        public WorkFlowEventEntity GetWorkFlowEventInfo(UserInfo userInfo, string worktaskid)
        {
            WorkFlowEventEntity returnValue = null;
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkFlowEventInfo);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowEventManager(dbProvider, userInfo);
                returnValue = manager.GetWorkFlowEventInfo(worktaskid);
            });
            return(returnValue);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 设置实体
 /// </summary>
 /// <param name="sqlBuilder">Sql语句生成器</param>
 /// <param name="workFlowEventEntity">实体</param>
 private void SetEntity(SQLBuilder sqlBuilder, WorkFlowEventEntity workFlowEventEntity)
 {
     sqlBuilder.SetValue(WorkFlowEventTable.FieldWorkFlowId, workFlowEventEntity.WorkFlowId);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldWorkTaskId, workFlowEventEntity.WorkTaskId);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldRemark, workFlowEventEntity.Remark);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldOtSms, workFlowEventEntity.OtSms);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldOtMsg, workFlowEventEntity.OtMsg);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldOtEmail, workFlowEventEntity.OtEmail);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldRmSms, workFlowEventEntity.RmSms);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldRmMsg, workFlowEventEntity.RmMsg);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldRmEmail, workFlowEventEntity.RmEmail);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldOtToUsers, workFlowEventEntity.OtToUsers);
     sqlBuilder.SetValue(WorkFlowEventTable.FieldRmToUsers, workFlowEventEntity.RmToUsers);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 增加事件通知
        /// </summary>
        /// <param name="entity">事件通知实体</param>
        /// <returns>增加成功后的主键</returns>
        public string Insert(WorkFlowEventEntity entity)
        {
            string returnStr = string.Empty;

            try
            {
                returnStr = this.AddEntity(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(returnStr);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 得到事件通知列表实体
        /// </summary>
        /// <param name="worktaskid">工作任务Id</param>
        /// <returns>事件通知列表实体</returns>
        public WorkFlowEventEntity GetWorkFlowEventInfo(string worktaskid)
        {
            if (string.IsNullOrEmpty(worktaskid))
            {
                throw new Exception("GetWorkFlowEventInfo方法错误,worktaskid不能为空!");
            }
            DataTable           dt     = GetWorkFlowEventTable(worktaskid);
            WorkFlowEventEntity entity = null;

            if (dt != null && dt.Rows.Count > 0)
            {
                entity = BaseEntity.Create <WorkFlowEventEntity>(dt);
            }
            return(entity);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 更新事件通知
        /// </summary>
        /// <param name="entity">事件通知实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateWorkFlowEvent(WorkFlowEventEntity entity)
        {
            int returnInt = -1;

            if (entity.WorkTaskId.Trim().Length == 0 || entity.WorkTaskId == null)
            {
                throw new Exception("Update方法错误,WorkTaskId不能为空!");
            }
            try
            {
                returnInt = this.UpdateEntity(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(returnInt);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="workFlowEventEntity">实体</param>
        public string AddEntity(WorkFlowEventEntity workFlowEventEntity)
        {
            string sequence = string.Empty;

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

            sqlBuilder.BeginInsert(this.CurrentTableName, WorkFlowEventTable.FieldGuid);
            if (!this.Identity)
            {
                if (string.IsNullOrEmpty(workFlowEventEntity.Guid))
                {
                    sequence = BusinessLogic.NewGuid();
                    workFlowEventEntity.Guid = sequence;
                }
                sqlBuilder.SetValue(WorkFlowEventTable.FieldGuid, workFlowEventEntity.Guid);
            }
            else
            {
                if (!this.ReturnId && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                {
                    if (DBProvider.CurrentDbType == CurrentDbType.Oracle)
                    {
                        sqlBuilder.SetFormula(WorkFlowEventTable.FieldGuid, "SEQ_" + this.CurrentTableName.ToUpper() + ".NEXTVAL ");
                    }
                    if (DBProvider.CurrentDbType == CurrentDbType.DB2)
                    {
                        sqlBuilder.SetFormula(WorkFlowEventTable.FieldGuid, "NEXT VALUE FOR SEQ_" + this.CurrentTableName.ToUpper());
                    }
                }
                else
                {
                    if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.Oracle || DBProvider.CurrentDbType == CurrentDbType.DB2))
                    {
                        if (string.IsNullOrEmpty(workFlowEventEntity.Guid))
                        {
                            if (string.IsNullOrEmpty(sequence))
                            {
                                CiSequenceManager sequenceManager = new CiSequenceManager(DBProvider, this.Identity);
                                sequence = sequenceManager.GetSequence(this.CurrentTableName);
                            }
                            workFlowEventEntity.Guid = sequence;
                        }
                        sqlBuilder.SetValue(WorkFlowEventTable.FieldGuid, workFlowEventEntity.Guid);
                    }
                }
            }
            this.SetEntity(sqlBuilder, workFlowEventEntity);
            if (this.Identity && (DBProvider.CurrentDbType == CurrentDbType.SqlServer || DBProvider.CurrentDbType == CurrentDbType.Access))
            {
                sequence = sqlBuilder.EndInsert().ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                sqlBuilder.EndInsert();
            }
            return(sequence);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="workFlowEventEntity">实体</param>
 public int Update(WorkFlowEventEntity workFlowEventEntity)
 {
     return(this.UpdateEntity(workFlowEventEntity));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="workFlowEventEntity">实体</param>
 /// <param name="identity">自增量方式</param>
 /// <param name="returnId">返回主键</param>
 /// <returns>主键</returns>
 public string Add(WorkFlowEventEntity workFlowEventEntity, bool identity, bool returnId)
 {
     this.Identity = identity;
     this.ReturnId = returnId;
     return(this.AddEntity(workFlowEventEntity));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="workFlowEventEntity">实体</param>
 /// <returns>主键</returns>
 public string Add(WorkFlowEventEntity workFlowEventEntity)
 {
     return(this.AddEntity(workFlowEventEntity));
 }