static void Main()
        {
            AirlineCoordinator coordinator = new AirlineCoordinator(100, 50, 5);

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