Beispiel #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(IPSP.Model.TFCode_TaskTriggerTaskChain model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TFCode_TaskTriggerTaskChain set ");
            strSql.Append("g_CodeTaskGuid=@g_CodeTaskGuid,");
            strSql.Append("g_CodeTaskChainGuid=@g_CodeTaskChainGuid,");
            strSql.Append("s_TriggerTime=@s_TriggerTime,");
            strSql.Append("s_TriggerCondition=@s_TriggerCondition,");
            strSql.Append("s_Repeat=@s_Repeat,");
            strSql.Append("s_RelatedObjectSource=@s_RelatedObjectSource,");
            strSql.Append("s_MasterSlaveRelation=@s_MasterSlaveRelation");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_CodeTaskGuid",        SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@g_CodeTaskChainGuid",   SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@s_TriggerTime",         SqlDbType.NVarChar,            1),
                new SqlParameter("@s_TriggerCondition",    SqlDbType.NVarChar,         2000),
                new SqlParameter("@s_Repeat",              SqlDbType.NVarChar,            1),
                new SqlParameter("@s_RelatedObjectSource", SqlDbType.NVarChar,           50),
                new SqlParameter("@s_MasterSlaveRelation", SqlDbType.NVarChar,            2),
                new SqlParameter("@g_ID",                  SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_CodeTaskGuid;
            parameters[1].Value = model.g_CodeTaskChainGuid;
            parameters[2].Value = model.s_TriggerTime;
            parameters[3].Value = model.s_TriggerCondition;
            parameters[4].Value = model.s_Repeat;
            parameters[5].Value = model.s_RelatedObjectSource;
            parameters[6].Value = model.s_MasterSlaveRelation;
            parameters[7].Value = model.g_ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.TFCode_TaskTriggerTaskChain DataRowToModel(DataRow row)
 {
     IPSP.Model.TFCode_TaskTriggerTaskChain model = new IPSP.Model.TFCode_TaskTriggerTaskChain();
     if (row != null)
     {
         if (row["g_ID"] != null && row["g_ID"].ToString() != "")
         {
             model.g_ID = new Guid(row["g_ID"].ToString());
         }
         if (row["g_CodeTaskGuid"] != null && row["g_CodeTaskGuid"].ToString() != "")
         {
             model.g_CodeTaskGuid = new Guid(row["g_CodeTaskGuid"].ToString());
         }
         if (row["g_CodeTaskChainGuid"] != null && row["g_CodeTaskChainGuid"].ToString() != "")
         {
             model.g_CodeTaskChainGuid = new Guid(row["g_CodeTaskChainGuid"].ToString());
         }
         if (row["s_TriggerTime"] != null)
         {
             model.s_TriggerTime = row["s_TriggerTime"].ToString();
         }
         if (row["s_TriggerCondition"] != null)
         {
             model.s_TriggerCondition = row["s_TriggerCondition"].ToString();
         }
         if (row["s_Repeat"] != null)
         {
             model.s_Repeat = row["s_Repeat"].ToString();
         }
         if (row["s_RelatedObjectSource"] != null)
         {
             model.s_RelatedObjectSource = row["s_RelatedObjectSource"].ToString();
         }
         if (row["s_MasterSlaveRelation"] != null)
         {
             model.s_MasterSlaveRelation = row["s_MasterSlaveRelation"].ToString();
         }
     }
     return(model);
 }
Beispiel #3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(IPSP.Model.TFCode_TaskTriggerTaskChain model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TFCode_TaskTriggerTaskChain(");
            strSql.Append("g_ID,g_CodeTaskGuid,g_CodeTaskChainGuid,s_TriggerTime,s_TriggerCondition,s_Repeat,s_RelatedObjectSource,s_MasterSlaveRelation)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_CodeTaskGuid,@g_CodeTaskChainGuid,@s_TriggerTime,@s_TriggerCondition,@s_Repeat,@s_RelatedObjectSource,@s_MasterSlaveRelation)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",                  SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@g_CodeTaskGuid",        SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@g_CodeTaskChainGuid",   SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@s_TriggerTime",         SqlDbType.NVarChar,            1),
                new SqlParameter("@s_TriggerCondition",    SqlDbType.NVarChar,         2000),
                new SqlParameter("@s_Repeat",              SqlDbType.NVarChar,            1),
                new SqlParameter("@s_RelatedObjectSource", SqlDbType.NVarChar,           50),
                new SqlParameter("@s_MasterSlaveRelation", SqlDbType.NVarChar, 2)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = Guid.NewGuid();
            parameters[3].Value = model.s_TriggerTime;
            parameters[4].Value = model.s_TriggerCondition;
            parameters[5].Value = model.s_Repeat;
            parameters[6].Value = model.s_RelatedObjectSource;
            parameters[7].Value = model.s_MasterSlaveRelation;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.TFCode_TaskTriggerTaskChain GetModel(Guid g_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 g_ID,g_CodeTaskGuid,g_CodeTaskChainGuid,s_TriggerTime,s_TriggerCondition,s_Repeat,s_RelatedObjectSource,s_MasterSlaveRelation from TFCode_TaskTriggerTaskChain ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

            IPSP.Model.TFCode_TaskTriggerTaskChain model = new IPSP.Model.TFCode_TaskTriggerTaskChain();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(IPSP.Model.TFCode_TaskTriggerTaskChain model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(IPSP.Model.TFCode_TaskTriggerTaskChain model)
 {
     return(dal.Add(model));
 }