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); }
public Object GetRating() { Category cat = new CoffeeDAO().SelectCatRating(); List <ProductTopping> products = new CoffeeDAO().SelectAllProductToppingByRating(); CatProductTopping catProduct = new CatProductTopping(products, cat); return((Object)catProduct); }
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); }
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); }