private void button3_Click(object sender, EventArgs e) { #region Modification : Prestataire try { string code_prest = textBox2.Text; string rai_soc = textBox3.Text; string intitule = textBox4.Text; DateTime date_creation = dateTimePicker5.Value; string activite = textBox6.Text; string adr_siege = textBox7.Text; string tel_b = textBox8.Text; string fax = textBox9.Text; string contact = textBox10.Text; string gsm_contact = textBox11.Text; string e_mail = textBox12.Text; string site_web = textBox13.Text; Prestataire p = new Prestataire(code_prest, rai_soc, intitule, date_creation, activite, contact, adr_siege, fax, gsm_contact, e_mail, site_web, tel_b); p.Modifier(); MessageBox.Show("Opération effectué", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Erreur : " + ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endregion }
private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("Voulez vous vraiment supprimer ce enregistrement ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { #region Suppression : Prestataire try { Prestataire p = new Prestataire(); p.Code_prest = textBox2.Text; p.Supprimer(); MessageBox.Show("Opération effectué", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Erreur : " + ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endregion } }