update 20251210
This commit is contained in:
15
ZZPDFTest/Form1.Designer.cs
generated
15
ZZPDFTest/Form1.Designer.cs
generated
@@ -39,6 +39,7 @@
|
||||
this.pdfViewerControl1 = new Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl();
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.button7 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
@@ -133,7 +134,7 @@
|
||||
//
|
||||
// button6
|
||||
//
|
||||
this.button6.Location = new System.Drawing.Point(156, 0);
|
||||
this.button6.Location = new System.Drawing.Point(102, 12);
|
||||
this.button6.Name = "button6";
|
||||
this.button6.Size = new System.Drawing.Size(75, 23);
|
||||
this.button6.TabIndex = 6;
|
||||
@@ -141,11 +142,22 @@
|
||||
this.button6.UseVisualStyleBackColor = true;
|
||||
this.button6.Click += new System.EventHandler(this.button6_Click);
|
||||
//
|
||||
// button7
|
||||
//
|
||||
this.button7.Location = new System.Drawing.Point(218, -2);
|
||||
this.button7.Name = "button7";
|
||||
this.button7.Size = new System.Drawing.Size(75, 23);
|
||||
this.button7.TabIndex = 7;
|
||||
this.button7.Text = "button7";
|
||||
this.button7.UseVisualStyleBackColor = true;
|
||||
this.button7.Click += new System.EventHandler(this.button7_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1465, 854);
|
||||
this.Controls.Add(this.button7);
|
||||
this.Controls.Add(this.button6);
|
||||
this.Controls.Add(this.button5);
|
||||
this.Controls.Add(this.pdfViewerControl1);
|
||||
@@ -169,6 +181,7 @@
|
||||
private Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl pdfViewerControl1;
|
||||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.Button button6;
|
||||
private System.Windows.Forms.Button button7;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,11 @@ using System.IO;
|
||||
using System.Drawing.Printing;
|
||||
using Syncfusion.Windows.Forms.PdfViewer;
|
||||
using Syncfusion.Windows.PdfViewer;
|
||||
using Newtonsoft;
|
||||
using Newtonsoft;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
namespace ZZPDFTest
|
||||
{
|
||||
@@ -270,5 +274,70 @@ namespace ZZPDFTest
|
||||
{
|
||||
pdfViewerControl1.Load(@"E:\Software-Projekte\OnDoc\Office_Vorlagen\20251110_PRIIP Arete Ethik Vorsorgefonds Global Balanced.pdf");
|
||||
}
|
||||
|
||||
private void button7_Click(object sender, EventArgs e)
|
||||
|
||||
{
|
||||
string jsonstring = System.IO.File.ReadAllText(@"E:\Software-Projekte\OnDoc\Office_Vorlagen\essdemo.json");
|
||||
|
||||
dynamic dataj = JsonConvert.DeserializeObject(jsonstring);
|
||||
Console.WriteLine(dataj.Bp.Zustaendiger.TgNummer);
|
||||
|
||||
|
||||
|
||||
|
||||
//foreach (var bpis in JsonConvert.DeserializeObject<dynamic>(jsonstring))
|
||||
//{
|
||||
// Console.WriteLine(bpis.Name);
|
||||
// Console.WriteLine(bpis.Value);
|
||||
|
||||
//}
|
||||
|
||||
List<docitem> docitemlist = new List<docitem>();
|
||||
var jo = JObject.Parse(jsonstring);
|
||||
var valueTuples = GetNodes(jo).ToList();
|
||||
foreach ( var valueTuple in valueTuples)
|
||||
{
|
||||
docitem d = new docitem();
|
||||
d.itemname= valueTuple.Item1;
|
||||
d.itemtag= valueTuple.Item2;
|
||||
d.itemvalue= valueTuple.Item3;
|
||||
d.doclinkname = "";
|
||||
docitemlist.Add(d);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class docitem
|
||||
{
|
||||
public string itemname;
|
||||
public string itemtag;
|
||||
public string itemvalue;
|
||||
public string doclinkname;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user