public bool UpdateFlowNodeCondition(FlowNodeConditionEntity flowNodeConditionEntity)
        {
            bool          flag             = false;
            StringBuilder whereCommandText = new StringBuilder();

            whereCommandText.Append("  FlowConditionID=@FlowConditionID");
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" JournalID=@JournalID");
            sqlCommandText.Append(", FlowSetID=@FlowSetID");
            sqlCommandText.Append(", ConditionType=@ConditionType");
            sqlCommandText.Append(", ConditionExp=@ConditionExp");
            sqlCommandText.Append(", AddDate=@AddDate");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.FlowNodeCondition SET {0} WHERE  {1}", sqlCommandText.ToString(), whereCommandText.ToString()));

            db.AddInParameter(cmd, "@FlowConditionID", DbType.Int64, flowNodeConditionEntity.FlowConditionID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, flowNodeConditionEntity.JournalID);
            db.AddInParameter(cmd, "@FlowSetID", DbType.Int64, flowNodeConditionEntity.FlowSetID);
            db.AddInParameter(cmd, "@ConditionType", DbType.Byte, flowNodeConditionEntity.ConditionType);
            db.AddInParameter(cmd, "@ConditionExp", DbType.AnsiString, flowNodeConditionEntity.ConditionExp);
            db.AddInParameter(cmd, "@AddDate", DbType.DateTime, flowNodeConditionEntity.AddDate);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
        public bool AddFlowNodeCondition(FlowNodeConditionEntity flowNodeConditionEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" @FlowConditionID");
            sqlCommandText.Append(", @JournalID");
            sqlCommandText.Append(", @FlowSetID");
            sqlCommandText.Append(", @ConditionType");
            sqlCommandText.Append(", @ConditionExp");
            sqlCommandText.Append(", @AddDate");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.FlowNodeCondition ({0}) VALUES ({1})", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@FlowConditionID", DbType.Int64, flowNodeConditionEntity.FlowConditionID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, flowNodeConditionEntity.JournalID);
            db.AddInParameter(cmd, "@FlowSetID", DbType.Int64, flowNodeConditionEntity.FlowSetID);
            db.AddInParameter(cmd, "@ConditionType", DbType.Byte, flowNodeConditionEntity.ConditionType);
            db.AddInParameter(cmd, "@ConditionExp", DbType.AnsiString, flowNodeConditionEntity.ConditionExp);
            db.AddInParameter(cmd, "@AddDate", DbType.DateTime, flowNodeConditionEntity.AddDate);
            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
        public List <FlowNodeConditionEntity> MakeFlowNodeConditionList(DataTable dt)
        {
            List <FlowNodeConditionEntity> list = new List <FlowNodeConditionEntity>();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    FlowNodeConditionEntity flowNodeConditionEntity = MakeFlowNodeCondition(dt.Rows[i]);
                    list.Add(flowNodeConditionEntity);
                }
            }
            return(list);
        }
        public FlowNodeConditionEntity MakeFlowNodeCondition(DataRow dr)
        {
            FlowNodeConditionEntity flowNodeConditionEntity = null;

            if (dr != null)
            {
                flowNodeConditionEntity = new FlowNodeConditionEntity();
                flowNodeConditionEntity.FlowConditionID = (Int64)dr["FlowConditionID"];
                flowNodeConditionEntity.JournalID       = (Int64)dr["JournalID"];
                flowNodeConditionEntity.FlowSetID       = (Int64)dr["FlowSetID"];
                flowNodeConditionEntity.ConditionType   = (Byte)dr["ConditionType"];
                flowNodeConditionEntity.ConditionExp    = (String)dr["ConditionExp"];
                flowNodeConditionEntity.AddDate         = (DateTime)dr["AddDate"];
            }
            return(flowNodeConditionEntity);
        }
        public FlowNodeConditionEntity GetFlowNodeCondition(Int64 flowConditionID)
        {
            FlowNodeConditionEntity flowNodeConditionEntity = null;
            StringBuilder           sqlCommandText          = new StringBuilder();

            sqlCommandText.Append("SELECT TOP 1  FlowConditionID,JournalID,OperationID,ConditionType,ConditionExp,AddDate FROM dbo.FlowNodeCondition WITH(NOLOCK)");
            sqlCommandText.Append(" WHERE  FlowConditionID=@FlowConditionID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@FlowConditionID", DbType.Int64, flowConditionID);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                flowNodeConditionEntity = MakeFlowNodeCondition(dr);
            }
            return(flowNodeConditionEntity);
        }
        public List <FlowNodeConditionEntity> MakeFlowNodeConditionList(IDataReader dr)
        {
            List <FlowNodeConditionEntity> list = new List <FlowNodeConditionEntity>();

            while (dr.Read())
            {
                FlowNodeConditionEntity flowNodeConditionEntity = new FlowNodeConditionEntity();
                flowNodeConditionEntity.FlowConditionID = (Int64)dr["FlowConditionID"];
                flowNodeConditionEntity.JournalID       = (Int64)dr["JournalID"];
                flowNodeConditionEntity.FlowSetID       = (Int64)dr["FlowSetID"];
                flowNodeConditionEntity.ConditionType   = (Byte)dr["ConditionType"];
                flowNodeConditionEntity.ConditionExp    = (String)dr["ConditionExp"];
                flowNodeConditionEntity.AddDate         = (DateTime)dr["AddDate"];
                list.Add(flowNodeConditionEntity);
            }
            dr.Close();
            return(list);
        }
        public bool DeleteFlowNodeCondition(FlowNodeConditionEntity flowNodeConditionEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append("DELETE FROM dbo.FlowNodeCondition");
            sqlCommandText.Append(" WHERE  FlowConditionID=@FlowConditionID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@FlowConditionID", DbType.Int64, flowNodeConditionEntity.FlowConditionID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
示例#8
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="flowNodeCondition">FlowNodeConditionEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteFlowNodeCondition(FlowNodeConditionEntity flowNodeCondition)
 {
     return(FlowNodeConditionBusProvider.DeleteFlowNodeCondition(flowNodeCondition));
 }
示例#9
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="flowNodeCondition">FlowNodeConditionEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFlowNodeCondition(FlowNodeConditionEntity flowNodeCondition)
 {
     return(FlowNodeConditionBusProvider.UpdateFlowNodeCondition(flowNodeCondition));
 }
示例#10
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="flowNodeCondition">FlowNodeConditionEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowNodeCondition(FlowNodeConditionEntity flowNodeCondition)
 {
     return(FlowNodeConditionBusProvider.AddFlowNodeCondition(flowNodeCondition));
 }
示例#11
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="flowNodeCondition">FlowNodeConditionEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowNodeCondition(FlowNodeConditionEntity flowNodeCondition)
 {
     return(FlowNodeConditionDataAccess.Instance.AddFlowNodeCondition(flowNodeCondition));
 }