public IActionResult SearchById([Bind("BookingID")] Searchdate request) { try { var details = _b.GetBookingDetails(request.BookingID); return(View(nameof(Confirmation), details)); } catch (Exception ex) { ModelState.AddModelError(ex.Source, ex.Message); } return(View(nameof(Index), request)); }
public IActionResult Search([Bind("StartDate,EndDate")] Searchdate request) { if (ModelState.IsValid) { try { request.Results = _b.SearchAvialableRooms(request.StartDate, request.EndDate); TempData["StartDate"] = request.StartDate; TempData["EndDate"] = request.EndDate; } catch (BookingException ex) { ModelState.AddModelError(ex.Source, ex.Message); } } return(View(nameof(Index), request)); }