/// <summary> /// 添加是否热门产品 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_HotProductTableData(HotProduct_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@HP_Name", obj.HP_Name) })); }
/// <summary> /// 获取全部的是否热门产品 /// </summary> /// <returns></returns> public List <HotProduct_Table> GetHotProductTableAll() { List <HotProduct_Table> list = new List <HotProduct_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { HotProduct_Table obj = new HotProduct_Table() { HP_Name = dr["HP_Name"].ToString(), HP_id = Convert.ToInt32(dr["HP_id"]) }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 根据ID查询是否热门产品信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public HotProduct_Table GetHotProductTableByConn(string con) { HotProduct_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from HotProduct_Table where HP_id=@HP_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@HP_id", con) }); if (dr.Read()) { obj = new HotProduct_Table() { HP_Name = dr["HP_Name"].ToString(), HP_id = Convert.ToInt32(dr["HP_id"]) }; } dr.Close(); return(obj); }
/// <summary> /// 更改是否热门产品信息 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_HotProductTableData(HotProduct_Table obj) { return(relevanceClass.Update_HotProductTableData(obj)); }
/// <summary> /// 添加是否热门产品信息 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_HotProductTableData(HotProduct_Table obj) { return(relevanceClass.Insert_HotProductTableData(obj)); }