コード例 #1
0
ファイル: HomeController.cs プロジェクト: vovopap/dbsd
        public ActionResult Index(string fTitle, string fDescription)
        {
            FlowerCategoryManager  categoryManager = new FlowerCategoryManager();
            IList <FlowerCategory> list            = categoryManager.GetFlowerCategories();

            return(View(list));
        }
コード例 #2
0
ファイル: FlowerController.cs プロジェクト: vovopap/dbsd
        // 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));
        }