Example #1
0
 public UpdateFlightWindow(string numFlight, SelectedFlightWindow SFW)
 {
     InitializeComponent();
     controllerObj   = new Controller();
     FlightNo        = numFlight;
     selectFlightWin = SFW;
 }
Example #2
0
        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string FlightNo;

            if (dataGridView2.Rows[e.RowIndex].Cells[0].Value != null)
            {
                FlightNo = dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString();
                SelectedFlightWindow f = new SelectedFlightWindow(FlightNo);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string timeIn      = textBox1.Text == "" ? time : textBox1.Text;
            string terminalIn  = textBox3.Text == "" ? terminal : textBox3.Text;
            string runwayIn    = textBox2.Text == "" ? runway : textBox2.Text;
            string planeTypeIn = textBox4.Text == "" ? planeType : textBox4.Text;
            int    r           = controllerObj.UpdateFlight(FlightNo, ArrDep, timeIn, city, airline, terminalIn, runwayIn, planeTypeIn);

            if (r == 0)
            {
                MessageBox.Show("Update Failed!");
            }
            else
            {
                MessageBox.Show("Update Successful!");
                this.Hide();
                SelectedFlightWindow S = new SelectedFlightWindow(FlightNo);
                this.Hide();
                S.ShowDialog();
                this.Show();
            }
        }