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