Ejemplo n.º 1
0
 private void button6_Click_1(object sender, EventArgs e)
 {
     if (MessageBox.Show("Voulez vous vraiment supprimer ce enregistrement ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         #region Suppression
         try
         {
             string        code_ordre = textBox2.Text;
             Ordre_Service os         = new Ordre_Service();
             os.Code_ordre = code_ordre;
             os.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
     }
 }
Ejemplo n.º 2
0
 private void button5_Click_1(object sender, EventArgs e)
 {
     #region Modification
     try
     {
         string        code_ordre   = textBox2.Text;
         DateTime      date_ordre   = dateTimePicker3.Value;
         string        objet_ordre  = textBox4.Text;
         string        type_ordre   = textBox5.Text;
         int           chef_service = int.Parse(comboBox6.SelectedValue.ToString());
         int           marche       = int.Parse(comboBox7.SelectedValue.ToString());
         int           directeur    = int.Parse(comboBox8.SelectedValue.ToString());
         Ordre_Service os           = new Ordre_Service(code_ordre, date_ordre, objet_ordre, type_ordre, chef_service, marche, directeur);
         os.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
 }