Beispiel #1
0
        public List <Recipe> GetRecipeWithTitleSearchAndCategory(string title)
        {
            var dbh = new DBhelperGetData();

            Recipes = dbh.GetRecipeWithTitleAndCategorySearch(title, CategoryDescription);
            return(Recipes);
        }
Beispiel #2
0
        public Category(int categoryId)
        {
            CategoryId = categoryId;
            var dbh = new DBhelperGetData();

            CategoryDescription = dbh.SetCategoryDescription(CategoryId);
        }
Beispiel #3
0
        public List <Recipe> GetRecipeWithTitleSearch(string title)
        {
            var dbh = new DBhelperGetData();

            Recipes = dbh.GetRecipeWithTitleSearch(title);
            return(Recipes);
        }
Beispiel #4
0
        public Category(string categoryDescription)
        {
            CategoryDescription = categoryDescription;
            var dbh = new DBhelperGetData();

            CategoryId = dbh.SetCategoryId(CategoryDescription);
        }
Beispiel #5
0
        private void FillComboBox()
        {
            var dbmDetData    = new DBhelperGetData();
            var listCategorys = dbmDetData.GetKategorier();

            foreach (var category in listCategorys)
            {
                cBoxCategoryDescription.Items.Add(category.CategoryDescription);
            }
        }
Beispiel #6
0
        private void GetCategory()
        {
            var dbmDetData    = new DBhelperGetData();
            var listCategorys = dbmDetData.GetKategorier();

            cbBoxCatagory.Items.Add("Ingen");
            foreach (var category in listCategorys)
            {
                cbBoxCatagory.Items.Add(category.CategoryDescription);
            }
        }
        private bool CheckIfTitleExist(string title)
        {
            var dbmGetData = new DBhelperGetData();
            var recipe     = dbmGetData.GetRecipe(title, "new");

            if (recipe == null)
            {
                return(false);
            }
            return(true);
        }
Beispiel #8
0
        public Recipe GetRecipeFromlstBox()
        {
            var dbmGetData = new DBhelperGetData();

            return(dbmGetData.GetRecipe(lstRecipeTitles.SelectedItem.ToString()));
        }