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 try { string code_brd = textBox1.Text; Bordereau b = new Bordereau(); b.Code_brd = code_brd; b.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 } }
private void button3_Click(object sender, EventArgs e) { #region Modifier try { string code_brd = textBox1.Text; DateTime date_bord = dateTimePicker2.Value; double quantite = double.Parse(textBox3.Text); double prix_un = double.Parse(textBox4.Text); int n_marche = int.Parse(comboBox5.SelectedValue.ToString()); int n_prix = int.Parse(comboBox6.SelectedValue.ToString()); Bordereau b = new Bordereau(code_brd, date_bord, quantite, prix_un, n_marche, n_prix); b.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 }