// GET: Hotels/Details/5 public async Task <IActionResult> Details(int id) { var hotel = await _context.GetHotel(id); if (hotel == null) { return(NotFound()); } return(View(hotel)); }
/// <summary> /// This GET action takes an id and returns the details page for the database object with the same ID /// </summary> /// <param name="id"></param> /// <returns>The result of an action method</returns> public async Task <IActionResult> Edit(int id) { var hotel = await _hotel.GetHotel(id); if (hotel == null) { return(NotFound()); } return(View(hotel)); }
public async Task <ActionResult <HotelDto> > GetHotel(int id) { var hotelDto = await _hotel.GetHotel(id); if (hotelDto == null) { return(NotFound()); } return(hotelDto); }
// GET: Hotels/Details/5 public async Task <IActionResult> Details(int id) { var hotel = await _hotels.GetHotel(id); if (hotel == null) { return(NotFound()); } ViewData["HotelRooms"] = await _hotels.GetHotelRooms(id); return(View(hotel)); }
// GET: Hotels/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var hotels = await _context.GetHotel((int)id); if (hotels == null) { return(NotFound()); } return(View(hotels)); }
// GET: Hotels/Details/5 public async Task <IActionResult> Details(int id) { if (id < 1) { return(NotFound()); } var course = await _context.GetHotel(id); if (course == null) { return(NotFound()); } return(View(course)); }
// GET: Hotels/Details/5 public async Task <IActionResult> Details(int id) { if (id <= 0) { return(NotFound()); } var hotel = await _context.GetHotel(id); var hotelRooms = _context.GetRoomsInHotelRoom(id); HotelRoomVM hrvm = new HotelRoomVM(); hrvm.Hotel = hotel; hrvm.HotelRooms = hotelRooms; if (hotel == null) { return(NotFound()); } return(View(hrvm)); }
public async Task <IActionResult> GetHotel([FromRoute] int id) { var hotel = await _hotel.GetHotel(id); return(Ok(hotel)); }
// GET: api/Booking/5 public HttpResponseMessage GetHotelById(int id) { var hotel = _IHotelManager.GetHotel(id); return(Request.CreateResponse <Hotel>(HttpStatusCode.OK, hotel)); }
public IHttpActionResult GetHotelById(int id) { return(Ok(_hotelManager.GetHotel(id))); }
// GET: Hotel public async Task <IActionResult> Index() { ViewBag.TotalRooms = roomPerHotel.Count(); return(View(await _context.GetHotel())); }