public ActionResult BookATrip(int Guider_Id = 0, int Hotel_Id = 0, int Packages_Id = 0) { //CREATING LISTS var ItemList = ItemsDB_Obj.GetAll(); tbl_Obj.ItemList = new SelectList(ItemList, "ID", "Name"); var PackageList = PackagesDB_Obj.GetAll(); tbl_Obj.PackageList = new SelectList(PackageList, "ID", "PackageName", PackageList.Where(x => x.ID == Packages_Id).Select(item => item.ID).SingleOrDefault()); var HotelsList = HotelsDB_Obj.GetAll(); // here on the basis of id we are selecting the selected item by user in drowp down list tbl_Obj.HotelList = new SelectList(HotelsList, "ID", "Name", HotelsList.Where(x => x.ID == Hotel_Id).Select(item => item.Name).SingleOrDefault()); var GuideList = GuideDB_Obj.GetAll(); // here on the basis of id we are selecting the selected item by user in drowp down list tbl_Obj.GuideList = new SelectList(GuideList, "ID", "Name", GuideList.Where(x => x.ID == Guider_Id).Select(item => item.ID).SingleOrDefault()); return(View(tbl_Obj)); }
public ActionResult CurrentHotels() { var HotelsList = Hotels_Obj.GetAll(); return(View(HotelsList)); }