Exemplo n.º 1
0
        /// <summary>
        /// 创建流程单个实例数据
        /// </summary>
        /// <param name="flowID"></param>
        /// <param name="pkValue"></param>
        /// <returns>实例ID</returns>
        public Guid CreateData(Guid flowID, string pkValue)
        {
            var wfi = new WorkFlow().GetWorkFlowRunModel(flowID);

            if (wfi == null)
            {
                return(Guid.Empty);
            }
            var dbs = wfi.DataBases;

            if (dbs.Count() == 0)
            {
                return(Guid.Empty);
            }
            var          db     = dbs.First();
            WorkFlowData wfData = new WorkFlowData();

            BizProcess.Data.Model.WorkFlowData wfdata = new BizProcess.Data.Model.WorkFlowData();
            wfdata.ID         = Guid.NewGuid();
            wfdata.InstanceID = Guid.NewGuid();
            wfdata.LinkID     = db.LinkID;
            wfdata.TableName  = db.Table;
            wfdata.FieldName  = db.PrimaryKey;
            wfdata.Value      = pkValue;
            wfData.Add(wfdata);
            return(wfdata.InstanceID);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新记录
        /// </summary>
        /// <param name="model">BizProcess.Data.Model.WorkFlowData实体类</param>
        public int Update(BizProcess.Data.Model.WorkFlowData model)
        {
            string sql = @"UPDATE WorkFlowData SET 
				InstanceID=@InstanceID,LinkID=@LinkID,TableName=@TableName,FieldName=@FieldName,Value=@Value
				WHERE ID=@ID"                ;

            MySqlParameter[] parameters = new MySqlParameter[] {
                new MySqlParameter("@InstanceID", MySqlDbType.VarChar, -1)
                {
                    Value = model.InstanceID
                },
                new MySqlParameter("@LinkID", MySqlDbType.VarChar, -1)
                {
                    Value = model.LinkID
                },
                new MySqlParameter("@TableName", MySqlDbType.VarChar, 500)
                {
                    Value = model.TableName
                },
                new MySqlParameter("@FieldName", MySqlDbType.VarChar, 500)
                {
                    Value = model.FieldName
                },
                new MySqlParameter("@Value", MySqlDbType.VarChar, 8000)
                {
                    Value = model.Value
                },
                new MySqlParameter("@ID", MySqlDbType.VarChar, -1)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="model">BizProcess.Data.Model.WorkFlowData实体类</param>
        /// <returns>操作所影响的行数</returns>
        public int Add(BizProcess.Data.Model.WorkFlowData model)
        {
            string sql = @"INSERT INTO WorkFlowData
				(ID,InstanceID,LinkID,TableName,FieldName,Value) 
				VALUES(@ID,@InstanceID,@LinkID,@TableName,@FieldName,@Value)"                ;

            MySqlParameter[] parameters = new MySqlParameter[] {
                new MySqlParameter("@ID", MySqlDbType.VarChar, -1)
                {
                    Value = model.ID
                },
                new MySqlParameter("@InstanceID", MySqlDbType.VarChar, -1)
                {
                    Value = model.InstanceID
                },
                new MySqlParameter("@LinkID", MySqlDbType.VarChar, -1)
                {
                    Value = model.LinkID
                },
                new MySqlParameter("@TableName", MySqlDbType.VarChar, 500)
                {
                    Value = model.TableName
                },
                new MySqlParameter("@FieldName", MySqlDbType.VarChar, 500)
                {
                    Value = model.FieldName
                },
                new MySqlParameter("@Value", MySqlDbType.VarChar, 8000)
                {
                    Value = model.Value
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 更新记录
        /// </summary>
        /// <param name="model">BizProcess.Data.Model.WorkFlowData实体类</param>
        public int Update(BizProcess.Data.Model.WorkFlowData model)
        {
            string sql = @"UPDATE WorkFlowData SET 
				InstanceID=:InstanceID,LinkID=:LinkID,TableName=:TableName,FieldName=:FieldName,Value=:Value
				WHERE ID=:ID"                ;

            OracleParameter[] parameters = new OracleParameter[] {
                new OracleParameter(":InstanceID", OracleDbType.Char, 36)
                {
                    Value = model.InstanceID
                },
                new OracleParameter(":LinkID", OracleDbType.Char, 36)
                {
                    Value = model.LinkID
                },
                new OracleParameter(":TableName", OracleDbType.Varchar2, 500)
                {
                    Value = model.TableName
                },
                new OracleParameter(":FieldName", OracleDbType.Varchar2, 500)
                {
                    Value = model.FieldName
                },
                new OracleParameter(":Value", OracleDbType.Varchar2, 8000)
                {
                    Value = model.Value
                },
                new OracleParameter(":ID", OracleDbType.Char, 36)
                {
                    Value = model.ID
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 添加记录
        /// </summary>
        /// <param name="model">BizProcess.Data.Model.WorkFlowData实体类</param>
        /// <returns>操作所影响的行数</returns>
        public int Add(BizProcess.Data.Model.WorkFlowData model)
        {
            string sql = @"INSERT INTO WorkFlowData
				(ID,InstanceID,LinkID,TableName,FieldName,Value) 
				VALUES(:ID,:InstanceID,:LinkID,:TableName,:FieldName,:Value)"                ;

            OracleParameter[] parameters = new OracleParameter[] {
                new OracleParameter(":ID", OracleDbType.Char, 36)
                {
                    Value = model.ID
                },
                new OracleParameter(":InstanceID", OracleDbType.Char, 36)
                {
                    Value = model.InstanceID
                },
                new OracleParameter(":LinkID", OracleDbType.Char, 36)
                {
                    Value = model.LinkID
                },
                new OracleParameter(":TableName", OracleDbType.Varchar2, 500)
                {
                    Value = model.TableName
                },
                new OracleParameter(":FieldName", OracleDbType.Varchar2, 500)
                {
                    Value = model.FieldName
                },
                new OracleParameter(":Value", OracleDbType.Varchar2, 8000)
                {
                    Value = model.Value
                }
            };
            return(dbHelper.Execute(sql, parameters));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 将DataRedar转换为List
        /// </summary>
        private List <BizProcess.Data.Model.WorkFlowData> DataReaderToList(MySqlDataReader dataReader)
        {
            List <BizProcess.Data.Model.WorkFlowData> List = new List <BizProcess.Data.Model.WorkFlowData>();

            BizProcess.Data.Model.WorkFlowData model = null;
            while (dataReader.Read())
            {
                model            = new BizProcess.Data.Model.WorkFlowData();
                model.ID         = dataReader.GetGuid(0);
                model.InstanceID = dataReader.GetGuid(1);
                model.LinkID     = dataReader.GetGuid(2);
                model.TableName  = dataReader.GetString(3);
                model.FieldName  = dataReader.GetString(4);
                model.Value      = dataReader.GetString(5);
                List.Add(model);
            }
            return(List);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 更新
 /// </summary>
 public int Update(BizProcess.Data.Model.WorkFlowData model)
 {
     return(dataWorkFlowData.Update(model));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 新增
 /// </summary>
 public int Add(BizProcess.Data.Model.WorkFlowData model)
 {
     return(dataWorkFlowData.Add(model));
 }