コード例 #1
0
        public FormSearchRes(uint flightNumber)
        {
            InitializeComponent();
            airport = new Airport(SaveLoadXML.LoadData());
            Airplane plane = airport.GetPlaneByNumber(flightNumber);

            ListViewItem lvi = new ListViewItem(Convert.ToString(plane.FlightNumber));

            lvi.SubItems.Add(plane.Destination);
            lvi.SubItems.Add(plane.DepartureTime.ToString());
            lvSearchRes.Items.Add(lvi);
        }
コード例 #2
0
        private void btnAddNewFlight_Click(object sender, EventArgs e)
        {
            List <Airplane> planes   = new List <Airplane>();
            Airplane        airplane = new Airplane(tbDestination.Text, Convert.ToUInt32(tbFlightNumber.Text), dtpDepartureTime.Value);

            planes.Add(airplane);
            SaveLoadXML.SaveData(planes);

            Random rnd          = new Random();
            string flightNumber = Convert.ToString(rnd.Next(999999));

            tbFlightNumber.Text = flightNumber;
        }
コード例 #3
0
 public FormSearchRes(DateTime departureTime)
 {
     InitializeComponent();
     airport        = new Airport(SaveLoadXML.LoadData());
     airport.Planes = airport.GetPlanesByTime(departureTime);
     airport.SortPlanesByTime();
     foreach (var plane in airport.Planes)
     {
         ListViewItem lvi = new ListViewItem(Convert.ToString(plane.FlightNumber));
         lvi.SubItems.Add(plane.Destination);
         lvi.SubItems.Add(plane.DepartureTime.ToString());
         lvSearchRes.Items.Add(lvi);
     }
 }