MH: Sortieren-Feature für Dienstplanung eingebaut
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Margin="0 5 0 0" Content="Mitarbeiter" />
|
||||
<ComboBox x:Name="combobox_mehrereDienste_mitarbeiter" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="0 5 0 0" />
|
||||
<ListBox x:Name="mehrereDienste_listbox_dienste" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" MaxHeight="250" Margin="5 10 0 10"
|
||||
<ListBox x:Name="mehrereDienste_listbox_dienste" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" MaxHeight="300" Margin="5 10 0 10"
|
||||
SelectionChanged="mehrereDienste_listbox_dienste_SelectionChanged">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -278,7 +278,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="combobox_dienste" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" MaxHeight="250" SelectionChanged="combobox_dienste_SelectionChanged">
|
||||
<ListBox x:Name="combobox_dienste" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" MaxHeight="300" SelectionChanged="combobox_dienste_SelectionChanged">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Tag="{Binding}">
|
||||
@@ -374,7 +374,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="routine_listbox_dienste" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" MaxHeight="250" SelectionChanged="routine_combobox_dienste_SelectionChanged">
|
||||
<ListBox x:Name="routine_listbox_dienste" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" MaxHeight="300" SelectionChanged="routine_combobox_dienste_SelectionChanged">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Tag="{Binding}">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -713,25 +713,50 @@ namespace BeWo.Service.Dienstplanung
|
||||
}
|
||||
}
|
||||
|
||||
List<DienstBlockDC> bloeckeNeuSortiert = new List<DienstBlockDC>();
|
||||
int max = 0;
|
||||
long? nextEmployee = null;
|
||||
while (bloecke.Count != bloeckeNeuSortiert.Count)
|
||||
if (!aufsteigend)
|
||||
{
|
||||
foreach (var anz in anzahlDiensteProMitarbeiter)
|
||||
List<DienstBlockDC> bloeckeNeuSortiert = new List<DienstBlockDC>();
|
||||
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<DienstBlockDC> bloeckeNeuSortiert = new List<DienstBlockDC>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user