private void Button2_Click(object sender, EventArgs e) { if (textBoxNomPatient.Text == "" || textBoxPrenomPatient.Text == "" || textBoxAge.Text == "" || comboBoxConsultation.Text == "" || textBoxDiagnostic.Text == "") { MessageBox.Show("Veuillez remplir tous les champs"); } else { conn.Open(); MySqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.Text; //define the command text cmd.CommandText = "insert into consultation (Diagnostic,Nom_Consultant,Nom_Patient,Prenom_Patient,Age) values ('" + textBoxNomPatient.Text + "','" + textBoxPrenomPatient.Text + "','" + textBoxAge.Text + "','" + comboBoxConsultation.Text + "','" + textBoxDiagnostic.Text + "');"; cmd.ExecuteNonQuery(); MessageBox.Show("Insertion effectué avec succés ! "); this.Hide(); Consultation fm = new Consultation(); fm.Show(); conn.Close(); } }
private void Button5_Click(object sender, EventArgs e) { this.Hide(); Consultation fm = new Consultation(); fm.Show(); }