public ActionResult CinemaJourney(int customerId) { var tickets = ticketService.GetAll().Where(r => r.CustomerId == customerId).ToList(); List <Showtime> lstShowtime = new List <Showtime>(); foreach (var item in tickets) { var showtime = showtimeService.GetShowtime(item.ShowtimeId); if (lstShowtime.Contains(showtime) == false) { lstShowtime.Add(showtime); } } var seats = from t in ticketService.GetAll() join s in showtimeService.GetAll() on t.ShowtimeId equals s.ShowtimeId where t.CustomerId == customerId select t.Seat; ViewBag.Ticket = tickets; ViewBag.Seat = seats.ToList(); return(PartialView("_CinemaJourney", lstShowtime)); }
public ActionResult Details(int id) { var result = Authenticate(); if (result == 1) { Showtime showtime = showtimeService.GetShowtime(id); if (showtime == null) { return(HttpNotFound()); } return(View(showtime)); } else { return(View("Error404")); } }
// GET: Booking public ActionResult Index(int showtimeId) { Session["CurrentUrl"] = Request.Url; if (Session["Customer"] == null) { return(RedirectToAction("Index", "Login")); } else { var roomId = showtimeService.GetShowtime(showtimeId).RoomId; var seatVM = new SeatViewModel() { SeatModel = seatService.GetAll().Where(n => n.RoomId == roomId).ToList() }; ViewBag.MaxColumn = seatService.GetAll().Max(c => Convert.ToInt32(c.ColumnSeat)).ToString(); ViewBag.Showtime = showtimeService.GetAll().Where(n => n.ShowtimeId == showtimeId).ToList(); ViewBag.ShowtimeId = showtimeId; return(View(seatVM)); } }
public JsonResult FilmDetail(int showtimeId) { var showtime = showtimeService.GetShowtime(showtimeId); return(Json(new { response = true, filmName = showtime.Film.Name, queue = showtime.Queue, cinemaName = showtime.Room.Cinema.Name, cinemaAddress = showtime.Room.Cinema.Address, showDate = showtime.ShowDate }, JsonRequestBehavior.AllowGet)); }