private void Button22_Click(System.Object sender, System.EventArgs e) { if (checkm == "NA") { SeatSelectionLower SSL0 = new SeatSelectionLower("NA", BookingNo.Text, RNO, BNO); this.Close(); SSL0.BringToFront(); SSL0.Show(); } else { SeatSelectionLower SSL0 = new SeatSelectionLower("AB_UN", BookingNo.Text, RNO, BNO); this.Close(); SSL0.BringToFront(); SSL0.Show(); } }
private void Proceed_Click(System.Object sender, System.EventArgs e) { try { CN = Convert.ToInt32(BookingNo.Text); if (string.IsNullOrEmpty(BookingNo.Text.Trim())) { MessageBox.Show("Plz.. Enter Booking No.."); } else if (RadioButton1.Checked == false & RadioButton2.Checked == false) { MessageBox.Show("Plz.. Select Seat Section.."); } else { DialogResult res = MessageBox.Show("Do U Want To Allocate Seat To Waiting Booking?", "Allocate Seat?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (res == DialogResult.Yes) { RN = RNo.Text; BN = BusSerialNo.Text; con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Bus_System;Integrated Security=True"); con.Open(); cmd = new SqlCommand("Update APaymentPassenger Set RouteBus='" + cmbstartpoint.Text + " To " + cmbdestination.Text + " " + BusNumber.Text + "',CurrentDate='" + Strings.Format(DateAndTime.Today, "dd/MM/yyyy") + "',ArrivalTime='" + Strings.Format(Arrivaltime.Value, "hh:mm:ss tt") + "'Where BookingNo=" + BookingNo.Text + "", con); cmd.ExecuteNonQuery(); //this.Hide(); if (BusReservation.Text == "1x1" & RadioButton1.Checked == true) { SeatSelectionLower SSL = new SeatSelectionLower("AB_UN", CN, RN, BN); this.Close(); SSL.Show(); SSL.BringToFront(); } if (BusReservation.Text == "1x1" & RadioButton2.Checked == true) { SeatSelectionUpper SSU = new SeatSelectionUpper("AB_UN", CN, RN, BN); this.Close(); SSU.Show(); SSU.BringToFront(); } if (BusReservation.Text == "2x1" & RadioButton1.Checked == true) { SeatSelectionLower21 SSL1 = new SeatSelectionLower21("AB_UN", CN, RN, BN); this.Close(); SSL1.Show(); SSL1.BringToFront(); } if (BusReservation.Text == "2x1" & RadioButton2.Checked == true) { SeatSelectionUpper21 SSU1 = new SeatSelectionUpper21("AB_UN", CN, RN, BN); this.Close(); SSU1.Show(); SSU1.BringToFront(); } if (BusReservation.Text == "2x2" & RadioButton1.Checked == true) { SeatSelectionLower22 SSL2 = new SeatSelectionLower22("AB_UN", CN, RN, BN); this.Close(); SSL2.Show(); SSL2.BringToFront(); } if (BusReservation.Text == "2x2" & RadioButton2.Checked == true) { SeatSelectionUpper21 SSU2 = new SeatSelectionUpper21("AB_UN", CN, RN, BN); this.Close(); SSU2.Show(); SSU2.BringToFront(); } //this.Close(); } } } catch (Exception ex) { MessageBox.Show("Nothing Selected.. Plz Select Correct Booking No.. Or " + ex.Message); } }