// // GET: /ReservationBegin/ public ActionResult Index() { var member = this.LoggedInMember; if (member != null) { var rim = new ReservationInputModel { NumberOfPlayers = member.DefaultNumberOfPlayers }; Information("We filled in the number of players for you, based on your profile settings"); return View(rim); } return View(new ReservationInputModel()); }
public ActionResult Index(ReservationInputModel model) { if (ModelState.IsValid) { try { var request = new ReservationPossible(); request.Reservation = Mapper.Map<ReservationType>(model); var response = this.CurrentAPIClient.Post<ReservationPossibleResponse>( "/reservation/possible", request); if (response.IsPossible) { this.CurrentReservation = Mapper.Map<ReservationType>(model); return RedirectToAction("ContactInfo"); } Information("Unfortunately this particular reservation is not possible, but please look at the page for suggestions."); model.Suggestions = response.Suggestions; return View(model); } catch (WebServiceException ex) { Error("Awww, something terrible happened. The Leprechauns are working on the problem se please try again later. Techical details: " + ex.Message); return View(model); } } Error("Darn, Something in your input was not correct. Please check it."); return View(model); }