public BookingListForm(List <Flight> matchingFlights, BookingForm bookingForm, string[] userChoices) { InitializeComponent(); _matchingFlights = matchingFlights; _bookingForm = bookingForm; _userChoices = userChoices; }
private void updateDB(string sender, string encryptedCardNo) { string collected; string secretCardNo; secretCardNo = encryptedCardNo; if (sender.Equals("print")) { collected = "1"; } else { collected = "0"; } //send the data to the database string query = "INSERT INTO tickets (ticketID, firstName, lastName, cardNumber, collected, flightID, seatsOnBook) VALUES ('" + txtBox_ticketNumber.Text + "', '" + txtBox_firstName.Text + "', '" + txtBox_lastName.Text + "', '" + encryptedCardNo + "', '" + collected + "', '" + flightNo + "', '" + seatsAvailable + "')"; BookingForm bookForm = new BookingForm(new MenuForm()); /* bookForm.DBConnect("", "", true, query);*/ int numSeats = Convert.ToInt32(seatsAvailable); query = "UPDATE flights SET seatsAvailable = '" + (numSeats - 1).ToString() + "' WHERE flightID = '" + flightNo + "'"; /* bookForm.DBConnect("", "", true, query);*/ }
private void pb_book_Click(object sender, EventArgs e) { _collectClicked = false; if (_bookClicked == false) { //clear the pictures ClearText(); //change the picture ResetImage("data/images/book_ticketTXT.png"); _bookClicked = true; } else { var bookingForm = new BookingForm(this); bookingForm.Show(); ClearText(); this.Hide(); } }