private void DeletePrice(string sql) { ProductPriceCollection oPriceList = ProductPrice.LoadCollection(sql); foreach (ProductPrice oPrice in oPriceList) { oPrice.Delete(); } }
/// <summary> /// Loads a collection of ProductPrice objects from the database. /// </summary> /// <returns>A collection containing all of the ProductPrice objects in the database.</returns> public static ProductPriceCollection LoadCollection(string spName, SqlParameter[] parms) { ProductPriceCollection result = new ProductPriceCollection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { ProductPrice tmp = new ProductPrice(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }