update 20250317

This commit is contained in:
Stefan Hutter
2025-03-18 06:37:31 +01:00
parent 238e592ec8
commit 7e3381c926
280 changed files with 2730906 additions and 197 deletions

View File

@@ -44,6 +44,10 @@
<Reference Include="BitMiracle.LibTiff.NET, Version=2.4.649.0, Culture=neutral, PublicKeyToken=53879b3e20e7a7d6, processorArchitecture=MSIL">
<HintPath>..\packages\BitMiracle.LibTiff.NET.2.4.649\lib\net40\BitMiracle.LibTiff.NET.dll</HintPath>
</Reference>
<Reference Include="DOCGEN, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\DOCGEN.dll</HintPath>
</Reference>
<Reference Include="Logging, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Logging\bin\Debug\Logging.dll</HintPath>

View File

@@ -15,10 +15,12 @@ using OfficePrinter;
using Syncfusion.XlsIO.Implementation.PivotAnalysis;
using OnDocOffice;
using System.Threading;
using System.IO;
using Syncfusion.XlsIO.Implementation.XmlSerialization;
namespace DOCGEN.Generator
{
public class DocGenerator_from_EDOKA
{
public string connectionstring;
@@ -46,28 +48,35 @@ namespace DOCGEN.Generator
{
this.connectionstring = connectionstring;
Lic();
this.apikey= ApiKey;
this.resturi= RestUri;
this.apikey = ApiKey;
this.resturi = RestUri;
}
public DocGenerator_from_EDOKA(string connectionstring, string tempdir, string RestUri, string ApiKey, int Office_Fill_DocIO)
{
this.connectionstring = connectionstring;
this.connectionstring = connectionstring;
this.tempdir = tempdir;
this.resturi = RestUri;
this.apikey = ApiKey;
this.Office_Fill_DocIO= Office_Fill_DocIO;
this.Office_Fill_DocIO = Office_Fill_DocIO;
}
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep=0, bool vbfilemanagement = false, bool editdoc=false)
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep = 0, bool vbfilemanagement = false, bool editdoc = false)
{
if (docdata.Bezeichnung.Contains("QDF"))
{
generate_docdata(dokumentid, ref docdata);
Generate_QDF(dokumentid, ref docdata, tempdir);
clsdok dokempty = new clsdok("", "", "QDF","");
return dokempty;
}
useoffice = docdata.Erstellung_in_Office;
try
{
if (docdata.FillOffice == true) { Office_Fill_DocIO = 0; } else { Office_Fill_DocIO = 1; }
}
catch { Office_Fill_DocIO=0; }
catch { Office_Fill_DocIO = 0; }
DB db = new DB(connectionstring);
DataTable dt = new DataTable();
DataTable dt2 = new DataTable();
@@ -77,7 +86,7 @@ namespace DOCGEN.Generator
Logging.Logging.Debug("Generate_Doc_EDOKA", "Get_Vorlage", dokumentid);
if (!editdoc)
{
dt = db.Get_Vorlage_By_DokumentID(dokumentid, useoffice, tempdir,false);
dt = db.Get_Vorlage_By_DokumentID(dokumentid, useoffice, tempdir, false);
}
else
{
@@ -94,7 +103,7 @@ namespace DOCGEN.Generator
{
case "DOCX": case "DOCM": case "DOC": case "DOT":
case "WORD": case "DOTM":
SyncFWord sfword = new SyncFWord(resturi,apikey);
SyncFWord sfword = new SyncFWord(resturi, apikey);
generate_docdata(dokumentid, ref docdata);
clsdok dok = new clsdok("", "", "", "");
if (useoffice == false) {
@@ -117,12 +126,12 @@ namespace DOCGEN.Generator
else
{
Logging.Logging.Debug("Generate_Word_in_Office", "Init", dokumentid);
OnDocOffice.clsWordEdit oo = new OnDocOffice.clsWordEdit("", "","",resturi,apikey);
OnDocOffice.clsWordEdit oo = new OnDocOffice.clsWordEdit("", "", "", resturi, apikey);
Logging.Logging.Debug("Generate_Word_in_Office", "Start", dokumentid);
dok.dokument = oo.Generate_Word_in_Office(ref docdata, ref dok, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype,Extension,OfficeSleep,Office_Fill_DocIO, vbfilemanagement,editdoc);
dok.dokument = oo.Generate_Word_in_Office(ref docdata, ref dok, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype, Extension, OfficeSleep, Office_Fill_DocIO, vbfilemanagement, editdoc);
Logging.Logging.Debug("Generate_Word_in_Office", "Ende", dokumentid);
oo = null;
oo = null;
}
dok.doktype = "W";
@@ -153,14 +162,14 @@ namespace DOCGEN.Generator
//break;
case "PDF": case "ACROBAT": case "FORMULAR": case "DOKUMENT":
clsdok dokpdf = new clsdok("", "", "", "");
dokpdf.dokument= dt.Rows[0][0].ToString();
dokpdf.dokument = dt.Rows[0][0].ToString();
dokpdf.extension = Extension;
dokpdf.doktype = "P";
return dokpdf;
//break ;
default:
Logger.Info("DocGenerator_from_EDOKA: FileType unknown"+ Apptype);
clsdok dokempty = new clsdok("", "", "", "" );
Logger.Info("DocGenerator_from_EDOKA: FileType unknown" + Apptype);
clsdok dokempty = new clsdok("", "", "", "");
return dokempty;
//break;
}
@@ -211,8 +220,65 @@ namespace DOCGEN.Generator
//docdata.VornameNameTextmarken = NameVornameTM;
db = null;
}
public void Generate_QDF(string dokumentid, ref clsDocData docdata, string tempdir)
{
DB db = new DB(connectionstring);
db.Get_Tabledata("Select * from ondoc_qdf_parameter where aktiv=1", false, true);
string qdfsource = db.dsdaten.Tables[0].Rows[0][1].ToString();
string qdfviewer = db.dsdaten.Tables[0].Rows[0][2].ToString();
string dokumentname = tempdir + dokumentid + ".qdf";
System.IO.File.Copy(qdfsource, dokumentname);
StreamReader fi = new StreamReader(dokumentname);
string daten;
daten = fi.ReadToEnd();
generate_docdata(dokumentid, ref docdata);
db.clear_parameter();
db.add_parameter("@fnkt", "1");
db.add_parameter("@partnernr", docdata.PartnerNr.ToString());
db.add_parameter("@mitarbeiternr", docdata.Ersteller.ToString());
foreach (clsDocValue dv in docdata.DocValues)
{
try
{
if (dv.FieldName.ToString() == "&policen_nr&")
{
db.add_parameter("@policenr", dv.Value.ToString());
}
//daten = daten.Replace(dv.FieldName.ToString(), dv.Value);
}
catch { }
}
db.Get_Tabledata("ondoc_qdf_parameters", true, false);
clsDocValue docval = new clsDocValue();
docval.FieldName = "&meldungs_nr&";
docval.Value = db.dsdaten.Tables[0].Rows[0][0].ToString();
docdata.DocValues.Add(docval);
foreach (clsDocValue dv in docdata.DocValues)
{
try
{
daten = daten.Replace(dv.FieldName.ToString(), dv.Value);
}
catch { }
}
fi.Close();
StreamWriter fo = new StreamWriter(dokumentname);
fo.Write(daten);
fo.Flush();
fo.Close();
ProcessStartInfo PI = new ProcessStartInfo();
PI.FileName = qdfviewer;
PI.Arguments = dokumentname;
Process.Start(PI);
db.add_parameter("@dokumentid", dokumentid);
db.Get_Tabledata("ondoc_check_delete_einzeldokument", true, false);
db = null;
//Process.Start(qdfviewer + " " + dokumentname);
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -146,6 +146,8 @@ namespace DOCGEN
return true;
}
//public void createpdf(string filename)
//{
// WordDocument document = new WordDocument(filename, FormatType.Automatic);

View File

@@ -75,7 +75,6 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\x64\libSkiaSharp.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\arm64\libSkiaSharp.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\DOCGEN.dll.config
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\DOCGEN.xml
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\DOCGEN.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\DOCGEN.pdb
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\BarcodeLib.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\BitMiracle.LibTiff.NET.dll

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
2683c48cbc400bc612c49122442eb254f7416d0852cd917397789686b7b36322
b10a101c8e030ed85b9cc79cdeb089225d36f4a630a94c1784013aeb4be2db03