Beispiel #1
0
 private void button5_Click(object sender, EventArgs e)
 {
     #region Modification
     try
     {
         string   code = comboBox1.SelectedValue.ToString();
         DateTime date = dateTimePicker1.Value;
         Decompte a    = new Decompte(code, date);
         a.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
 }
Beispiel #2
0
 private void button6_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 = comboBox1.SelectedValue.ToString();
             Decompte a    = new Decompte();
             a.Code_decompte = code;
             a.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
     }
 }