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

            strSql.Append("update T_BizSolutionInfo set ");
            strSql.Append("s_ItemValue=@s_ItemValue");
            strSql.Append(" where s_ItemName=@s_ItemName ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@s_ItemValue", SqlDbType.NVarChar, 4000),
                new SqlParameter("@s_ItemName",  SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.s_ItemValue;
            parameters[1].Value = model.s_ItemName;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public IPSP.Model.T_BizSolutionInfo DataRowToModel(DataRow row)
 {
     IPSP.Model.T_BizSolutionInfo model = new IPSP.Model.T_BizSolutionInfo();
     if (row != null)
     {
         if (row["s_ItemName"] != null)
         {
             model.s_ItemName = row["s_ItemName"].ToString();
         }
         if (row["s_ItemValue"] != null)
         {
             model.s_ItemValue = row["s_ItemValue"].ToString();
         }
     }
     return(model);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public IPSP.Model.T_BizSolutionInfo GetModel(string s_ItemName)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 s_ItemName,s_ItemValue from T_BizSolutionInfo ");
            strSql.Append(" where s_ItemName=@s_ItemName ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@s_ItemName", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = s_ItemName;

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

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