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

            strSql.Append("update TF_TaskCycleConfig set ");
            strSql.Append("g_TaskChainGuid=@g_TaskChainGuid,");
            strSql.Append("s_CyclePara=@s_CyclePara,");
            strSql.Append("dt_BaseDate=@dt_BaseDate,");
            strSql.Append("n_AdvanceDays=@n_AdvanceDays,");
            strSql.Append("s_IsChanged=@s_IsChanged,");
            strSql.Append("dt_OriginalBaseDate=@dt_OriginalBaseDate");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_TaskChainGuid",     SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_CyclePara",         SqlDbType.NVarChar,         200),
                new SqlParameter("@dt_BaseDate",         SqlDbType.DateTime),
                new SqlParameter("@n_AdvanceDays",       SqlDbType.Int,                4),
                new SqlParameter("@s_IsChanged",         SqlDbType.NVarChar,           1),
                new SqlParameter("@dt_OriginalBaseDate", SqlDbType.DateTime),
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_TaskChainGuid;
            parameters[1].Value = model.s_CyclePara;
            parameters[2].Value = model.dt_BaseDate;
            parameters[3].Value = model.n_AdvanceDays;
            parameters[4].Value = model.s_IsChanged;
            parameters[5].Value = model.dt_OriginalBaseDate;
            parameters[6].Value = model.g_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(IPSP.Model.TF_TaskCycleConfig model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TF_TaskCycleConfig(");
            strSql.Append("g_ID,g_TaskChainGuid,s_CyclePara,dt_BaseDate,n_AdvanceDays,s_IsChanged,dt_OriginalBaseDate)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_TaskChainGuid,@s_CyclePara,@dt_BaseDate,@n_AdvanceDays,@s_IsChanged,@dt_OriginalBaseDate)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@g_TaskChainGuid",     SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@s_CyclePara",         SqlDbType.NVarChar,         200),
                new SqlParameter("@dt_BaseDate",         SqlDbType.DateTime),
                new SqlParameter("@n_AdvanceDays",       SqlDbType.Int,                4),
                new SqlParameter("@s_IsChanged",         SqlDbType.NVarChar,           1),
                new SqlParameter("@dt_OriginalBaseDate", SqlDbType.DateTime)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = model.s_CyclePara;
            parameters[3].Value = model.dt_BaseDate;
            parameters[4].Value = model.n_AdvanceDays;
            parameters[5].Value = model.s_IsChanged;
            parameters[6].Value = model.dt_OriginalBaseDate;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.TF_TaskCycleConfig DataRowToModel(DataRow row)
 {
     IPSP.Model.TF_TaskCycleConfig model = new IPSP.Model.TF_TaskCycleConfig();
     if (row != null)
     {
         if (row["g_ID"] != null && row["g_ID"].ToString() != "")
         {
             model.g_ID = new Guid(row["g_ID"].ToString());
         }
         if (row["g_TaskChainGuid"] != null && row["g_TaskChainGuid"].ToString() != "")
         {
             model.g_TaskChainGuid = new Guid(row["g_TaskChainGuid"].ToString());
         }
         if (row["s_CyclePara"] != null)
         {
             model.s_CyclePara = row["s_CyclePara"].ToString();
         }
         if (row["dt_BaseDate"] != null && row["dt_BaseDate"].ToString() != "")
         {
             model.dt_BaseDate = DateTime.Parse(row["dt_BaseDate"].ToString());
         }
         if (row["n_AdvanceDays"] != null && row["n_AdvanceDays"].ToString() != "")
         {
             model.n_AdvanceDays = int.Parse(row["n_AdvanceDays"].ToString());
         }
         if (row["s_IsChanged"] != null)
         {
             model.s_IsChanged = row["s_IsChanged"].ToString();
         }
         if (row["dt_OriginalBaseDate"] != null && row["dt_OriginalBaseDate"].ToString() != "")
         {
             model.dt_OriginalBaseDate = DateTime.Parse(row["dt_OriginalBaseDate"].ToString());
         }
     }
     return(model);
 }
コード例 #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.TF_TaskCycleConfig GetModel(Guid g_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 g_ID,g_TaskChainGuid,s_CyclePara,dt_BaseDate,n_AdvanceDays,s_IsChanged,dt_OriginalBaseDate from TF_TaskCycleConfig ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

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

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