AuswegHeikePuetz: Im Bericht für Arbeitstage mit mehr als 8h Mitarbeiter alphabetisch sortieren

This commit is contained in:
2026-01-30 19:29:48 +01:00
parent 7cc66b35ca
commit 8726d52125

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data; using System.Data;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using BeWo.Data.Access; using BeWo.Data.Access;
using BeWo.Data.Entities; using BeWo.Data.Entities;
using BeWo.Report; using BeWo.Report;
@@ -60,7 +61,8 @@ namespace Ausweg
Team team = DAOFactory.GenericDAO.GetByID<Team>((long)teamOid); Team team = DAOFactory.GenericDAO.GetByID<Team>((long)teamOid);
if (team != null) if (team != null)
{ {
foreach (var employee in team.MemberList) var teamEmployees = team.MemberList.OrderBy(e => e.Person.LastNameFirstName).ToList();
foreach (var employee in teamEmployees)
{ {
bericht = CreateAndAddArbeitstageMehrAls8hBericht((long)employee.Oid, startDate, endDate, bericht); bericht = CreateAndAddArbeitstageMehrAls8hBericht((long)employee.Oid, startDate, endDate, bericht);
} }
@@ -69,8 +71,7 @@ namespace Ausweg
else else
{ {
// kein Mitarbeiter oder Team ausgewaehlt, Bericht wird fuer alle Mitarbeiter erstellt // kein Mitarbeiter oder Team ausgewaehlt, Bericht wird fuer alle Mitarbeiter erstellt
var allEmployees = DAOFactory.GenericDAO.GetAllActiveAndArchived<Employee>(); var allEmployees = DAOFactory.GenericDAO.GetAllActiveAndArchived<Employee>().OrderBy(e => e.Person.LastNameFirstName).ToList();
foreach (var employee in allEmployees) foreach (var employee in allEmployees)
{ {
bericht = CreateAndAddArbeitstageMehrAls8hBericht((long)employee.Oid, startDate, endDate, bericht); bericht = CreateAndAddArbeitstageMehrAls8hBericht((long)employee.Oid, startDate, endDate, bericht);