Esempio n. 1
0
        private void btnTheaterOne_Click(object sender, EventArgs e)
        {
            var theaterOneSeatsForm = new TheaterOneSeatsForm();

            theaterOneSeatsForm.Show();
            this.Hide();
        }
Esempio n. 2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (dateTimePicker1.Text.Length > 0)
     {
         if (comboBoxTime.Text.Length > 0)
         {
             if (txtSeatsNo.Text.Length > 0)
             {
                 string            message = "Are you sure what selected?";
                 string            title   = "Confirm Booking";
                 MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                 DialogResult      result  = MessageBox.Show(message, title, buttons);
                 if (result == DialogResult.Yes)
                 {
                     string insertQuery = "INSERT INTO cinema_ticket_system.ticket(movie_name, theater, seat_no, show_date, show_time, total_amount) VALUES ('" + labelMovieName.Text + "', '" + labelTheaterName.Text + "', '" + txtSeatsNo.Text + "','" + dateTimePicker1.Text + "','" + comboBoxTime.Text + "', '" + txtTotalPrice.Text + "')";
                     executeQuery(insertQuery);
                     TicketForm ticketForm = new TicketForm(labelMovieName.Text, labelTheaterName.Text, txtSeatsNo.Text, dateTimePicker1.Text, comboBoxTime.Text, txtTotalPrice.Text);
                     ticketForm.Show();
                     this.Hide();
                 }
                 else
                 {
                     var theaterOneSeatsForm = new TheaterOneSeatsForm();
                     theaterOneSeatsForm.Show();
                     this.Hide();
                 }
             }
             else
             {
                 MessageBox.Show("Please select seats.");
             }
         }
         else
         {
             MessageBox.Show("Please select showing time.");
         }
     }
     else
     {
         MessageBox.Show("Please select showing date.");
     }
 }