BT-Felder
This commit is contained in:
@@ -11,6 +11,7 @@ using static DigitalData.Modules.Interfaces.PropertyValues;
|
||||
using System.Data.SqlClient;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Xml.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
@@ -387,15 +388,32 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pProperty.ItemType == 0 && string.IsNullOrEmpty(pProperty.Value.ToString()))
|
||||
{
|
||||
// Leere Texte speichern wir nicht in der DB
|
||||
return true;
|
||||
}
|
||||
|
||||
var oSql = $"INSERT INTO {pProperty.TableName} " +
|
||||
"(REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, CREATEDWHO, SPEC_NAME, GROUP_COUNTER, IS_REQUIRED) VALUES " +
|
||||
"(@REFERENCE_GUID, @ITEM_DESCRIPTION, @ITEM_VALUE, @CREATEDWHO, @SPEC_NAME, @GROUP_COUNTER, @IS_REQUIRED)";
|
||||
|
||||
string itemValue = string.Empty;
|
||||
if (pProperty.Value.Length > 900)
|
||||
{
|
||||
itemValue = pProperty.Value.Substring(1, 899);
|
||||
_logger.Warn("Value for field [{0}] is longer than 900 characters, will be truncated!", pProperty.TableColumn);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemValue = pProperty.Value;
|
||||
}
|
||||
|
||||
var oParams = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@REFERENCE_GUID", pMessageId),
|
||||
new SqlParameter("@ITEM_DESCRIPTION", pProperty.Description),
|
||||
new SqlParameter("@ITEM_VALUE", pProperty.Value),
|
||||
new SqlParameter("@ITEM_VALUE", itemValue.Replace("'", "''")),
|
||||
new SqlParameter("@CREATEDWHO", ADDED_WHO),
|
||||
new SqlParameter("@GROUP_COUNTER", pProperty.GroupCounter),
|
||||
new SqlParameter("@SPEC_NAME", pProperty.TableColumn),
|
||||
|
||||
Reference in New Issue
Block a user