Exemplo n.º 1
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());
        }
Exemplo n.º 2
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")));
            }
        }
Exemplo n.º 3
0
        //public ActionResult EditProfile(string username)
        //{
        //    var objSearchViewerProfile = ViewerProfilesDAL.Up(username);
        //    return View(objSearchViewerProfile);
        //}
        //[HttpPost]
        //public ActionResult EditProfile(int Viewersid, ViewerProfile objViewerProfileUpdate)
        //{
        //    var IsUpdated = ViewerProfilesDAL.UpdateViewerProfileBL(objViewerProfileUpdate);
        //    if (IsUpdated)
        //        return RedirectToAction("Index");
        //    else
        //        return View(objViewerProfileUpdate);
        //}


        public ActionResult ProfileDetails(string id)///////////////////////
        {
            if (id == null)
            {
                id = Request.QueryString["username"];
            }
            var objSearchViewerProfile = ViewrProfilesBL.SearchViewerProfileByUsernameBL(id);////////////////////

            return(View(objSearchViewerProfile));
        }
Exemplo n.º 4
0
        public ActionResult CreateProfile(ViewerProfileEntity objNewViewerProfiles)
        {
            objNewViewerProfiles.UserName = Request.QueryString["username"];
            var IsAdded = ViewrProfilesBL.AddViewerProfileBL(objNewViewerProfiles);

            if (IsAdded)
            {
                string url = string.Format("/ViewerProfiles/ProfileDetails?username={0}", Request.QueryString["username"]);
                return(Redirect(url));
            }

            else
            {
                return(View(objNewViewerProfiles));
            }
        }
Exemplo n.º 5
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")));
            }
        }
Exemplo n.º 6
0
        public ActionResult LogIn(UserEntity userLogin)///////////////////////
        {
            var isLoggedIn = UserBL.LogInBL(userLogin);

            if (isLoggedIn)
            {
                int viewerID = ViewrProfilesBL.SearchViewerProfileByUsernameBL(userLogin.UserName).ViewersId;

                string url = string.Format("/Movies/ListAllMovies?username={0}", userLogin.UserName);
                Session["Username"] = userLogin.UserName;
                Session["ViewerId"] = viewerID;

                return(Redirect(url));
            }

            else
            {
                ViewBag.InvalidCredentials = "Invalid Credentials";
                return(View(userLogin));
            }
        }