private void Button1_Click(object sender, EventArgs e) { FlightDetails flightDetails = new FlightDetails(); if (counter == 1) { ResultsForm resultsForm = new ResultsForm(1); resultsForm.Show(); this.Hide(); } else if (counter == 3) { ResultsForm resultsForm = new ResultsForm(3); resultsForm.Show(); this.Hide(); } else if (counter == 4) { ResultsForm resultsForm = new ResultsForm(4); resultsForm.Show(); this.Hide(); } else if (counter == 7) { ResultsForm resultsForm = new ResultsForm(7); resultsForm.Show(); this.Hide(); } else if (counter == 8) { ResultsForm resultsForm = new ResultsForm(8); resultsForm.Show(); this.Hide(); } }
public ResultsForm(int idFlight) { InitializeComponent(); //bs.DataSource = flightDetails.getSelectedFlight(1);\ FlightDetails flight = new FlightDetails(); bs.DataSource = flight.getSelectedFlight(idFlight); txtName.Text = bs.DataMember = "Name"; txtFuel.Text = bs.DataMember = "Fuel"; txtSpeed.Text = bs.DataMember = "Speed"; }