示例#1
0
        public ActionResult ViewCurrentMovies()
        {
            //Authentication
            string type = (string)Session["UserRole"];
            if (type == null)
            {
                return RedirectToAction("Register", "UserAccount");
            }
            else if (type.CompareTo("U") != 0)
            {
                Session["UserID"] = null;
                Session["UserRole"] = null;
                return RedirectToAction("Login", "UserAccount");
            }

            MovieDAL agent = new MovieDAL();
            List<ViewCurrentMovies> movieList = agent.CurrentMovies();

            return View(movieList);
        }
示例#2
0
        public ActionResult ViewMovieBookings()
        {
            //Authentication
            string type = (string)Session["UserRole"];
            if (type == null)
            {
                return RedirectToAction("Register", "UserAccount");
            }
            else if (type.CompareTo("U") != 0)
            {
                Session["UserID"] = null;
                Session["UserRole"] = null;
                return RedirectToAction("Login", "UserAccount");
            }

            MovieDAL agent = new MovieDAL();
            var temp = Session["UserID"];
            var userId = Convert.ToInt32(temp.ToString());
            List<ViewMovieBookings> bookingList = agent.Bookings(userId);

            return View(bookingList);
        }
示例#3
0
        public ActionResult ViewAll()
        {
            //Authentication
            string type = (string)Session["UserRole"];
            if (type == null)
            {
                return RedirectToAction("Register", "UserAccount");
            }
            else if (type.CompareTo("U") != 0)
            {
                Session["UserID"] = null;
                Session["UserRole"] = null;
                return RedirectToAction("Login", "UserAccount");
            }

            var temp = Session["UserID"];
            var userId = Convert.ToInt32(temp.ToString());
            MovieDAL agent1 = new MovieDAL();
            FoodDAL agent2 = new FoodDAL();
            PartyDAL agent3 = new PartyDAL();

            AllBookings bookingCollection = new AllBookings();

            bookingCollection.MovieBookings = agent1.Bookings(userId);
            bookingCollection.FoodBookings = agent2.MealBookings(userId);
            bookingCollection.PartyBookings = agent3.Bookings(userId, "");

            return View(bookingCollection);
        }