Example #1
0
        public Recipe GetRandomRecipe()
        {
            Recipe result = new Recipe();

            BaBuDataAccess bda = new BaBuDataAccess();

            IList tempList = null;

            tempList             = this.GetRandomContents(bda.GetAllItemsByType(ItemType.Condiment));
            result.CondimentList = tempList.OfType <Condiments>().ToList <Condiments>();
            this.RandomizeCondiments(result.CondimentList);

            tempList          = this.GetRandomContents(bda.GetAllItemsByType(ItemType.Spices));
            result.SpicesList = tempList.OfType <Spices>().ToList <Spices>();

            tempList           = this.GetRandomContents(bda.GetAllItemsByType(ItemType.Garnish));
            result.GarnishList = tempList.OfType <Garnish>().ToList <Garnish>();
            this.RandomizeGarnish(result.GarnishList);

            tempList = this.GetRandomContents(bda.GetAllItemsByType(ItemType.Ingredients));
            result.IngredientsList = tempList.OfType <Ingredients>().ToList <Ingredients>();
            this.RandomizeIngredients(result.IngredientsList);

            tempList = this.GetRandomContents(bda.GetAllItemsByType(ItemType.CookingMethod));
            result.CookingMethodList = tempList.OfType <CookingMethod>().ToList <CookingMethod>();



            return(result);
        }
Example #2
0
        public FoodComponent GetItem(int id, ItemType type)
        {
            FoodComponent result = null;

            BaBuDataAccess bda = new BaBuDataAccess();

            result = bda.GetItem(id, type);

            return(result);
        }
Example #3
0
        public FoodComponent SaveItem(FoodComponent item, ItemType type)
        {
            FoodComponent result = null;

            BaBuDataAccess bda = new BaBuDataAccess();

            result = bda.SaveItem(item, type);

            return(result);
        }
Example #4
0
        public FoodComponent[] GetItemList(ItemType type)
        {
            FoodComponent[] result = null;

            BaBuDataAccess bda = new BaBuDataAccess();

            result = bda.GetAllItems(type).ToArray <FoodComponent>();

            return(result);
        }
Example #5
0
        public bool DeleteUser(int id, ItemType type)
        {
            BaBuDataAccess uda = new BaBuDataAccess();

            return(uda.DeleteItem(id, type));
        }