public int UpdateInfor(Models.Course.MXBrand Model) { StringBuilder sql = new StringBuilder(); sql.Append("Update [MXBrand] set BrandName=@BrandName where BrandId=@BrandId"); SqlParameter[] par = (SqlParameter[])this.ValueParas(Model); return(Common.DbHelperSQL.ExecuteSql(sql.ToString(), par)); }
public int InsertInfor(Models.Course.MXBrand Model) { StringBuilder sql = new StringBuilder(); sql.Append("Insert into [MXBrand] ( BrandName ) values(@BrandName)"); SqlParameter[] par = (SqlParameter[])this.ValueParas(Model); return(XueFuShop.Common.DbHelperSQL.ExecuteSql(sql.ToString(), par)); }
//读取信息 public SqlDataReader GetInfor(Models.Course.MXBrand Model) { StringBuilder sql = new StringBuilder(); sql.Append("select * from [MXBrand] where BrandId=@BrandId"); SqlParameter[] par = (SqlParameter[])this.ValueParas(Model); return(Common.DbHelperSQL.ExecuteReader(sql.ToString(), par)); }
/// <summary> /// 该数据访问对象的属性值装载到数据库更新参数数组 /// </summary> /// <remarks></remarks> protected IDbDataParameter[] ValueParas(Models.Course.MXBrand Model) { SqlParameter[] par = { new SqlParameter("@BrandId", SqlDbType.VarChar, 50), new SqlParameter("@BrandName", SqlDbType.VarChar, 50) }; par[0].Value = Model.BrandId; par[1].Value = Model.BrandName; return(par); }
public int UpdateInfor(Models.Course.MXBrand Model) { return(dal.UpdateInfor(Model)); }
public int InsertInfor(Models.Course.MXBrand Model) { return(dal.InsertInfor(Model)); }