Ejemplo n.º 1
0
        static void Main()
        {
            AirlineCoordinator coordinator = new AirlineCoordinator(100, 50, 5);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Home(coordinator));
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public Home(AirlineCoordinator coordinator)
 {
     this.coordinator = coordinator;
     InitializeComponent();
 }
Ejemplo n.º 8
0
 public AddFlight(AirlineCoordinator c)
 {
     this.coordinator = c;
     InitializeComponent();
 }
Ejemplo n.º 9
0
 public static void viewCustomer(AirlineCoordinator f)
 {
     Console.WriteLine(f.customerList());
 }
Ejemplo n.º 10
0
 public static void viewFlight(AirlineCoordinator f)
 {
     Console.WriteLine(f.flightList());
 }
Ejemplo n.º 11
0
 public static void exit(AirlineCoordinator f)
 {
     Console.Write("Goodbye... Thank you for using our system");
 }
Ejemplo n.º 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();
 }