public void BookFlight(string emailAddress, string _class, int terminal, string departure, string arrival, int weight,
                               int passegnerID, string passengerName, string seatColumn, int seatNumber, string flightTo)
        {
            try {
                string        connectionString = "Data Source=KHAN;Initial Catalog=AirLine;Integrated Security=True";
                SqlConnection cn = new SqlConnection(connectionString);
                using (SqlCommand cmd = new SqlCommand(seatQuery, cn))
                {
                    cn.Open();
                    SqlCommand planeCmd = new SqlCommand(planeQuery, cn);
                    int        count    = (Int32)planeCmd.ExecuteScalar();
                    if (count < 50)
                    {
                        cmd.Parameters.AddWithValue("@Class", _class);
                        cmd.Parameters.AddWithValue("@FlightTo", flightTo);
                        cmd.Parameters.AddWithValue("@Terminal", terminal);
                        cmd.Parameters.AddWithValue("@Departure", departure);
                        cmd.Parameters.AddWithValue("@Arrival", arrival);
                        cmd.Parameters.AddWithValue("@Weight", weight);
                        cmd.Parameters.AddWithValue("@PassengerID", passegnerID);
                        cmd.Parameters.AddWithValue("@PassengerName", passengerName);
                        cmd.Parameters.AddWithValue("@SeatColumn", seatColumn);
                        cmd.Parameters.AddWithValue("@SeatNumber", seatNumber);
                        cmd.Parameters.AddWithValue("@EmailAddress", emailAddress);



                        int row = cmd.ExecuteNonQuery();
                        if (row > 0)
                        {
                            MessageBox.Show("Seat is successfully booked");
                            SendEmail(emailAddress, _class, terminal, departure, arrival, weight,
                                      passegnerID, passengerName, seatColumn, seatNumber, flightTo);
                            FlightForm flightForm = new FlightForm();
                            flightForm.ClearTextBoxes();
                        }
                        else
                        {
                            MessageBox.Show("Seat is already taken. Pick a different seat");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Plane is full");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Empty fields are not allowed");
            }
        }
        private void btnBookFlight_Click(object sender, EventArgs e)
        {
            FlightForm flightForm = new FlightForm();

            flightForm.Show();
        }