From 82fbe461e33156e3eaac6d19e2d4d71b8e36eeea Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 22 Apr 2024 16:12:54 +0200 Subject: [PATCH] =?UTF-8?q?MitarbeiterauslastungRO=20-=20Zus=C3=A4tzlich?= =?UTF-8?q?=20Aufgliederung=20der=20Teamansicht=20pro=20Mitarbeiter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReportObjects/MitarbeiterauslastungRO.cs | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/Report/ReportObjects/MitarbeiterauslastungRO.cs b/Report/ReportObjects/MitarbeiterauslastungRO.cs index 9717ea4ec..cf6731e50 100644 --- a/Report/ReportObjects/MitarbeiterauslastungRO.cs +++ b/Report/ReportObjects/MitarbeiterauslastungRO.cs @@ -59,9 +59,8 @@ namespace BeWo.Report.ReportObjects } - public static MitarbeiterauslastungRO Create(IList employeeOids, IList teamOids, DateTime startDate, DateTime endDate) + public static MitarbeiterauslastungRO Create(IList employeeOids, IList teamOids, DateTime startDate, DateTime endDate, bool teamnachklient = true) { - var ro = new MitarbeiterauslastungRO(); ro.ReportStartDate = startDate; ro.ReportEndDate = endDate; @@ -95,26 +94,7 @@ namespace BeWo.Report.ReportObjects td = teamOid2Details[teamTemp.Oid.Value]; } - var customers = DAOFactory.SearchDAO.FindCustomerOfTeam(teamOid); - - if (customers.Count > 0) - { - - foreach (var c in customers) - { - var empDetail = new EmployeeDetail(); - ro.EmployeeDetailList.Add(empDetail); - td.EmployeeDetailList.Add(empDetail); - - empDetail.Teams = new List { teamTemp }; - empDetail.Employee = null; - empDetail.Customer = c; - empDetail.LastName = c.Person.LastName; - empDetail.FirstName = c.Person.FirstName; - empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName); - } - } - else + if (!teamnachklient && teamTemp.MemberList != null && teamTemp.MemberList.Count > 0) { foreach (Employee emp in teamTemp.MemberList) { @@ -127,14 +107,31 @@ namespace BeWo.Report.ReportObjects empDetail.LastName = emp.Person.LastName; empDetail.FirstName = emp.Person.FirstName; empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName); - } - - + } } + else + { + var customers = DAOFactory.SearchDAO.FindCustomerOfTeam(teamOid); + if (customers.Count > 0) + { + foreach (var c in customers) + { + var empDetail = new EmployeeDetail(); + ro.EmployeeDetailList.Add(empDetail); + td.EmployeeDetailList.Add(empDetail); + + empDetail.Teams = new List { teamTemp }; + empDetail.Employee = null; + empDetail.Customer = c; + empDetail.LastName = c.Person.LastName; + empDetail.FirstName = c.Person.FirstName; + empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName); + } + } + } } - } else { @@ -156,8 +153,6 @@ namespace BeWo.Report.ReportObjects empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName); } - - foreach (EmployeeDetail employee in ro.EmployeeDetailList) { if (employee.Employee != null && employee.Teams.Count > 0)