Exemple #1
0
    { /*
      ** author: Damjan Miloshevski
      ** contact: [email protected];
      ** skype: damjan.milosevski
      ** phone: +38978566409;
      ** web: https://www.facebook.com/damjan.miloshevski
      **        http://miloshevski.us.to/
      */
        public Airports()
        {
            InitializeComponent();

            Airport a = new Airport();

            a.Name  = "Alexander The Great Airport";
            a.City  = "Skopje";
            a.Short = "SKP";
            a.AddDestination(new Destination("Istanbul", 850, 145));
            Airport i = new Airport();

            i.Name  = "Atatürk Airport";
            i.City  = "Istanbul";
            i.Short = "IST";
            i.AddDestination(new Destination("Skopje", 850, 145));
            i.AddDestination(new Destination("New York City", 3521, 720));
            i.AddDestination(new Destination("Moscow", 1520, 350));
            i.AddDestination(new Destination("Barcelona", 1100, 450));
            i.AddDestination(new Destination("Chicago", 5986, 380));
            Airport l = new Airport();

            l.Name  = "Heathrow Airport";
            l.City  = "London";
            l.Short = "LHR";
            l.AddDestination(new Destination("Toronto", 1300, 480));
            Airport n = new Airport();

            n.Name  = "John F. Kennedy International Airport";
            n.Short = "JFK";
            n.City  = "New York City";
            n.AddDestination(new Destination("Sydney", 2250, 536));
            Airport f = new Airport();

            f.Name  = "Frankfurt Airport";
            f.City  = "Frankfurt";
            f.Short = "FRA";
            f.AddDestination(new Destination("Skopje", 1120, 280));
            Airport y = new Airport();

            y.Name  = "Schiphol Airport";
            y.City  = "Amsterdam";
            y.Short = "AMS";
            y.AddDestination(new Destination("Moscow", 480, 320));
            Airport c = new Airport();

            c.Name  = "Charles de Gaulle Airport";
            c.City  = "Paris";
            c.Short = "CDG";
            c.AddDestination(new Destination("Melbourne", 6850, 1450));

            lstAirports.Items.Add(a);
            lstAirports.Items.Add(i);
            lstAirports.Items.Add(l);
            lstAirports.Items.Add(n);
            lstAirports.Items.Add(c);
            lstAirports.Items.Add(f);
            lstAirports.Items.Add(y);
        }
Exemple #2
0
 public Form1()
 {
     InitializeComponent();
     Airport airport = new Airport("Александар Велики", "Скопје", "SKP");
     airport.AddDestination(new Destination("Виена", 1240, 260));
     lbAirports.Items.Add(airport);
     loadDestinations();
 }
        public Form1()
        {
            InitializeComponent();
            Airport airport = new Airport("Скопје", "Александар Велики", "SKP");

            airport.AddDestination(new Destination("Виена", 1240, 260));
            lbAirports.Items.Add(airport);
            loadDestinations();
        }
Exemple #4
0
        public Form1()
        {
            InitializeComponent();
            Airport airport = new Airport("Alexander The Great", "Skopje", "SKP");

            airport.AddDestination(new Destination("Vienna", 1240, 260));
            lbAirports.Items.Add(airport);
            loadDestinations();
        }
Exemple #5
0
        private void btnAddDestination_Click(object sender, EventArgs e)
        {
            AddDestination addDestination = new AddDestination();

            if (addDestination.ShowDialog() == DialogResult.OK)
            {
                Airport airport = lbAirports.SelectedItem as Airport;
                airport.AddDestination(addDestination.Destination);
                loadDestinations();
            }
        }
Exemple #6
0
        private void btnAddDestination_Click(object sender, EventArgs e)
        {
            AddDestination form = new AddDestination();

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Airport airport = lbAirports.SelectedItem as Airport;
                airport.AddDestination(form.Destination);
                loadDestinations();
            }
        }
Exemple #7
0
 private void btnAddDestination_Click(object sender, EventArgs e)
 {
     if (btnAddDestination.Enabled)
     {
         AddDestination ad  = new AddDestination();
         DialogResult   res = ad.ShowDialog();
         if (res == DialogResult.OK)
         {
             Airport a = lstAirports.SelectedItem as Airport;
             a.AddDestination(ad.Destination);
             loadDestinations();
         }
     }
 }