Пример #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!bln)
         {
             conditionnement.inserts();
             MessageBox.Show("Enregistrement éffectué", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             if (bsrc.DataSource != null)
             {
                 clsconditionnement s = (clsconditionnement)bsrc.Current;
                 new clsconditionnement().update(s);
                 MessageBox.Show("Modification effectuée!", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         //Permet l'actualisation des valeur des conditionnements sur le formulair appellant
         clsDoTraitement.EnterForFormConditionnement = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Echec de la mise à jour" + ex.Message, "Mise à jour", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     this.New();
     refresh();
 }
Пример #2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult result = MessageBox.Show("Voulez - vous vraiment supprimer cet enregistrement ?", "Suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             if (bsrc.DataSource != null)
             {
                 clsconditionnement d = (clsconditionnement)bsrc.Current;
                 new clsconditionnement().delete(d);
                 MessageBox.Show("Suppression éffectuée", "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.New();
                 refresh();
             }
             //Permet l'actualisation des valeur des conditionnements sur le formulair appellant
             clsDoTraitement.EnterForFormConditionnement = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Echec de la suppression " + ex.Message, "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Пример #3
0
 private void New()
 {
     conditionnement = new clsconditionnement();
     bln             = false;
     bindingcls();
 }