コード例 #1
0
        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);
        }
コード例 #2
0
        private void DeleteRecipe()
        {
            var recipe    = GetRecipeFromlstBox();
            var dbhDelete = new DBhelperUpdateDelete();

            dbhDelete.DBDeleteRecipe(recipe);
            MessageBox.Show("Recept Borttaget");
        }
コード例 #3
0
        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);
        }