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

            strSql.Append("update TFCode_TaskGenerateFee set ");
            strSql.Append("g_CodeTaskGuid=@g_CodeTaskGuid,");
            strSql.Append("n_CodeFeeID=@n_CodeFeeID,");
            strSql.Append("s_GenerateTime=@s_GenerateTime,");
            strSql.Append("s_GenerateCondition=@s_GenerateCondition");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_CodeTaskGuid",      SqlDbType.UniqueIdentifier,   16),
                new SqlParameter("@n_CodeFeeID",         SqlDbType.Int,                 4),
                new SqlParameter("@s_GenerateTime",      SqlDbType.NVarChar,            1),
                new SqlParameter("@s_GenerateCondition", SqlDbType.NVarChar,         2000),
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_CodeTaskGuid;
            parameters[1].Value = model.n_CodeFeeID;
            parameters[2].Value = model.s_GenerateTime;
            parameters[3].Value = model.s_GenerateCondition;
            parameters[4].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 bool Add(IPSP.Model.TFCode_TaskGenerateFee model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TFCode_TaskGenerateFee(");
            strSql.Append("g_ID,g_CodeTaskGuid,n_CodeFeeID,s_GenerateTime,s_GenerateCondition)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_CodeTaskGuid,@n_CodeFeeID,@s_GenerateTime,@s_GenerateCondition)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_CodeTaskGuid",      SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@n_CodeFeeID",         SqlDbType.Int,               4),
                new SqlParameter("@s_GenerateTime",      SqlDbType.NVarChar,          1),
                new SqlParameter("@s_GenerateCondition", SqlDbType.NVarChar, 2000)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = model.n_CodeFeeID;
            parameters[3].Value = model.s_GenerateTime;
            parameters[4].Value = model.s_GenerateCondition;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.TFCode_TaskGenerateFee DataRowToModel(DataRow row)
 {
     IPSP.Model.TFCode_TaskGenerateFee model = new IPSP.Model.TFCode_TaskGenerateFee();
     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["n_CodeFeeID"] != null && row["n_CodeFeeID"].ToString() != "")
         {
             model.n_CodeFeeID = int.Parse(row["n_CodeFeeID"].ToString());
         }
         if (row["s_GenerateTime"] != null)
         {
             model.s_GenerateTime = row["s_GenerateTime"].ToString();
         }
         if (row["s_GenerateCondition"] != null)
         {
             model.s_GenerateCondition = row["s_GenerateCondition"].ToString();
         }
     }
     return(model);
 }
Beispiel #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.TFCode_TaskGenerateFee GetModel(Guid g_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 g_ID,g_CodeTaskGuid,n_CodeFeeID,s_GenerateTime,s_GenerateCondition from TFCode_TaskGenerateFee ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

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

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