Ejemplo n.º 1
0
 public IActionResult CreateShow(CreateShowRequest request)
 {
     if (ModelState.IsValid)
     {
         var show = new Show
         {
             DateTime      = request.Date,
             MovieId       = request.Movie,
             Price         = request.Price,
             PriceInPoints = request.PriceInPoints,
             RoomId        = request.Room,
             ShowId        = Guid.NewGuid().ToString()
         };
         AdministrationRepository.AddShow(show);
         return(RedirectToAction("GetShows"));
     }
     foreach (var error in ModelState.Values)
     {
         foreach (var item in error.Errors)
         {
             Logger.LogError(item.ErrorMessage);
         }
     }
     return(View("Getshows"));
 }