Bugfix Sonntagszuschläge im Stundenkonto, div. Anpassungen (LH Frankfurt Oder, HPH Bersenbrück, PariSozial, Frau Hildmann)
This commit is contained in:
@@ -1583,7 +1583,12 @@ namespace BeWo.ViewModel
|
||||
get
|
||||
{
|
||||
|
||||
//CB: Ich muss das hier so kompliziert machen, weil ich eine unsortierte Liste von Zielen und Maßnahmen in ein sortierte Liste innerhalb der Ziele/Maßnahmen Baumstruktur überführen muss
|
||||
var goals = new List<ValueListEntryDC>();
|
||||
var firstLevelGoals = new List<ValueListEntryDC>();
|
||||
Dictionary<long, ValueListEntryDC> oid2Entry = new Dictionary<long, ValueListEntryDC>();
|
||||
Dictionary<long, List<ValueListEntryDC>> oid2ChildList = new Dictionary<long, List<ValueListEntryDC>>();
|
||||
|
||||
foreach (var goal in SelectedGoals)
|
||||
{
|
||||
if (goal.Type == ValueListEntryType.SupportConceptGoalCategoryType || goal.Type == ValueListEntryType.SupportConceptIndividualGoalCategoryType)
|
||||
@@ -1606,8 +1611,36 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in goals)
|
||||
{
|
||||
if (!oid2Entry.ContainsKey(item.ValueListEntryOid.Value))
|
||||
{
|
||||
oid2Entry.Add(item.ValueListEntryOid.Value, item);
|
||||
}
|
||||
}
|
||||
foreach (var item in goals)
|
||||
{
|
||||
if (!item.ParentOid.HasValue || !oid2Entry.ContainsKey(item.ParentOid.Value))
|
||||
{
|
||||
firstLevelGoals.Add(item);
|
||||
}
|
||||
|
||||
if (item.ParentOid.HasValue)
|
||||
{
|
||||
if (!oid2ChildList.ContainsKey(item.ParentOid.Value))
|
||||
{
|
||||
oid2ChildList.Add(item.ParentOid.Value, new List<ValueListEntryDC>());
|
||||
}
|
||||
oid2ChildList[item.ParentOid.Value].Add(item);
|
||||
}
|
||||
}
|
||||
var sortedGoals = new List<ValueListEntryDC>();
|
||||
foreach (var item in firstLevelGoals.OrderBy(g => g.DisplayName))
|
||||
{
|
||||
AddGoalWithChildren(item, oid2ChildList, sortedGoals);
|
||||
}
|
||||
var goalString = "";
|
||||
foreach (var goal in goals)
|
||||
foreach (var goal in sortedGoals)
|
||||
{
|
||||
|
||||
if (goalString.Length > 0)
|
||||
@@ -1619,6 +1652,18 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private void AddGoalWithChildren(ValueListEntryDC item, Dictionary<long, List<ValueListEntryDC>> oid2ChildList, List<ValueListEntryDC> sortedGoals)
|
||||
{
|
||||
sortedGoals.Add(item);
|
||||
if (oid2ChildList.ContainsKey(item.ValueListEntryOid.Value))
|
||||
{
|
||||
foreach (var child in oid2ChildList[item.ValueListEntryOid.Value].OrderBy(g => g.DisplayName))
|
||||
{
|
||||
AddGoalWithChildren(child, oid2ChildList, sortedGoals);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String MassnahmenString
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user