Beispiel #1
0
        public ActionResult GetHotels(string state = null, string city = null, int page = 1)
        {
            if ((state == null && city == null) || (state == "null" && city == "null"))
            {
                DataSet ds = BussLogic.AllAvilableHotel();
                avilableHotel = ds.Tables[0].ToList <AvilableHotel>();
            }
            else if ((city == null) || (city == "null"))
            {
                avilableHotel = avilableHotel.Where(e => e.State.ToLower().Contains(state.ToLower())).ToList();
            }
            else
            {
                avilableHotel = avilableHotel.Where(e => e.State.ToLower().Contains(state.ToLower()) && e.City.ToLower().Contains(city.ToLower())).ToList();
            }

            return(PartialView("_HotelDetails", avilableHotel.ToPagedList <AvilableHotel>(page, 2)));
        }
Beispiel #2
0
        public BookingController()
        {
            DataSet ds = BussLogic.AllAvilableHotel();

            avilableHotel = ds.Tables[0].ToList <AvilableHotel>();
        }