Example #1
0
        /// <summary>
        /// Redéfinition de ma méthode ToString
        /// </summary>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (Nationalite == null && Biographie == null)
            {
                sb.Append(Nom);
                sb.Append(" ");
                sb.Append(Prenom);
                sb.Append(" ");

                return(sb.ToString());
            }

            sb.Append(Nom);
            sb.Append(" ");
            sb.Append(Prenom);
            sb.Append(" ");
            sb.Append(DateDeNaissance.ToShortDateString());

            if (DateDeMort.HasValue)
            {
                sb.Append(" ");
                sb.Append(DateDeMort.Value.ToShortDateString());
            }

            sb.Append(" ");
            sb.Append(Nationalite);
            sb.Append(" ");
            sb.Append(Biographie);

            return(sb.ToString());
        }
Example #2
0
 public override string ToString()
 {
     return($"Id Etudiant : {idEtudiant}, Nom {NomEtudiant}, Prenom {PrenomEtudiant}, Date Naiss {DateDeNaissance.ToShortDateString()}");
 }