public JsonResult GetInitData() { var viewModel = new IngredientMixingViewModel(); viewModel.Ingredients = _ingredientManager.GetAllIngredients(); viewModel.Effects = _ingredientManager.GetAllEffects(); viewModel.Moods = _ingredientManager.GetAllMoods(); viewModel.IngredientMixes = _ingredientManager.GetAllMixes(); return(Json(viewModel, JsonRequestBehavior.AllowGet)); }
public JsonResult Edit(int?id) { var result = new RecipeEditViewModel(); if (id.HasValue) { result.Recipe = _recipeManager.GetRecipe(id.Value); } else { result.Recipe = new Recipe(); } result.Effects = _ingredientManager.GetAllEffects(); result.Moods = _ingredientManager.GetAllMoods(); result.Ingredients = _ingredientManager.GetAllIngredients(); return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult GetMoodsList() { var result = _ingredientManager.GetAllMoods(); return(Json(result, JsonRequestBehavior.AllowGet)); }