Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(IPSP.Model.TFCode_DeadlineInCodeTaskChain model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TFCode_DeadlineInCodeTaskChain set ");
            strSql.Append("g_CodeTaskChainGuid=@g_CodeTaskChainGuid,");
            strSql.Append("g_CodeDeadlineID=@g_CodeDeadlineID");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_CodeTaskChainGuid", SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_CodeDeadlineID",    SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_CodeTaskChainGuid;
            parameters[1].Value = model.g_CodeDeadlineID;
            parameters[2].Value = model.g_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(IPSP.Model.TFCode_DeadlineInCodeTaskChain model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TFCode_DeadlineInCodeTaskChain(");
            strSql.Append("g_ID,g_CodeTaskChainGuid,g_CodeDeadlineID)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_CodeTaskChainGuid,@g_CodeDeadlineID)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",                SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_CodeTaskChainGuid", SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_CodeDeadlineID",    SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = Guid.NewGuid();

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.TFCode_DeadlineInCodeTaskChain DataRowToModel(DataRow row)
 {
     IPSP.Model.TFCode_DeadlineInCodeTaskChain model = new IPSP.Model.TFCode_DeadlineInCodeTaskChain();
     if (row != null)
     {
         if (row["g_ID"] != null && row["g_ID"].ToString() != "")
         {
             model.g_ID = new Guid(row["g_ID"].ToString());
         }
         if (row["g_CodeTaskChainGuid"] != null && row["g_CodeTaskChainGuid"].ToString() != "")
         {
             model.g_CodeTaskChainGuid = new Guid(row["g_CodeTaskChainGuid"].ToString());
         }
         if (row["g_CodeDeadlineID"] != null && row["g_CodeDeadlineID"].ToString() != "")
         {
             model.g_CodeDeadlineID = new Guid(row["g_CodeDeadlineID"].ToString());
         }
     }
     return(model);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.TFCode_DeadlineInCodeTaskChain GetModel(Guid g_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 g_ID,g_CodeTaskChainGuid,g_CodeDeadlineID from TFCode_DeadlineInCodeTaskChain ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

            IPSP.Model.TFCode_DeadlineInCodeTaskChain model = new IPSP.Model.TFCode_DeadlineInCodeTaskChain();
            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_DeadlineInCodeTaskChain model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(IPSP.Model.TFCode_DeadlineInCodeTaskChain model)
 {
     return(dal.Add(model));
 }