public ActionResult Index(string fTitle, string fDescription) { FlowerCategoryManager categoryManager = new FlowerCategoryManager(); IList <FlowerCategory> list = categoryManager.GetFlowerCategories(); return(View(list)); }
// GET: Vacancy public ActionResult Index(int?fCategory, string fName, string fDescription) { FlowerManager manager = new FlowerManager(); FlowerCategoryManager categoryManager = new FlowerCategoryManager(); IList <Flower> list = manager.FilterFlowers(fCategory, fName, fDescription); IList <FlowerCategory> categories = categoryManager.GetFlowerCategories(); foreach (Flower item in list) { item.FlowerCategory = categories.First(d => d.Id == item.FlowerCategoryId); } ViewBag.fTitle = fName; ViewBag.fDescription = fDescription; ViewBag.fCategory = fCategory; ViewBag.categories = categories; return(View(list)); }