Exemple #1
0
        private bool IsValidIndividual(CensusIndividual indiv, bool censusDone, bool parentCheck, bool checkCensus)
        {
            if (indiv == null)
            {
                return(false);
            }
            DateTime     birth        = indiv.BirthDate.StartDate;
            DateTime     death        = indiv.DeathDate.EndDate;
            FactLocation bestLocation = indiv.BestLocation(CensusDate);

            if (birth <= CensusDate.StartDate && death >= CensusDate.StartDate)
            {
                if ((checkCensus && indiv.IsCensusDone(CensusDate) == censusDone && !indiv.OutOfCountry(CensusDate)) || !checkCensus)
                {
                    if (parentCheck) // Husband or Wife with valid date range
                    {
                        return(true);
                    }
                    else // individual is a child so remove if married before census date
                    {
                        return(!indiv.IsMarried(CensusDate));
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
        bool IsValidIndividual(CensusIndividual indiv, bool censusDone, bool parentCheck, bool checkCensus)
        {
            if (indiv is null)
            {
                return(false);
            }

            DateTime     birth        = indiv.BirthDate.StartDate;
            DateTime     death        = indiv.DeathDate.EndDate;
            FactLocation bestLocation = indiv.BestLocation(CensusDate);

            if (birth <= CensusDate.StartDate && death >= CensusDate.StartDate)
            {
                if ((checkCensus && indiv.IsCensusDone(CensusDate) == censusDone && !indiv.OutOfCountry(CensusDate)) || !checkCensus)
                {
                    return(parentCheck || !indiv.IsMarried(CensusDate));
                }
                return(false);
            }
            return(false);
        }