Exemplo n.º 1
0
 private void BOk_Click(object sender, EventArgs e)
 {
     // Verif
     if (Control() == false)
     {
         MessageBox.Show("erreur");
     }
     else
     {
         // init var
         string nom      = tbnom.Text;
         string prenom   = tbprenom.Text;
         string remarque = rtbRemarque.Text;
         int    anmort   = int.Parse(tbmort.Text);
         int    annais   = int.Parse(tbnais.Text);
         int    nati     = ((NATIONALITE)bsnat.Current).idNation;
         int    style    = ((STYLE)bsstyle.Current).idStyle;
         // Crée Comp
         COMPOSITEUR newComp = new COMPOSITEUR();
         newComp.nomCompositeur    = nom;
         newComp.prenomCompositeur = prenom;
         newComp.remarque          = remarque;
         newComp.anMort            = anmort;
         newComp.anNais            = annais;
         newComp.idNation          = nati;
         newComp.idStyle           = style;
         Modele.ajoutCompo(newComp);
         //Messagebox
         MessageBox.Show("Compositeur Crée");
     }
 }