Пример #1
0
 // GET: Projections/Create
 public ActionResult Create()
 {
     try
     {
         ViewBag.Halls  = getHalls.Execute(new HallQuery()).Data;
         ViewBag.Movies = getMovies.Execute(new MovieQuery()).Data;
         return(View());
     }
     catch (EntityNotAllowedException)
     {
         return(RedirectToAction("PageNotFound", "Redirections"));
     }
     catch (Exception e)
     {
         TempData["error"] = e.Message;
     }
     return(RedirectToAction(nameof(Create)));
 }
Пример #2
0
 public IActionResult Get([FromQuery] HallQuery query)
 {
     try
     {
         return(Ok(getHalls.Execute(query)));
     }
     catch (Exception e)
     {
         return(StatusCode(500, new
         {
             Errors = new List <string> {
                 e.Message
             }
         }));
     }
 }
Пример #3
0
 public IActionResult ShowSeats(int projection, int hall)
 {
     try
     {
         ViewBag.Taken      = takenSeats.Execute(projection);
         ViewBag.Projection = getProjection.Execute(projection);
         ViewBag.Halls      = getHalls.Execute(new HallQuery {
             Id = hall
         }).Data;
         ViewBag.Rows = getSeats.Execute(new SeatQuery {
             HallId = hall, PerPage = 1000
         }).Data;
         ViewBag.Taken = takenSeats.Execute(projection);
         return(View());
     }
     catch (Exception e)
     {
         TempData["error"] = e.Message;
     }
     return(RedirectToAction(nameof(Index)));
 }