public void CreateRecipe(string title, string description, string ingrediens, string categoryDescription) { var category = new Category(categoryDescription); var newRecipe = new Recipe(title, description, ingrediens, category.CategoryId); var dbhUpdate = new DBhelperUpdateDelete(); dbhUpdate.DBNewRecipe(newRecipe); }
private void DeleteRecipe() { var recipe = GetRecipeFromlstBox(); var dbhDelete = new DBhelperUpdateDelete(); dbhDelete.DBDeleteRecipe(recipe); MessageBox.Show("Recept Borttaget"); }
public void UpdateRecipe(string title, string description, string ingrediens, int CategoryId) { var recipe = GetRecipeFromlstBox(); var updatedRecipe = new Recipe(recipe.RecipeId, title, description, ingrediens, CategoryId); var dbhUpdate = new DBhelperUpdateDelete(); dbhUpdate.UpdateDBwithRecipe(updatedRecipe); }