public IActionResult OrderTickets(CreateOrderBindingModel model) { if (!this.ModelState.IsValid) { return(this.RedirectToAction("All", "Events", model)); } try { this.ordersService.CreateOrder(model); } catch (Exception e) { var errorModel = new NotEnoughTicketsErrorViewModel(); errorModel.TotalTickets = e.Data["Tickets"].ToString(); return(this.RedirectToAction("NotEnoughTicketsError", errorModel)); } return(this.RedirectToAction("My", "Events")); }
public IActionResult NotEnoughTicketsError(NotEnoughTicketsErrorViewModel model) { return(this.View(model)); }