From f2918b433d5226524cd63bae4e597aede40d070a Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Wed, 26 Jun 2024 17:09:34 +0200 Subject: [PATCH] =?UTF-8?q?MoK:=20Anzeigenbug=20behoben=20bei=20dem=20Ziel?= =?UTF-8?q?e=20bei=20den=20Ma=C3=9Fnahmen=20auftauchten.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/ServiceRecordListPartial.cshtml | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) 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)) -
-
+ } }