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