Beispiel #1
0
        public ActionResult CreateShow(ShowEntity show)
        {
            bool isAdded = false;
            List <SelectListItem> screenList = ScreenBL.ViewAllScreenBL().Select(n => new SelectListItem {
                Value = n.ScreenId.ToString(), Text = n.ScreenName
            }).ToList();;

            var genreTip = new SelectListItem()
            {
                Value = null,
                Text  = "--- select screen ---"
            };

            screenList.Insert(0, genreTip);
            ViewBag.screenList = new SelectList(screenList, "Value", "Text");
            if (ModelState.IsValid)
            {
                isAdded = ShowsBL.AddShowBL(show);
                if (isAdded)
                {
                    return(RedirectToAction("IndexShowAdmin"));
                }
            }


            return(View(show));
        }
Beispiel #2
0
        // GET: Tickets/Details/5

        public ActionResult CreateTicket()
        {
            int    nooftickets = int.Parse(Request.QueryString["noofseats"]);
            int    viewerId    = int.Parse(Request.QueryString["viewerid"]);
            int    showId      = int.Parse(Request.QueryString["showid"]);
            int    movieId     = int.Parse(Request.QueryString["movieId"]);
            string seatnos     = Request.QueryString["seatnumbers"];


            ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(viewerId);
            ShowEntity          show   = ShowsBL.SearchShowByIdBL(showId);
            MovyEntity          movie  = MovieBL.SearchMovieByIdBL(movieId);
            ScreenEntity        screen = ScreenBL.SearchScreenByIdBL(show.ScreenId);

            ViewBag.ShowDate       = show.ShowDate.ToShortDateString();
            ViewBag.ShowId         = show.ShowId;
            ViewBag.ViewerId       = viewer.ViewersId;
            ViewBag.MovieName      = movie.MovieName;
            ViewBag.Price          = show.Price * nooftickets;
            ViewBag.NameOfCustomer = viewer.FirstName + " " + viewer.LastName;
            ViewBag.ScreenName     = screen.ScreenName;

            ViewBag.noOfTickets = nooftickets;
            ViewBag.seatNos     = seatnos;

            return(View());
        }
Beispiel #3
0
        public ActionResult ViewTicket(int id)
        {
            TicketEntity createTicket = new TicketEntity();

            createTicket = TicketsBL.SearchTicketByIdBL(id);

            ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(createTicket.ViewersId);
            ShowEntity          show   = ShowsBL.SearchShowByIdBL(createTicket.ShowId);
            MovyEntity          movie  = MovieBL.SearchMovieByIdBL(createTicket.MovieId);
            ScreenEntity        screen = ScreenBL.SearchScreenByIdBL(show.ScreenId);


            ViewBag.ShowDate       = show.ShowDate.ToShortDateString();
            ViewBag.ShowId         = show.ShowId;
            ViewBag.ViewerId       = viewer.ViewersId;
            ViewBag.MovieName      = movie.MovieName;
            ViewBag.Price          = show.Price * createTicket.NoOfTickets;
            ViewBag.NameOfCustomer = viewer.FirstName + " " + viewer.LastName;
            ViewBag.ScreenName     = screen.ScreenName;

            ViewBag.noOfTickets = createTicket.NoOfTickets;
            ViewBag.seatNos     = createTicket.Seats;


            if (createTicket != null)
            {
                return(View());
            }
            else
            {
                return(Redirect(string.Format("/Movies/ListAllMovies")));
            }
        }
Beispiel #4
0
        public ActionResult DetailsShow(int id)
        {
            ShowEntity show = ShowsBL.SearchShowByIdBL(id);

            if (show == null)
            {
                return(HttpNotFound());
            }
            return(View(show));
        }
Beispiel #5
0
        public ActionResult DeleteShowConfirmed(int id)
        {
            bool isDeleted = false;

            isDeleted = ShowsBL.DeleteShowBL(id);
            if (isDeleted)
            {
                return(RedirectToAction("Index/1"));
            }
            return(HttpNotFound());
        }
Beispiel #6
0
        // GET: Shows/Delete/5
        public ActionResult DeleteShow(int id)
        {
            //if (id == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            ShowEntity show = ShowsBL.SearchShowByIdBL(id);

            if (show == null)
            {
                return(HttpNotFound());
            }
            return(View(show));
        }
Beispiel #7
0
        public ActionResult EditShow(ShowEntity show)
        {
            bool isUpdated = false;

            if (ModelState.IsValid)
            {
                isUpdated = ShowsBL.UpdateShowBL(show);
                if (isUpdated)
                {
                    return(RedirectToAction("Index/1"));
                }
            }

            return(View(show));
        }
Beispiel #8
0
        public ActionResult CreateTicket(TicketEntity ticket)
        {
            int    nooftickets = int.Parse(Request.QueryString["noofseats"]);
            int    viewerId    = int.Parse(Request.QueryString["viewerid"]);
            int    showId      = int.Parse(Request.QueryString["showid"]);
            int    movieId     = int.Parse(Request.QueryString["movieId"]);
            string seatnos     = Request.QueryString["seatnumbers"];

            ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(viewerId);
            ShowEntity          show   = ShowsBL.SearchShowByIdBL(showId);
            MovyEntity          movie  = MovieBL.SearchMovieByIdBL(movieId);
            ScreenEntity        screen = ScreenBL.SearchScreenByIdBL(show.ScreenId);

            TicketEntity createTicket = new TicketEntity();

            createTicket.NoOfTickets     = nooftickets;
            createTicket.ShowId          = showId;
            ViewBag.MovieName            = movie.MovieName;
            createTicket.Price           = show.Price * nooftickets;
            createTicket.ViewersId       = viewer.ViewersId;
            createTicket.TransactionDate = DateTime.Now.Date;
            createTicket.MovieId         = movie.MovieId;
            createTicket.Seats           = seatnos;

            if (ModelState.IsValid)
            {
                var IsAdded = TicketsBL.CreateTicketBL(createTicket);
                if (IsAdded)
                {
                    return(Redirect(string.Format("/Payments/CompletePayment")));
                }
                else
                {
                    return(Redirect(string.Format("/SeatLayout/SelectSeatsView")));
                }
            }
            else
            {
                return(Redirect(string.Format("/SeatLayout/SelectSeatsView")));
            }
        }
Beispiel #9
0
 // GET: Shows
 public ActionResult IndexShowAdmin()
 {
     return(View(ShowsBL.GetAllShowsAdminBL()));
 }
 // GET: Shows
 public ActionResult GetShows(int id)
 {
     return(View(ShowsBL.GetAllShowsBL(id)));
 }