diff --git a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml index 5e6692bdd..8f11bc72e 100644 --- a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml @@ -183,20 +183,24 @@ var durationStr = serviceRecord.GroupOid.HasValue ? string.Format("{0:###0.#} ({0:###0.#})", roundedDuration) : $"{duration:###0.#} ({roundedDuration:###0.#})"; - var goalsString = string.Empty; - var goalCategoriesString = string.Empty; + var massnahmenString = string.Empty; + var zieleString = string.Empty; if(serviceRecord.Goals != null && serviceRecord.Goals.Count > 0) { - foreach(var goal in serviceRecord.Goals) + foreach(var goal in serviceRecord.Goals.Where(g => g.Type == ValueListEntryType.SupportConceptGoalType || g.Type == ValueListEntryType.SupportConceptIndividualGoalType)) { - if(goal.Abbreviation != null) + if(goal.Abbreviation != null && goal.TypeDescription != null) { - goalsString += $"{goal.Abbreviation}: {goal.TypeDescription}"; + massnahmenString += $"{goal.Abbreviation}: {goal.TypeDescription}"; } - else + else if(goal.Abbreviation is null && goal.TypeDescription != null) { - goalsString += goal.TypeDescription; + massnahmenString += goal.TypeDescription; + } + else if(goal.Abbreviation != null && goal.TypeDescription is null) + { + massnahmenString += goal.Abbreviation; } #if DEBUG @@ -206,14 +210,14 @@ if(goalRating?.DisplayName != null && goalRating.DisplayName.Length > 0) { - goalsString += $"({goalRating.DisplayName})"; + massnahmenString += $"({goalRating.DisplayName})"; } } #endif if(serviceRecord.Goals.IndexOf(goal) < serviceRecord.Goals.Count - 1) { - goalsString += ", "; + massnahmenString += ", "; } } @@ -221,11 +225,11 @@ { foreach(var goalHeader in Model.ServiceRecordOids2GoalHeader[serviceRecord.ServiceRecordOid.Value]) { - goalCategoriesString += $"{goalHeader}, "; + zieleString += $"{goalHeader}, "; } } - goalCategoriesString = goalCategoriesString.TrimEnd(' ').TrimEnd(','); + zieleString = zieleString.TrimEnd(' ').TrimEnd(','); } var cardBackground = serviceRecord.ServiceRecordType == ServiceRecordTypeId.Content ? "bg-service-record-marked" : serviceRecord.GroupOid.HasValue ? "bg-bewo-group-booking" : string.Empty; @@ -329,18 +333,20 @@ Ziele:
- @goalCategoriesString + @zieleString
-
-
- Maßnahmen: + if(serviceRecord.Goals.Any(goal => goal.Type == ValueListEntryType.SupportConceptGoalType || goal.Type == ValueListEntryType.SupportConceptIndividualGoalType)) + { +
+
+ Maßnahmen: +
+
+ @(new HtmlString(massnahmenString)) +
-
- @*@Html.Raw(goalsString)*@ - @(new HtmlString(goalsString)) -
-
+ } }