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

            strSql.Append("update TFCode_CaseProcessInCodeTaskChain set ");
            strSql.Append("g_CodeTaskGuid=@g_CodeTaskGuid,");
            strSql.Append("n_CodeCaseProcessID=@n_CodeCaseProcessID,");
            strSql.Append("n_CodeCaseProcessItemID=@n_CodeCaseProcessItemID,");
            strSql.Append("s_When=@s_When");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_CodeTaskGuid",          SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@n_CodeCaseProcessID",     SqlDbType.Int,               4),
                new SqlParameter("@n_CodeCaseProcessItemID", SqlDbType.Int,               4),
                new SqlParameter("@s_When",                  SqlDbType.NVarChar,          5),
                new SqlParameter("@g_ID",                    SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.g_CodeTaskGuid;
            parameters[1].Value = model.n_CodeCaseProcessID;
            parameters[2].Value = model.n_CodeCaseProcessItemID;
            parameters[3].Value = model.s_When;
            parameters[4].Value = model.g_ID;

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

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

            strSql.Append("insert into TFCode_CaseProcessInCodeTaskChain(");
            strSql.Append("g_ID,g_CodeTaskGuid,n_CodeCaseProcessID,n_CodeCaseProcessItemID,s_When)");
            strSql.Append(" values (");
            strSql.Append("@g_ID,@g_CodeTaskGuid,@n_CodeCaseProcessID,@n_CodeCaseProcessItemID,@s_When)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID",                    SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@g_CodeTaskGuid",          SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@n_CodeCaseProcessID",     SqlDbType.Int,               4),
                new SqlParameter("@n_CodeCaseProcessItemID", SqlDbType.Int,               4),
                new SqlParameter("@s_When",                  SqlDbType.NVarChar, 5)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = model.n_CodeCaseProcessID;
            parameters[3].Value = model.n_CodeCaseProcessItemID;
            parameters[4].Value = model.s_When;

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

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

            strSql.Append("select  top 1 g_ID,g_CodeTaskGuid,n_CodeCaseProcessID,n_CodeCaseProcessItemID,s_When from TFCode_CaseProcessInCodeTaskChain ");
            strSql.Append(" where g_ID=@g_ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@g_ID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = g_ID;

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

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