public bool ContainsIngredient(string name) { INamirnica repo = RepoFactory.GetNamirnicaRepo(); List <NamirniceModel> kolekcijaNamirnica = repo.getIngredients("sve"); bool result = false; foreach (var item in kolekcijaNamirnica) { if (item.NazivNamirnice.ToLower() == name.ToLower()) { result = true; break; } } return(result); }
private void BindDataToGridView(string selectedType) { gvNamirnice.DataSource = repo.getIngredients(selectedType); gvNamirnice.DataBind(); }