Texte austauschen
This commit is contained in:
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.VisualStudio.Web.CodeGeneration.Contracts.Messaging;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -387,16 +388,6 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
oMessage = Regex.Replace(oMessage, "@REPLACE_PARAM2", ex.Param2, RegexOptions.IgnoreCase);
|
oMessage = Regex.Replace(oMessage, "@REPLACE_PARAM2", ex.Param2, RegexOptions.IgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Der REJECTION-Code wird in alle Meldungen eingefügt.
|
|
||||||
if (!string.IsNullOrEmpty(rejectionCodeNumber) && oMessage.Contains("@REJECTION_CODE", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
var substituteText = this.GetLabelText("Ablehnungscode", _UserLanguageCode);
|
|
||||||
substituteText = string.IsNullOrEmpty(substituteText) ? "Ablehnungscode" : substituteText;
|
|
||||||
substituteText = substituteText + ": " + rejectionCodeNumber;
|
|
||||||
|
|
||||||
oMessage = Regex.Replace(oMessage, "@REJECTION_CODE", substituteText, RegexOptions.IgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine if any errors should be sent in the response
|
// Determine if any errors should be sent in the response
|
||||||
switch (ex.ErrorCode)
|
switch (ex.ErrorCode)
|
||||||
{
|
{
|
||||||
@@ -533,18 +524,6 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
oReturnValue = oDbMessage;
|
oReturnValue = oDbMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Der REJECTION-Code wird in alle Meldungen eingefügt.
|
|
||||||
if (!string.IsNullOrEmpty(oRejectionItem) && oReturnValue.Contains("@REJECTION_CODE", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
var rejectionCodeNumber = GetRejectionCodeNumber(oRejectionItem);
|
|
||||||
|
|
||||||
var substituteText = this.GetLabelText("Ablehnungscode", _UserLanguageCode);
|
|
||||||
substituteText = string.IsNullOrEmpty(substituteText) ? "Ablehnungscode" : substituteText;
|
|
||||||
substituteText = substituteText + ": " + rejectionCodeNumber;
|
|
||||||
|
|
||||||
oReturnValue = Regex.Replace(oReturnValue, "@REJECTION_CODE", substituteText, RegexOptions.IgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -929,10 +908,26 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
i.Language.Equals(GERMAN, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
i.Language.Equals(GERMAN, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageItem != null)
|
if (messageItem != null && !string.IsNullOrEmpty(pErrorCode))
|
||||||
{
|
{
|
||||||
_logger.Info("GetRejectionMessage() - messageItem: '" + messageItem.String1 + "'");
|
var resultText = string.Empty;
|
||||||
return messageItem.String1;
|
|
||||||
|
// Der REJECTION-Code wird in allen Meldungen ausgetauscht.
|
||||||
|
if (messageItem.String1.Contains("@REJECTION_CODE", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var substituteText = this.GetLabelText("Ablehnungscode", _UserLanguageCode);
|
||||||
|
substituteText = string.IsNullOrEmpty(substituteText) ? "Ablehnungscode" : substituteText;
|
||||||
|
substituteText = substituteText + ": " + pErrorCode;
|
||||||
|
|
||||||
|
resultText = Regex.Replace(messageItem.String1, "@REJECTION_CODE", substituteText, RegexOptions.IgnoreCase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resultText = messageItem.String1;
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.Info("GetRejectionMessage() - messageItem: '" + resultText + "'");
|
||||||
|
return resultText;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user