diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml b/BeWo/View/Detail/Report/DienstplanerView.xaml
index 3e8db7483..81b477fe6 100644
--- a/BeWo/View/Detail/Report/DienstplanerView.xaml
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml
@@ -129,7 +129,7 @@
-
@@ -278,7 +278,7 @@
-
+
@@ -374,7 +374,7 @@
-
+
diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml.cs b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
index 3aed92dbc..17a3a2fe3 100644
--- a/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
@@ -779,6 +779,15 @@ namespace BeWo.View.Detail.Report
if (datum.Month == _AuswahlMonat.Month)
{
_DienstplanerRootObj.AlleDienstEintraege.Add(newEintrag);
+ // Hier Dienst noch der DienstDCListe hinzufügen
+ foreach (var elem in _DienstplanerRootObj.DienstDCListe)
+ {
+ if (elem.Employee.EmployeeOid == employee.EmployeeOid.Value)
+ {
+ elem.DienstDictArray[zeile].Add(datum.Day, dienst.Oid.Value);
+ break;
+ }
+ }
// Prüfen, ob Dienst an einem Abwesenheitstag eingefügt wurde und wenn ja, Ist und Saldo nicht anpassen
if (!EintragAnGanzemAbwesenheitstag(newEintrag, null))
@@ -852,6 +861,16 @@ namespace BeWo.View.Detail.Report
{
_DienstplanerRootObj.AlleDienstvertretungen.Add(newVertretung);
+ // Hier Dienst noch der DienstDCListe hinzufügen
+ foreach (var elem in _DienstplanerRootObj.DienstDCListe)
+ {
+ if (elem.Employee.EmployeeOid == employee.EmployeeOid.Value)
+ {
+ elem.DienstDictArray[zeile].Add(datum.Day, dienst.Oid.Value);
+ break;
+ }
+ }
+
if (!EintragAnGanzemAbwesenheitstag(null, newVertretung))
{
foreach (var item in _DienstplanerRootObj.MonatsZusammenfassung)
@@ -1261,6 +1280,15 @@ namespace BeWo.View.Detail.Report
index = i;
}
_DienstplanerRootObj.AlleDienstEintraege.RemoveAt(index);
+
+ foreach (var elem in _DienstplanerRootObj.DienstDCListe)
+ {
+ if (elem.Employee.EmployeeOid == eintrag.EmployeeOid)
+ {
+ elem.DienstDictArray[eintrag.Zeile].Remove(eintrag.Datum.Day);
+ break;
+ }
+ }
}
else
{
@@ -1271,6 +1299,15 @@ namespace BeWo.View.Detail.Report
index = i;
}
_DienstplanerRootObj.AlleDienstvertretungen.RemoveAt(index);
+
+ foreach (var elem in _DienstplanerRootObj.DienstDCListe)
+ {
+ if (elem.Employee.EmployeeOid == vertretung.EmployeeOid)
+ {
+ elem.DienstDictArray[vertretung.Zeile].Remove(vertretung.Datum.Day);
+ break;
+ }
+ }
}
}
diff --git a/Service/Dienstplanung/DienstplanungsManager.cs b/Service/Dienstplanung/DienstplanungsManager.cs
index b5a067be3..9fafc9c81 100644
--- a/Service/Dienstplanung/DienstplanungsManager.cs
+++ b/Service/Dienstplanung/DienstplanungsManager.cs
@@ -713,25 +713,50 @@ namespace BeWo.Service.Dienstplanung
}
}
- List bloeckeNeuSortiert = new List();
- int max = 0;
- long? nextEmployee = null;
- while (bloecke.Count != bloeckeNeuSortiert.Count)
+ if (!aufsteigend)
{
- foreach (var anz in anzahlDiensteProMitarbeiter)
+ List bloeckeNeuSortiert = new List();
+ int max = 0;
+ long? nextEmployee = null;
+ while (bloecke.Count != bloeckeNeuSortiert.Count)
{
- if (anz.Value > max)
+ foreach (var anz in anzahlDiensteProMitarbeiter)
{
- nextEmployee = anz.Key;
- max = anz.Value;
+ if (anz.Value > max)
+ {
+ nextEmployee = anz.Key;
+ max = anz.Value;
+ }
}
+ anzahlDiensteProMitarbeiter.Remove(nextEmployee);
+ max = 0;
+ bloeckeNeuSortiert.AddRange(bloecke.Where(b => b.Employee.EmployeeOid == nextEmployee));
}
- bloeckeNeuSortiert.AddRange(bloecke.Where(b => b.Employee.EmployeeOid == nextEmployee));
+ return bloeckeNeuSortiert;
}
-
+ else
+ {
+ List bloeckeNeuSortiert = new List();
+ int min = 99999;
+ long? nextEmployee = null;
+ while (bloecke.Count != bloeckeNeuSortiert.Count)
+ {
+ foreach (var anz in anzahlDiensteProMitarbeiter)
+ {
+ if (anz.Value < min)
+ {
+ nextEmployee = anz.Key;
+ min = anz.Value;
+ }
+ }
+ anzahlDiensteProMitarbeiter.Remove(nextEmployee);
+ min = 99999;
+ bloeckeNeuSortiert.AddRange(bloecke.Where(b => b.Employee.EmployeeOid == nextEmployee));
+ }
- return bloeckeNeuSortiert;
+ return bloeckeNeuSortiert;
+ }
}
}
}