diff --git a/ReportImp/AWOMuensterlandRecklinghausen/Reporting/KannAllesWeissAllesRO.cs b/ReportImp/AWOMuensterlandRecklinghausen/Reporting/KannAllesWeissAllesRO.cs index f03247c2a..836d815c9 100644 --- a/ReportImp/AWOMuensterlandRecklinghausen/Reporting/KannAllesWeissAllesRO.cs +++ b/ReportImp/AWOMuensterlandRecklinghausen/Reporting/KannAllesWeissAllesRO.cs @@ -406,14 +406,13 @@ namespace AWOMuensterlandRecklinghausen.Reporting } } // 5 Nahes Umfeld setzen (ersten beiden Personen aus Klientenumfeld) - if (customer.EnvironmentPersons != null && customer.EnvironmentPersons.Count > 0) + var angehoerige = customer.EnvironmentPersons.Where(p => p.IstFamilie).ToList(); + if (angehoerige != null && angehoerige.Count > 0) { - customer.EnvironmentPersons = customer.EnvironmentPersons.OrderByDescending(p => p.IstFamilie).ToList(); - // 5.1 Person 1 - if (customer.EnvironmentPersons.Count >= 1) + if (angehoerige.Count >= 1) { - var person = customer.EnvironmentPersons[0]; + var person = angehoerige[0]; #region Person 1 Kontaktdaten var umfeldPerson = MapperFactory.PersonDC_Person.MapToNewDC(DAOFactory.GenericDAO.GetByID(person.Person.PersonOid)); ContactDC mail = null; @@ -460,9 +459,9 @@ namespace AWOMuensterlandRecklinghausen.Reporting } // 5.2 Person 2 - if (customer.EnvironmentPersons.Count >= 2) + if (angehoerige.Count >= 2) { - var person = customer.EnvironmentPersons[1]; + var person = angehoerige[1]; #region Person 2 Kontaktdaten var umfeldPerson = MapperFactory.PersonDC_Person.MapToNewDC(DAOFactory.GenericDAO.GetByID(person.Person.PersonOid)); ContactDC mail = null;