Пример #1
0
        //Remplissage ID et CB Modèles

        private void remplissageCBModele()
        {
            cbNomModele.Items.Clear();
            ModelesAchatDataContext DCmodeles = new ModelesAchatDataContext();
            var requete = from modele in DCmodeles.ModeleVoiture
                          select modele.nomModele;

            foreach (var aa in requete)
            {
                cbNomModele.Items.Add(aa.ToString());
            }
        }
Пример #2
0
        private void cbNomModele_SelectedIndexChanged(object sender, EventArgs e)
        {
            activationBtnConfirmer();

            ModelesAchatDataContext DCmodeles = new ModelesAchatDataContext();
            var requete = from modele in DCmodeles.ModeleVoiture
                          where modele.nomModele == cbNomModele.Text
                          select modele.idModele;

            foreach (var aa in requete)
            {
                tbIdModele.Text = aa.ToString();
            }
        }