示例#1
0
        private void viewShowtimes()
        {
            //Console.WriteLine("sampai sini dong");
            Showtime showtimeList = new Showtime();

            showtimeList.displayTodaysShowtimes();
        }
示例#2
0
        private void removeShowtime()
        {
            Showtime showtime = new Showtime();

            showtime.displayShowtimes();
            showtime.removeShowtime();
        }
示例#3
0
        private void searchShowtimes()
        {
            Showtime showtimeList = new Showtime();

            showtimeList.findMovieShowtimes();
        }
示例#4
0
        private void addShowtime()
        {
            Showtime newShowtime = new Showtime();

            newShowtime.addShowtime();
        }
示例#5
0
        private void viewShowtimes()
        {
            Showtime showtimeList = new Showtime();

            showtimeList.displayShowtimes();
        }
示例#6
0
        public void buyTicket()
        {
            string        input = null;
            string        query = null;
            List <Ticket> selectedTicketList = new List <Ticket>();

            Showtime showtimeList = new Showtime();

            showtimeList.displayTodaysShowtimes();

            Console.Write("Enter showtime ID to purchase ticket: ");
            input = Console.ReadLine();
            int showtimeID = ParseInt(input);

            query = ("SELECT COUNT(*) FROM Showtime WHERE showtimeID=" + showtimeID + ";");
            SQL sql = new SQL();

            if (sql.checkRowExists(query) > 0)
            {
                selectedTicketList = selectTicket();
                int totalNoOfTickets = selectedTicketList.Count;
                Console.WriteLine("Total No. of Tickets: " + totalNoOfTickets);
                showtimeList.viewSeatsLayout(showtimeID);
                string[] selectedSeats = new string[totalNoOfTickets];
                for (int i = totalNoOfTickets, j = 0; i > 0; i--, j++)
                {
                    Console.Write("Please choose the seats ID that you want (" + i + "remainings): ");

                    selectedSeats[j] = Console.ReadLine();
                }
                displayTicketsInformation(selectedTicketList);
                bool online = true;
                while (online)
                {
                    Console.WriteLine("Do you want to proceed to payment? (Y/N)");
                    input = Console.ReadLine();
                    switch (input)
                    {
                    case "Y":

                        Console.WriteLine("The size of ticket list is " + selectedTicketList.Count);
                        showtimeList.reserveSeats(showtimeID, selectedSeats, selectedTicketList);
                        printTickets(showtimeID, selectedTicketList);
                        printReceipt(selectedTicketList);
                        online = false;

                        break;

                    case "N":
                        showtimeList.reserveSeats(showtimeID, selectedSeats, selectedTicketList);
                        Console.WriteLine("Please pay at the counter when you collect your ticket.");
                        Console.WriteLine("Your ticket details:");
                        printTickets(showtimeID, selectedTicketList);
                        online = false;
                        break;

                    default:
                        Console.WriteLine("Invalid Input. Enter either 'Y' or 'N'. Press any key to return to menu.");
                        Console.ReadKey();
                        Console.Clear();
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine("No showtime with the showtime ID given! Please try again later.");
            }
        }