예제 #1
0
        public Cocktails getCocktail()
        {
            IngredientDal     cocDal = new IngredientDal();
            List <Ingredient> ings   = cocDal.findIngredients(cid);
            Category          cat    = (Category)category;

            return(new Cocktails(cid, ings, cat, preperation, video, name));
        }
예제 #2
0
        // Check validation of cocktail form
        public bool checkCocktailForm(Cocktails cocktail)
        {
            IngredientDal ingdal = new IngredientDal();

            foreach (Ingredient ing in cocktail.ing)
            {
                if (ing.name == "" || ing.amount == "" || ingdal.locate(ing.name, cocktail.cid))
                {
                    return(false);
                }
            }
            return(true);
        }