Пример #1
0
 private void New()
 {
     suiviCrois = new clssuivicroissance();
     bln        = false;
     bindingcls();
     txtIdEnfant.Text = clsDoTraitement.IdEnfant.ToString();
 }
Пример #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)
             {
                 clssuivicroissance d = (clssuivicroissance)bsrc.Current;
                 new clssuivicroissance().delete(d);
                 MessageBox.Show("Suppression éffectuée", "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 //this.New();
                 //refresh();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Echec de la suppression " + ex.Message, "Suppression", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Пример #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!bln)
         {
             suiviCrois.inserts();
             MessageBox.Show("Enregistrement éffectué", "Enregistrement", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             if (bsrc.DataSource != null)
             {
                 clssuivicroissance s = (clssuivicroissance)bsrc.Current;
                 new clssuivicroissance().update(s);
                 MessageBox.Show("Modification effectuée!", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Echec de la mise à jour" + ex.Message, "Mise à jour", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }