Ejemplo n.º 1
0
        public ActionResult Create(Guid theaterId)
        {
            var model = new CreateTheaterShowTimeViewModel();

            model.TheatreId = theaterId;
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Create(CreateTheaterShowTimeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var theaterShowtime = Mapper.Map <CreateTheaterShowTimeViewModel, TheatreShowTimings>(model);

            var result = new TheatreShowTimings();

            using (var repo = new Repository <TheatreShowTimings>())
            {
                result = repo.InsertOrUpdate(theaterShowtime);
            }
            return(RedirectToAction("Detail", "Theatres", new { id = result.TheatreId }));
        }