using System.Collections.Generic;
namespace Custom.TestAssembly
{
public class ExampleAction
{
public Dictionary<string,object> Execute(Dictionary<string, object> parameter)
{
var client = parameter.TryGetValue("Client", out var clientObj) ? clientObj as Mandant : null;
var documentId = parameter.TryGetValue("DocumentId", out var documentIdObj) && int.TryParse(documentIdObj?.ToString(), out var documentIdParsed) ? documentIdParsed : (int?)null;
var automatic = parameter.TryGetValue("Automatic", out var automaticObj) && automaticObj != null ? (bool)automaticObj : false;
var cultureId = parameter.TryGetValue("CultureId", out var cultureIdObj) && cultureIdObj != null ? cultureIdObj?.ToString() : "de-DE (Fallback)";
var erpUser = parameter.TryGetValue("ErpUser", out var erpUserObj) ? erpUserObj as string : null;
var locationKey = parameter.TryGetValue("LocationKey", out var locationKeyObj) ? locationKeyObj as string : null;
var result = new Dictionary<string, object>();
result.Add("Message", new string[] {
$"Standort: {locationKey}",
$"Automatisch: {automatic}",
$"Lokalisierung: {cultureId}",
$"ERP-Benutzer: {erpUser}"
});
result.Add("MessageType", "Information");
result.Add("PrintDocumentId", documentId);
return result;
}
}
}
0 Kommentare