Esempio n. 1
0
        public IActionResult SearchResults(RoomSearchModel searchModel)
        {
            ViewData["Cities"]      = formBuilder.GetCities();
            ViewData["RoomTypes"]   = formBuilder.GetRoomTypes();
            ViewData["SearchModel"] = searchModel;
            IEnumerable <Room> results;

            if (ModelState.IsValid)
            {
                results = roomSearchBuilder.Build(searchModel);
            }
            else
            {
                results = new List <Room>();
            }
            return(View(results));
        }
Esempio n. 2
0
 public IActionResult Index()
 {
     ViewData["Cities"]    = formBuilder.GetCities();
     ViewData["RoomTypes"] = formBuilder.GetRoomTypes();
     return(View());
 }