Exemple #1
0
        private void DeleteBarcode(string sql)
        {
            ProductBarcodeCollection oBarcodeList = ProductBarcode.LoadCollection(sql);

            foreach (ProductBarcode oBarcode in oBarcodeList)
            {
                oBarcode.Delete();
            }
        }
Exemple #2
0
        /// <summary>
        /// Loads a collection of ProductBarcode objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the ProductBarcode objects in the database.</returns>
        public static ProductBarcodeCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            ProductBarcodeCollection result = new ProductBarcodeCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    ProductBarcode tmp = new ProductBarcode();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }