Esempio n. 1
0
        /// <summary>
        /// Gets a list of all products.
        /// </summary>
        /// <returns>A list of all products.</returns>
        public static List <Product> getProductList()
        {
            int     numRows = 0;
            DataSet ds      = dataAccess.ExecuteSQLStatement(SQLStrings.getAllProducts(), ref numRows);

            if (numRows == 0)
            {
                return(null);
            }
            List <Product> products = new List <Product>();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                Product p = new Product();
                p.ProductCode        = row[0].ToString();
                p.ProductDescription = row[1].ToString();
                p.ProductCost        = double.Parse(row[2].ToString());
                products.Add(p);
            }
            return(products);
        }
Esempio n. 2
0
        /// <summary>
        /// returns a DataSet of all item from the ItemDesc table
        /// </summary>
        /// <param name="iRowCount"></param>
        /// <returns></returns>
        public static DataSet getProductDataSet(ref int iRowCount)
        {
            DataSet ds = new DataSet();

            return(ds = dataAccess.ExecuteSQLStatement(SQLStrings.getAllProducts(), ref iRowCount));
        }