コード例 #1
0
        public IActionResult SelectSeat(int?idShow)
        {
            var customer = Middleware.CustomerLogin(HttpContext);

            if (customer == null)
            {
                HttpContext.Session.SetString("err", "1");
                return(Redirect("/login"));
            }
            var show = _context.Movie_Shows.Find(idShow);

            if (show == null)
            {
                return(NotFound());
            }

            ViewBag.Customer = customer;
            ViewBag.Show     = show;
            var room = _context.Rooms.Include(r => r.Cinema).Where(r => r.ID.Equals(show.Room_ID)).First();

            ViewBag.Room = room;
            var movie = _context.Movies.Find(show.Movie_ID);

            ViewBag.Movie = movie;
            var cate = _context.Category_Equipment.ToList();

            ViewBag.listCate = cate;
            var listEquipmentInRoom = _context.Equipments.Include(m => m.Category_Equipment).Where(m => m.Room_ID.Equals(show.Room_ID)).Where(m => m.Status.Equals(1)).ToList();

            ViewBag.listEquipments = listEquipmentInRoom;
            var listBooking = _context.Bookings.Include(m => m.listBookingDetail).Where(b => b.Show_ID.Equals(idShow)).ToList();

            ViewBag.listBooking = listBooking;
            return(View());
        }
コード例 #2
0
        public IActionResult Register()
        {
            var customer = Middleware.CustomerLogin(HttpContext);

            if (customer != null)
            {
                return(Redirect("/"));
            }
            return(View());
        }
コード例 #3
0
        public IActionResult Index()
        {
            var customer = Middleware.CustomerLogin(HttpContext);

            if (customer != null)
            {
                return(Redirect("/"));
            }
            var err = HttpContext.Session.GetString("err");

            if (err == null)
            {
                err = "";
            }
            ViewBag.err = err;
            HttpContext.Session.SetString("err", "");
            return(View());
        }
コード例 #4
0
        public string GetCustomerLogin()
        {
            var customer = Middleware.CustomerLogin(HttpContext);

            return(JsonConvert.SerializeObject(customer));
        }