Пример #1
0
        // Afficher la visite sélectionnée dans le datagridview
        private void afficher()
        {
            Visite uneVisite = (Visite)dgvVisites.SelectedRows[0].Cells[0].Value;

            lblPraticien.Text  = uneVisite.LePraticien.NomPrenom;
            lblEmail.Text      = uneVisite.LePraticien.Email;
            lblRue.Text        = uneVisite.LePraticien.Rue;
            lblTelephone.Text  = uneVisite.LePraticien.Telephone;
            lblMotif.Text      = uneVisite.LeMotif.Libelle;
            lblSpecialite.Text = uneVisite.LePraticien.Specialite is null ? null : uneVisite.LePraticien.Specialite.Libelle;
            lblType.Text       = uneVisite.LePraticien.Type.Libelle;
            lblBilan.Text      = uneVisite.Bilan;


            //vider la liste
            lstMedicament.Items.Clear();

            // alimentation des medicaments présentés
            if (uneVisite.PremierMedicament != null)
            {
                lstMedicament.Items.Add(uneVisite.PremierMedicament.Nom);
                if (uneVisite.SecondMedicament != null)
                {
                    lstMedicament.Items.Add(uneVisite.SecondMedicament.Nom);
                }
            }

            dgvEchantillons.Rows.Clear();
            SortedDictionary <Medicament, int> lesEchantillons = uneVisite.getLesEchantillons();

            foreach (Medicament unMedicament in uneVisite.getLesEchantillons().Keys)
            {
                dgvEchantillons.Rows.Add(unMedicament.Nom, lesEchantillons[unMedicament]);
            }
        }