PerspektiveSelbstständigesLeben/QueryListReport - Erweiterung für Tandembetreuung
This commit is contained in:
@@ -39,6 +39,8 @@ namespace PerspektiveSL
|
||||
{
|
||||
VertretungsDetailListeRO ro = new VertretungsDetailListeRO();
|
||||
ro.Klient = c;
|
||||
bool tandem = false;
|
||||
Employee2Customer vertretung = null;
|
||||
sumRo.AnzahlKlienten += 1;
|
||||
var contact = ro.Klient.Person.Contacts.FirstOrDefault(t => t.Type == ContactType.private_MobilePhone);
|
||||
if (contact != null)
|
||||
@@ -57,18 +59,35 @@ namespace PerspektiveSL
|
||||
&& ve.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant));
|
||||
if (eghFachkraft != null)
|
||||
{
|
||||
if (eghFachkraft.ValueList[0].Entry.Value.Contains("Tandem"))
|
||||
{
|
||||
tandem = true;
|
||||
}
|
||||
ro.Employee = eghFachkraft.Employee;
|
||||
if (!empOidDict.ContainsKey(ro.Employee.Oid.Value))
|
||||
{
|
||||
empOidDict.Add(ro.Employee.Oid.Value, ro.Employee);
|
||||
}
|
||||
}
|
||||
var vertretung = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 19
|
||||
&& ve.Entry.Type == ValueListEntryType.StaffRoleType));
|
||||
if (vertretung != null)
|
||||
if (tandem)
|
||||
{
|
||||
ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName;
|
||||
ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value;
|
||||
vertretung = c.Employee2CustomerList.LastOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.SystemEntryID.HasValue
|
||||
&& ve.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant));
|
||||
if (vertretung != null)
|
||||
{
|
||||
ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName;
|
||||
ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vertretung = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 19
|
||||
&& ve.Entry.Type == ValueListEntryType.StaffRoleType));
|
||||
if (vertretung != null)
|
||||
{
|
||||
ro.Stellvertretung1 = vertretung.Employee.Person.LastNameFirstName;
|
||||
ro.Stellvertretung1Oid = vertretung.EmployeeOid.Value;
|
||||
}
|
||||
}
|
||||
var vertretung2 = c.Employee2CustomerList.FirstOrDefault(e2c => e2c.ValueList.Any(ve => ve.Entry.Oid == 1429
|
||||
&& ve.Entry.Type == ValueListEntryType.StaffRoleType));
|
||||
@@ -85,6 +104,18 @@ namespace PerspektiveSL
|
||||
else
|
||||
{
|
||||
result.DetailList.Add(ro);
|
||||
if (tandem)
|
||||
{
|
||||
VertretungsDetailListeRO ro2 = new VertretungsDetailListeRO();
|
||||
ro2.Klient = ro.Klient;
|
||||
ro2.Employee = vertretung.Employee;
|
||||
ro2.Telefon = ro.Telefon;
|
||||
ro2.Stellvertretung1 = ro.Employee.Person.LastNameFirstName;
|
||||
ro2.Stellvertretung1Oid = ro.Employee.Oid.Value;
|
||||
ro2.Stellvertretung2 = ro.Stellvertretung2;
|
||||
ro2.Stellvertretung2Oid = ro.Stellvertretung2Oid;
|
||||
result.DetailList.Add(ro2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user