public ActionResult Search(int page = 1, int pageSize = 6) { //Display Active Search Place ViewBag.isActive = UtilContants.PLACE_NAV; int fromPlace = int.Parse(Request.Params["txtFromPlace"]); ViewBag.fromPlaces = fromPlace; int toPlace = int.Parse(Request.Params["txtToPlace"]); ViewBag.toPlaces = toPlace; DateTime timeBegin = DateTime.Parse(Request.Params["timeBegin"]); ViewBag.timeBegins = timeBegin; int traveler = int.Parse(Request.Params["traveler"]); ViewBag.travelers = traveler; var search = new SearchTourModel(); var searchResult = search.tourSearchTour(fromPlace, toPlace, timeBegin, traveler).ToPagedList(page, pageSize); TourModel home = new TourModel(); // this row will show when user search empty ViewBag.fromPlaceError = fromPlace; ViewBag.toPlaceError = toPlace; var listComboBoxToPlace = home.listComboBoxToPlace(); var listComboBoxFromPlace = home.listComboBoxFromPlace(); ListContainerTravel listContainer = new ListContainerTravel(); listContainer.Tour = searchResult; listContainer.listComboBoxFromPlace = listComboBoxFromPlace; listContainer.listComboBoxToPlace = listComboBoxToPlace; return(View(listContainer)); }
public ActionResult Index() { //Display Active Home ViewBag.isActive = UtilContants.HOME_NAV; TourModel model = new TourModel(); var tour = model.listTourHot(); var hotel = model.listHotel(); var listComboBoxToPlace = model.listComboBoxToPlace(); var listComboBoxFromPlace = model.listComboBoxFromPlace(); TourHotel listContainer = new TourHotel(); listContainer.Tour = tour; listContainer.Hotel = hotel; listContainer.listComboBoxFromPlace = listComboBoxFromPlace; listContainer.listComboBoxToPlace = listComboBoxToPlace; return(View(listContainer)); }
public ActionResult Tour(int page = 1, int pageSize = 6) { //Display Active Tour ViewBag.isActive = UtilContants.PLACE_NAV; ToursModel model = new ToursModel(); TourModel home = new TourModel(); var tours = model.listAllTours().ToPagedList(page, pageSize); var listComboBoxToPlace = home.listComboBoxToPlace(); var listComboBoxFromPlace = home.listComboBoxFromPlace(); ListContainerTravel listContainer = new ListContainerTravel(); listContainer.Tour = tours; listContainer.listComboBoxFromPlace = listComboBoxFromPlace; listContainer.listComboBoxToPlace = listComboBoxToPlace; return(View(listContainer)); }