예제 #1
0
파일: DAL_Picture.cs 프로젝트: wfwe/Blog
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Model.Picture model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update Picture set ");
     strSql.Append("TypeId=" + model.TypeId + ",");
     strSql.Append("ImgName='" + model.ImgName + "',");
     strSql.Append("ImgUrl='" + model.ImgUrl + "'");
     strSql.Append("Imgsdescribe='" + model.ImgUrl + "'");
     strSql.Append(" where ID=" + model.ID + " ");
     SQLHelper.ExecuteNonQuery(strSql.ToString());
 }
예제 #2
0
파일: DAL_Picture.cs 프로젝트: wfwe/Blog
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Model.Picture model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("insert into Picture(");
     strSql.Append("TypeId,ImgName,ImgUrl,Imgsdescribe");
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append("" + model.TypeId + ",");
     strSql.Append("'" + model.ImgName + "',");
     strSql.Append("'" + model.ImgUrl + "',");
     strSql.Append("'" + model.Imgsdescribe + "'");
     strSql.Append(")");
     SQLHelper.ExecuteNonQuery(strSql.ToString());
 }
예제 #3
0
파일: DAL_Picture.cs 프로젝트: wfwe/Blog
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.Picture GetModel(int ID)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select   ");
     strSql.Append(" ID,TypeId,ImgName,ImgUrl,Imgsdescribe,date ");
     strSql.Append(" from Picture ");
     strSql.Append(" where ID=" + ID + " ");
     using (IDataReader dataReader = SQLHelper.ExecuteReader(strSql.ToString()))
     {
         if (dataReader.Read())
         {
             model = ReaderBind(dataReader);
         }
     }
     return model;
 }
예제 #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Model.Picture model)
 {
     dal.Update(model);
 }
예제 #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Model.Picture model)
 {
     dal.Add(model);
 }