Exemplo n.º 1
0
        public List <Category> GetCategories()
        {
            DataTable dtbl = GetDataTable("spGetCategory");

            List <Category> categories = dtbl.DataTableToList <Category>();

            return(categories);
        }
Exemplo n.º 2
0
        public List <ShoppingCart> GetShoppingCart(string username)
        {
            List <SqlParameter> sqlParams = new List <SqlParameter>();
            SqlParameter        param     = new SqlParameter("@Username", username);

            sqlParams.Add(param);

            DataTable dtbl = GetDataTable("spGetShoppingCart", sqlParams);

            List <ShoppingCart> shoppingCarts = dtbl.DataTableToList <ShoppingCart>();

            return(shoppingCarts);
        }
Exemplo n.º 3
0
        public List <Product> GetProducts(int categoryID, string sortColumn)
        {
            string sql = "select * from Products where CategoryID=" + categoryID;

            if (!string.IsNullOrEmpty(sortColumn))
            {
                sql += " Order by " + sortColumn;
            }

            DataTable      dtbl     = GetDataTable(sql);
            List <Product> products = dtbl.DataTableToList <Product>();

            return(products);
        }