public EditIngredientsViewModel(EditIngredients editOpen, tblRecipe recipeForEdit) { editIngView = editOpen; recipe = recipeForEdit; Ingredient = new tblIngredient(); ingredient.recipeId = recipeForEdit.recipeId; IngredientList = service.AllIngredientForRecipe(recipe.recipeId); }
public CalculateQuantityViewModel(CalculateQuantity open, tblRecipe rec) { view = open; recipe = rec; allIngredients = service.AllIngredientForRecipe(rec.recipeId); list = new List <Quantity>(); }
public void RemoveIngredientExecute() { try { if (Ingredient != null) { //invokes method to delete ingredient service.DeleteIngredient(Ingredient); //invokes method to update list of ingredients IngredientList = service.AllIngredientForRecipe(Recipe.recipeId); Ingredient = new tblIngredient(); Ingredient.recipeId = Recipe.recipeId; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }