Bugfix Mitarbeiterauslastung
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user