Example #1
0
        public CatProductTopping SelectCatProductToppingByIdCat(int idCat)
        {
            Category cat = new GlobalDAO().SelectCatByIdCat(idCat);
            List <ProductTopping> products   = new GlobalDAO().SelectAllProductToppingByIdCat(idCat);
            CatProductTopping     catProduct = new CatProductTopping(products, cat);

            return(catProduct);
        }
Example #2
0
        public Object GetRating()
        {
            Category cat = new CoffeeDAO().SelectCatRating();
            List <ProductTopping> products   = new CoffeeDAO().SelectAllProductToppingByRating();
            CatProductTopping     catProduct = new CatProductTopping(products, cat);

            return((Object)catProduct);
        }
Example #3
0
        public Object SelectCatProductToppingByIdCat(int idCat)
        {
            Category cat = new CoffeeDAO().SelectCatByIdCat(idCat);
            List <ProductTopping> products   = new CoffeeDAO().SelectAllProductToppingByIdCat(idCat);
            CatProductTopping     catProduct = new CatProductTopping(products, cat);

            return((Object)catProduct);
        }
Example #4
0
        public Object SelectCatProductToppingByName(string name)
        {
            int count = new CoffeeDAO().SelectAllCategory().Count();
            List <CatProductTopping> listCatProduct = new List <CatProductTopping>();

            for (int i = 1; i <= count; i++)
            {
                Category cat = new CoffeeDAO().SelectCatByIdCat(i);
                List <ProductTopping> products   = new CoffeeDAO().SearchProToppingByNameIdCat(name, i);
                CatProductTopping     catProduct = new CatProductTopping(products, cat);
                if (products.Count() > 0)
                {
                    listCatProduct.Add(catProduct);
                }
            }
            return((Object)listCatProduct);
        }