MoK: Anzeigenbug behoben bei dem Ziele bei den Maßnahmen auftauchten.

This commit is contained in:
2024-06-26 17:09:34 +02:00
parent d4b6d01ccc
commit f2918b433d

View File

@@ -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 += $"<strong>({goalRating.DisplayName})</strong>";
massnahmenString += $"<strong style='color: blue;'>({goalRating.DisplayName})</strong>";
}
}
#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:
</div>
<div class="col">
@goalCategoriesString
@zieleString
</div>
</div>
<div class="row">
<div class="col text-secondary">
Maßnahmen:
if(serviceRecord.Goals.Any(goal => goal.Type == ValueListEntryType.SupportConceptGoalType || goal.Type == ValueListEntryType.SupportConceptIndividualGoalType))
{
<div class="row">
<div class="col text-secondary">
Maßnahmen:
</div>
<div class="col">
@(new HtmlString(massnahmenString))
</div>
</div>
<div class="col">
@*@Html.Raw(goalsString)*@
@(new HtmlString(goalsString))
</div>
</div>
}
}
<div class="row">
<div class="col text-secondary">