XML Klammern

This commit is contained in:
2026-02-03 15:15:14 +01:00
parent 253f43edaa
commit c4149ca4a7

View File

@@ -31,49 +31,64 @@ namespace AICore.Context.SummaryParser
if (context is null || context.Context is null)
return string.Empty;
var sb = new StringBuilder();
if (context.Context is IEnumerable<BaseContextEntry> values)
{
return ToCsvString(values);
sb.AppendLine($"<Context>");
sb.AppendLine(ToCsvString(values));
sb.AppendLine($"</Context>");
return sb.ToString();
}
else if (context.Context is BaseContextEntry value)
{
return ToCsvString(value);
sb.AppendLine($"<Context>");
sb.AppendLine(ToCsvString(value));
sb.AppendLine($"</Context>");
return sb.ToString();
}
var sb = new StringBuilder();
if (context is ServiceRecordNavigationCS summary)
{
sb.AppendLine($"#### **Hilfeplan**");
sb.AppendLine($"<Hilfeplan>");
sb.AppendLine(summary.SupportConcept);
sb.AppendLine($"</Hilfeplan>");
sb.AppendLine();
sb.AppendLine("#### **Kostenträger**");
sb.AppendLine($"<Kostenträger>");
sb.AppendLine(summary.CostBearer);
sb.AppendLine($"</Kostenträger>");
sb.AppendLine();
sb.AppendLine("#### **Klient**");
sb.AppendLine($"<Klient>");
sb.AppendLine(ToCsvString(summary.Customer));
sb.AppendLine($"</Klient>");
sb.AppendLine();
sb.AppendLine("#### **Zeiterfassungseinträge**");
sb.AppendLine($"<Zeiterfassungseinträge>");
sb.AppendLine(ToCsvString(summary.DataContext));
sb.AppendLine($"</Zeiterfassungseinträge>");
sb.AppendLine();
return sb.ToString();
}
else if (context is ServiceRecordDocumantationFCS fcs)
{
sb.AppendLine($"#### **Hilfeplan**");
sb.AppendLine($"<Hilfeplan>");
sb.AppendLine(fcs.SupportConcept);
sb.AppendLine($"</Hilfeplan>");
sb.AppendLine();
sb.AppendLine("#### **Kostenträger**");
sb.AppendLine($"<Kostenträger>");
sb.AppendLine(fcs.CostBearer);
sb.AppendLine($"</Kostenträger>");
sb.AppendLine();
sb.AppendLine("#### **Klient**");
sb.AppendLine($"<Klient>");
sb.AppendLine(ToCsvString(fcs.Customer));
sb.AppendLine($"</Klient>");
sb.AppendLine();
sb.AppendLine("#### **Zeiterfassungseinträge**");
sb.AppendLine($"<Zeiterfassungseinträge>");
sb.AppendLine(ToCsvString(fcs.ServiceRecords));
sb.AppendLine($"</Zeiterfassungseinträge>");
sb.AppendLine();
sb.AppendLine("#### **Dokumentations(text)**");
sb.AppendLine($"<Dokumentationseinträge>");
sb.AppendLine(fcs.Dokutext);
sb.AppendLine();
sb.AppendLine($"</Dokumentationseinträge>");
return sb.ToString();
}