public ActionResult Reserve(Guid seanceId) { var seance = mSeanceService.GetById(seanceId); var vm = new ReserveViewModel() { SpectacleName = seance.SpectacleName, ReservedSeatsCount = seance.ReservedSeatsCount, Date = seance.Date }; return View(vm); }
public ActionResult Reserve(ReserveViewModel vm) { if (ModelState.IsValid) { try { mSeanceService.ReserveUserToSeance(vm.SeanceId, User.Identity.Name, vm.SeatsCount); return RedirectToAction("Index", "Home"); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View(vm); } } return View(vm); }