update 20260220

This commit is contained in:
Stefan Hutter
2026-02-20 18:04:31 +01:00
parent 9e64ca707d
commit 30d047e33d
100 changed files with 11274 additions and 442 deletions

View File

@@ -0,0 +1,66 @@
using Microsoft.Ajax.Utilities;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace OnDocAPI_NetFramework.DocGenerators
{
public class CreateCLM
{
APIErrorSimple apireturn = new APIErrorSimple();
APIOK apiok = new APIOK();
List<CLMDocItem> clmdocitemlist = new List<CLMDocItem>();
string clmdokumentid = "";
string OwnHost = System.Configuration.ConfigurationManager.AppSettings["OwnHost"].ToString();
string imagepath = System.Configuration.ConfigurationManager.AppSettings["VSImagePath"].ToString();
public void CreateCLMDoc(string json)
{
dynamic dataj = null;
dataj = JsonConvert.DeserializeObject(json);
var jo = JObject.Parse(json);
var x = dataj.Produkt;
//Console.WriteLine(dataj.Bp.Zustaendiger.TgNummer);
var valueTuples = GetNodes(jo).ToList();
foreach (var valueTuple in valueTuples)
{
CLMDocItem d = new CLMDocItem();
d.itemname = valueTuple.Item1;
d.itemtag = valueTuple.Item2;
d.itemvalue = valueTuple.Item3;
d.doclinkname = "";
clmdocitemlist.Add(d);
}
var res = "";
}
private IEnumerable<(string path, string key, string value)> GetNodes(JToken token)
{
foreach (var jt in token.Children())
{
if (!jt.Children().Any())
{
yield return (
path: jt.Path,
key: jt.Path.Split('.').Last(),
value: jt.ToString()
);
}
foreach (var (path, key, value) in GetNodes(jt))
{
yield return (path, key, value);
}
}
}
}
}