예제 #1
0
        static void Main()
        {
            AirlineCoordinator coordinator = new AirlineCoordinator(100, 50, 5);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Home(coordinator));
        }
예제 #2
0
        public static void deleteCustomer(AirlineCoordinator f)
        {
            viewCustomer(f);
            Console.Write("Please enter a customer id to delete: ");
            int cld;

            if (Int32.TryParse(Console.ReadLine(), out cld))
            {
                f.deleteCustomer(cld);
            }
        }
예제 #3
0
        public static void deleteFlight(AirlineCoordinator f)
        {
            viewFlight(f);
            Console.Write("Please enter a flight id to delete: ");
            int fNo;

            if (Int32.TryParse(Console.ReadLine(), out fNo))
            {
                f.deleteFlight(fNo);
            }
        }
예제 #4
0
        public static void addCustomer(AirlineCoordinator f)
        {
            Console.Write("Please enter the customer's first name: ");
            string firstName = Console.ReadLine();

            Console.Write("Please enter the customer's last Name: ");
            string lastName = Console.ReadLine();

            Console.Write("Please enter the customer's phone: ");
            string phoneNumber = Console.ReadLine();

            f.addCustomer(firstName, lastName, phoneNumber);
        }
예제 #5
0
        public static void addBooking(AirlineCoordinator f)
        {
            Console.WriteLine(f.customerList());
            Console.WriteLine(f.flightList());
            Console.Write("Please enter a customerid: ");
            int customerId = Convert.ToInt32(Console.ReadLine());

            Console.Write("Please enter a flight number: ");
            int flightId = Convert.ToInt32(Console.ReadLine());


            f.addBooking(customerId, flightId);
        }
예제 #6
0
        public static void addFlight(AirlineCoordinator f)
        {
            Console.Write("Please enter the flight number: ");
            int flightNumber = 0;

            Int32.TryParse(Console.ReadLine(), out flightNumber);
            while (flightNumber == 0)
            {
                Console.Write("Please enter a valid flight number: ");
                Int32.TryParse(Console.ReadLine(), out flightNumber);
            }

            Console.Write("Please enter the maximum number of seats: ");
            int maxSeats = 0;

            Int32.TryParse(Console.ReadLine(), out maxSeats);
            while (maxSeats == 0)
            {
                Console.Write("Please enter a valid maximum number of seats: ");
                Int32.TryParse(Console.ReadLine(), out maxSeats);
            }

            Console.Write("Please enter the port of origin: ");
            string origin = "";

            origin = Console.ReadLine();
            while (origin == "")
            {
                Console.Write("Please enter a valid port of origin: ");
                origin = Console.ReadLine();
            }

            Console.Write("Please enter the destination port: ");
            string destination = "";

            destination = Console.ReadLine();
            while (destination == "")
            {
                Console.Write("Please enter a valid destination port: ");
                destination = Console.ReadLine();
            }

            f.addFlight(flightNumber, origin, destination, maxSeats);
        }
예제 #7
0
 public Home(AirlineCoordinator coordinator)
 {
     this.coordinator = coordinator;
     InitializeComponent();
 }
예제 #8
0
 public AddFlight(AirlineCoordinator c)
 {
     this.coordinator = c;
     InitializeComponent();
 }
예제 #9
0
 public static void viewCustomer(AirlineCoordinator f)
 {
     Console.WriteLine(f.customerList());
 }
예제 #10
0
 public static void viewFlight(AirlineCoordinator f)
 {
     Console.WriteLine(f.flightList());
 }
예제 #11
0
 public static void exit(AirlineCoordinator f)
 {
     Console.Write("Goodbye... Thank you for using our system");
 }
예제 #12
0
 public static void viewBooking(AirlineCoordinator f)
 {
     Console.Write(f.viewBooking() + f.flightList());
 }
 public ViewFlight(AirlineCoordinator c)
 {
     coordinator = c;
     InitializeComponent();
 }
 public DeleteCustomer(AirlineCoordinator c)
 {
     coordinator = c;
     InitializeComponent();
 }