Exemplo n.º 1
0
        /// <summary>
        /// Redudant with RetrieveProducts; should be removed entirely.
        /// </summary>
        /// <returns></returns>
        public List <Product> ListProducts()
        {
            List <Product> products = null;

            try
            {
                products = ProductAccessor.RetrieveProductList();
            }
            catch (SqlException)
            {
                throw;
            }

            return(products);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Christian Lopez
 /// Created 2017/03/08
 ///
 /// Tries to get a list of products from the accessor
 /// </summary>
 /// <returns></returns>
 public List <Product> RetrieveProducts()
 {
     try
     {
         return(ProductAccessor.RetrieveProductList());
     }
     catch (SqlException ex)
     {
         throw new ApplicationException("There was a database error.", ex);
     }
     catch (Exception ex)
     {
         throw new ApplicationException("There was an unknown error.", ex);
     }
 }