private void button3_Click(object sender, EventArgs e) { Hide(); UcusEkleSil ekleSil = new UcusEkleSil(); ekleSil.Show(); }
private void button1_Click(object sender, EventArgs e) { int pilot = comboBox1.SelectedIndex + 1; int ucak = comboBox5.SelectedIndex + 1; int sirket = comboBox6.SelectedIndex + 1; int rota = comboBox3.SelectedIndex + 1; int havaalani = comboBox2.SelectedIndex + 1; string sure = textBox1.Text; string date = dateTimePicker1.Text; // uçuş ekleme işlemi yapılıyor try { baglanti.Open(); string sql = "INSERT INTO \"public\".\"Ucus\" ( \"Pilot\", \"Rota\", \"Sirket\", \"Tarih\", \"Ucak\", \"UcusSuresi\", \"VarisHavaAlani\") VALUES (" + pilot + " ," + rota + " ," + sirket + " ,'" + date + "', " + ucak + " , '" + sure + "'," + havaalani + " )"; cmd = new OdbcCommand(sql, baglanti); cmd.ExecuteNonQuery(); baglanti.Close(); } catch (Exception ex) { baglanti.Close(); MessageBox.Show(ex.Message); throw; } UcusEkleSil ucus = new UcusEkleSil(); ucus.Show(); Hide(); }