public ActionResult Create(Guid theaterId) { var model = new CreateTheaterShowTimeViewModel(); model.TheatreId = theaterId; return(View(model)); }
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 })); }