コード例 #1
0
        private void DeletePrice(string sql)
        {
            ProductPriceCollection oPriceList = ProductPrice.LoadCollection(sql);

            foreach (ProductPrice oPrice in oPriceList)
            {
                oPrice.Delete();
            }
        }
コード例 #2
0
ファイル: ProductPrice.cs プロジェクト: paulusyeung/RT2020
        /// <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);
        }