Beispiel #1
0
        public PersonneDansArbreIndividuel(Personne p, int pbas = int.MaxValue)
        {
            this.id              = p.id;
            this.nom             = p.nom;
            this.prenom          = p.prenom;
            this.homme           = p.homme;
            this.dateAjout       = p.dateAjout;
            this.dateDeDeces     = p.dateDeDeces;
            this.dateDeNaissance = p.dateDeNaissance;
            this.idPere          = p.idPere;
            this.idMere          = p.idMere;

            int limite = (pbas == int.MaxValue) ? int.MaxValue : pbas - 1;

            this.descendants = new List <PersonneDansArbreIndividuel>();
            if (limite > 0)
            {
                IEnumerable <Personne> leskids = p.Enfants();
                if (leskids != null && leskids.Count() != 0)
                {
                    foreach (Personne pp in leskids)
                    {
                        this.descendants.Add(new PersonneDansArbreIndividuel(pp, limite));
                    }
                }
            }

            /* fiche */
            this.fiche = ServPersonne.Fiche(p);
        }
Beispiel #2
0
        public PersonneIndex(Personne e, bool calculenfants, bool calculparents)

        {
            this.id              = e.id;
            this.homme           = e.homme;
            this.dateAjout       = e.dateAjout;
            this.dateDeDeces     = e.dateDeDeces;
            this.dateDeNaissance = e.dateDeNaissance;
            this.pere            = e.idPere == null?null:new PersonneIndex(e.Pere(), false, false);
            this.mere            = e.idMere == null?null:new PersonneIndex(e.Mere(), false, false);
            this.nom             = e.nom;
            this.prenom          = e.prenom;
            this.idArbre         = e.idArbre;

            this.nomAffichage = e.nomAffichage();

            if (calculenfants)
            {
                this.enfants = e.Enfants()
                               .Select(j => new PersonneIndex(j, true, false))
                               .ToList();

                this.nomArbre        = e.Arbre().nom;
                this.nomProprietaire = e.Proprietaire().nomAffichage();
            }
            else
            {
                this.enfants = new List <PersonneIndex>();
            }
        }