public ActionResult EditSchedule(string movieID)
        {
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            schedule[] schedules = client.getSchedules(movieID);
            ViewBag.movieID = movieID;
            return(View(schedules));
        }
Esempio n. 2
0
        public ActionResult Pay(reservation reservation)
        {
            if (Session["email"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            CinemaWebServiceClient c = new CinemaWebServiceClient();

            c.updateReservationStatus(reservation.reservationID, "Paid");
            return(RedirectToAction("MyReservation"));
        }
Esempio n. 3
0
        public ActionResult PersonalInfo(string password)
        {
            manager m = new manager();

            m.email    = (string)Session["email"];
            m.password = password;
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            client.updateManagerInfo(m);
            return(View(m));
        }
Esempio n. 4
0
        protected void Application_Start()
        {
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            GlobalVariables.VoucherList = new List <voucher>(client.getAllVouchers());


            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
Esempio n. 5
0
        public ActionResult MyReservation()
        {
            if (Session["email"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            reservation[] r = client.getAllReservationsByCustomer(Session["email"].ToString());

            return(View(r));
        }
Esempio n. 6
0
        public ActionResult MakeVoucher(string code, int percentage)
        {
            voucher v = new voucher();

            v.code       = code;
            v.percentage = percentage;

            CinemaWebServiceClient c = new CinemaWebServiceClient();

            c.createVoucher(v);

            return(RedirectToAction("AllVouchers"));
        }
        public ActionResult PersonalInfo(string firstName, string lastName, string phoneNo, string password)
        {
            customer c = new customer();

            c.firstName = firstName;
            c.lastName  = lastName;
            c.phoneNo   = phoneNo;
            c.email     = (string)Session["email"];
            c.password  = password;
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            client.updateCustomerInfo(c);

            return(View(c));
        }
Esempio n. 8
0
        public ActionResult EditScheduleSaveChanges(int scheduleID, string roomNo, string date, string startTime, string endTime, string movieID)
        {
            schedule schedule = new schedule();

            schedule.roomNo     = roomNo;
            schedule.date       = date;
            schedule.startTime  = startTime;
            schedule.endTime    = endTime;
            schedule.scheduleID = scheduleID;

            CinemaWebServiceClient c = new CinemaWebServiceClient();

            c.updateScheduleInfo(schedule);
            return(RedirectToAction("EditSchedule", "Movie", new { movieID = movieID }));
        }
Esempio n. 9
0
        public ActionResult MakeReservation(int scheduleID, double totalPrice, int numberOfTicket, string seats)
        {
            int?[]      seatsArray = JsonConvert.DeserializeObject <int?[]>(seats);
            reservation r          = new reservation();

            r.scheduleID     = scheduleID;
            r.totalPrice     = totalPrice;
            r.numberOfTicket = numberOfTicket;
            r.seats          = seatsArray;

            CinemaWebServiceClient c = new CinemaWebServiceClient();

            c.makeReservation(r, Session["email"].ToString());


            return(RedirectToAction("MyReservation"));
        }
Esempio n. 10
0
        public ActionResult MakeReservation(int scheduleID, double moviePrice)
        {
            string email = (string)Session["email"];

            if (email == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            CinemaWebServiceClient c = new CinemaWebServiceClient();
            schedule s = c.getScheduleByID(scheduleID);

            ViewBag.scheduleForReservation = s;
            ViewBag.reservedSeats          = reservedSeatsArray(s.seats);
            ViewBag.moviePrice             = moviePrice;

            return(View(""));
        }
Esempio n. 11
0
        public ActionResult Login(string email, string password)
        {
            CinemaWebServiceClient client = new CinemaWebServiceClient();

            user user = client.logIn(email, password);

            if (user != null)
            {
                Session["email"] = user.email;
                Session["role"]  = user.role;

                return(RedirectToAction("Programme"));
            }
            else
            {
                ViewData["Message"] = "User Login Failed";
                return(View());
            }
        }
Esempio n. 12
0
        public ActionResult AddSchedule(string roomNo, string date, string startTime, string endTime, string movieID)
        {
            schedule schedule = new schedule();

            schedule.roomNo    = roomNo;
            schedule.date      = date;
            schedule.startTime = startTime;
            schedule.endTime   = endTime;

            CinemaWebServiceClient c = new CinemaWebServiceClient();
            int result = c.createSchedule(schedule, movieID);

            if (result == -2)
            {
                ViewBag.scheduleOverlap = "Schedule overlap other schedules";
                return(RedirectToAction("AddSchedule", "Movie", new { movieID = movieID }));
            }
            return(RedirectToAction("EditSchedule", "Movie", new { movieID = movieID }));
        }
Esempio n. 13
0
        public ActionResult EditMovie(string movieID, string title, string genre, string director,
                                      string actor, string overview, string language, int lenght, double price, string posterUrl)
        {
            movie m = new movie();

            m.movieID   = movieID;
            m.title     = title;
            m.genre     = genre;
            m.director  = director;
            m.actor     = actor;
            m.overview  = overview;
            m.language  = language;
            m.lenght    = lenght;
            m.price     = price;
            m.posterUrl = posterUrl;

            CinemaWebServiceClient client = new CinemaWebServiceClient();

            client.saveMovie(m);

            return(RedirectToAction("MovieList"));
        }
        public ActionResult Register(string firstName, string lastName, string phoneNo, string email, string password)
        {
            customer c = new customer();

            c.firstName = firstName;
            c.lastName  = lastName;
            c.phoneNo   = phoneNo;
            c.email     = email;
            c.password  = password;

            CinemaWebServiceClient client = new CinemaWebServiceClient();

            try
            {
                client.registerNewCustomer(c);
                return(RedirectToAction("Login", "Home"));
            }
            catch (System.ServiceModel.FaultException e)
            {
                ViewData["Message"] = "Email already in use";

                return(View());
            }
        }