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); }
public FoodComponent GetItem(int id, ItemType type) { FoodComponent result = null; BaBuDataAccess bda = new BaBuDataAccess(); result = bda.GetItem(id, type); return(result); }
public FoodComponent SaveItem(FoodComponent item, ItemType type) { FoodComponent result = null; BaBuDataAccess bda = new BaBuDataAccess(); result = bda.SaveItem(item, type); return(result); }
public FoodComponent[] GetItemList(ItemType type) { FoodComponent[] result = null; BaBuDataAccess bda = new BaBuDataAccess(); result = bda.GetAllItems(type).ToArray <FoodComponent>(); return(result); }
public bool DeleteUser(int id, ItemType type) { BaBuDataAccess uda = new BaBuDataAccess(); return(uda.DeleteItem(id, type)); }