Bugfix Mitarbeiterauslastung

This commit is contained in:
Christian
2017-03-16 13:36:54 +01:00
parent b7f82d22a2
commit aac6b06924
2 changed files with 25 additions and 11 deletions

View File

@@ -445,15 +445,15 @@ namespace BeWo.Report
return report as XtraReport;
}
public override XtraReport CreateAuslastungReport(long? employeeOid, long? teamOid, DateTime startDate, DateTime endDate, bool splitTeams)
public override XtraReport CreateAuslastungReport(long? employeeOid, IList<long> teamOids, DateTime startDate, DateTime endDate)
{
IBeWoReport<MitarbeiterauslastungRO> report;
if (splitTeams)
report = FindReportImp<MitarbeiterauslastungRO>("Teamauslastung");
if (teamOids != null && teamOids.Count > 0)
report = FindReportImp<MitarbeiterauslastungRO>("Teamauslastung");
else
report = FindReportImp<MitarbeiterauslastungRO>("Mitarbeiterauslastung");
var x = MitarbeiterauslastungRO.Create(employeeOid, teamOid, startDate, endDate);
var x = MitarbeiterauslastungRO.Create(employeeOid, teamOids, startDate, endDate);
report.SetReportDataSource(x);
return report as XtraReport;

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared.Extensions;
namespace BeWo.Report.ReportObjects
{
@@ -39,7 +40,7 @@ namespace BeWo.Report.ReportObjects
set { teamDetailList = value; }
}
public static MitarbeiterauslastungRO Create(long? employeeOid, long? teamOid, DateTime startDate, DateTime endDate)
public static MitarbeiterauslastungRO Create(long? employeeOid, IList<long> teamOids, DateTime startDate, DateTime endDate)
{
Team team = null;
@@ -55,12 +56,25 @@ namespace BeWo.Report.ReportObjects
var emp = DAOFactory.GenericDAO.GetByID<Employee>(employeeOid.Value);
employees = new List<Employee> {emp};
}
else if (teamOid.HasValue)
{
team = DAOFactory.GenericDAO.GetByID<Team>(teamOid.Value);
employees = team.MemberList;
}
else
else if (teamOids != null)
{
foreach (var teamOid in teamOids)
{
team = DAOFactory.GenericDAO.GetByID<Team>(teamOid);
if (employees == null)
{
employees = team.MemberList;
}
else
{
employees.AddRange(team.MemberList);
team = null;
}
}
}
else
{
employees = DAOFactory.GenericDAO.GetAllActive<Employee>();
}