Exemplo n.º 1
0
        private void Bscomp_CurrentChanged(object sender, EventArgs e)
        {
            COMPOSITEUR c = (COMPOSITEUR)bscomp.Current;
            //le libnation
            string libnation = c.NATIONALITE.libNation;

            tbNati.Text = libnation;
            // la nais et mort
            int mort = (int)c.anMort;
            int nais = (int)c.anNais;

            tbNais.Text = String.Concat(mort);
            tbDece.Text = String.Concat(nais);
            // nom prenom
            string nom    = c.nomCompositeur;
            string prenom = c.prenomCompositeur;

            tbVouAveSelec.Text = nom + " " + prenom;
            // Style
            string style = c.STYLE.libStyle;

            tbStyle.Text = style;
            // Remarque
            string remarque = c.remarque;

            rtbDesc.Text = remarque;
            // les Oeuvres
            bsoeuvre.DataSource  = c.OEUVRE.ToList();
            dgvOeuvre.DataSource = bsoeuvre;
        }
Exemplo n.º 2
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");
     }
 }
Exemplo n.º 3
0
        public static void trouveCompositeurId(int id)
        {
            var LQuery = maConnexion.COMPOSITEUR.ToList()
                         .Where(x => x.idCompositeur == id);

            lecompoChoisi = (COMPOSITEUR)LQuery.ToList().First();
        }
Exemplo n.º 4
0
        private void FAjoutComp_Load(object sender, EventArgs e)
        {
            COMPOSITEUR comptemp = Modele.lecompoChoisi;

            // Les Styles
            cbstyle.ValueMember   = "idStyle";//permet de stocker l'identifiant
            cbstyle.DisplayMember = "libStyle";
            bsstyle.DataSource    = comptemp.STYLE;
            cbstyle.DataSource    = bsstyle;
            // Les Nations
            cbnat.ValueMember   = "idNation";//permet de stocker l'identifiant
            cbnat.DisplayMember = "libNation";
            bsnat.DataSource    = comptemp.NATIONALITE;
            cbnat.DataSource    = bsnat;
            // Les infos
            tbnom.Text       = comptemp.nomCompositeur;
            tbprenom.Text    = comptemp.prenomCompositeur;
            tbmort.Text      = (comptemp.anMort).ToString();
            tbnais.Text      = (comptemp.anNais).ToString();
            rtbRemarque.Text = (comptemp.remarque).ToString();
        }
Exemplo n.º 5
0
 public static void ajoutCompo(COMPOSITEUR c)
 {
     maConnexion.COMPOSITEUR.Add(c);
     maConnexion.SaveChanges();
 }