private void button1_Click(object sender, EventArgs e) { KinoClass cla = new KinoClass(); if (check != true) { bool turn; turn = cla.query_command("insert into Seans(film_id,sala_id,data_czas,czas_reklamy) values ('" + comboBox1.SelectedValue + "','" + comboBox2.SelectedValue + "','" + dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm") + "','" + numericUpDown1.Value + "')"); if (turn) { MessageBox.Show("The Performance Has Been Successfully Added", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { bool turn; turn = cla.query_command("Update Seans SET film_id ='" + comboBox1.SelectedValue + "', sala_id='" + comboBox2.SelectedValue + "', data_czas= '" + dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm") + "', czas_reklamy='" + numericUpDown1.Value + "' where seans_id=" + get_number_seans + ";"); if (turn) { MessageBox.Show("The Performance Has Been Successfully Updated", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } DialogResult = DialogResult.OK; ListaSeansów listaSeansów = new ListaSeansów(); }
private void button2_Click(object sender, EventArgs e) { KinoClass cla = new KinoClass(); DataTable tab = cla.table_get_data("DELETE from Seans where seans_id =" + get_number_seans + ";"); MessageBox.Show("The Performance Has Been Successfully DELETED", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; ListaSeansów listaSeansów = new ListaSeansów(); }
private void button1_Click(object sender, EventArgs e) { ListaSeansów listaSeansów = new ListaSeansów(); if (listaSeansów.ShowDialog() != DialogResult.OK) { return; } string nazwa; }