Update 20241229
This commit is contained in:
@@ -25,6 +25,7 @@ namespace DOCGEN.Generator
|
||||
private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
public string apikey = "";
|
||||
public string resturi = "";
|
||||
public int Office_Fill_DocIO = 0;
|
||||
|
||||
public void Lic()
|
||||
{
|
||||
@@ -47,21 +48,24 @@ namespace DOCGEN.Generator
|
||||
this.resturi= RestUri;
|
||||
}
|
||||
|
||||
public DocGenerator_from_EDOKA(string connectionstring, string tempdir, string RestUri, string ApiKey)
|
||||
public DocGenerator_from_EDOKA(string connectionstring, string tempdir, string RestUri, string ApiKey, int Office_Fill_DocIO)
|
||||
{
|
||||
this.connectionstring = connectionstring;
|
||||
this.tempdir = tempdir;
|
||||
this.resturi = RestUri;
|
||||
this.apikey = ApiKey;
|
||||
this.Office_Fill_DocIO= Office_Fill_DocIO;
|
||||
}
|
||||
|
||||
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep=0 )
|
||||
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep=0)
|
||||
{
|
||||
DB db = new DB(connectionstring);
|
||||
DataTable dt = new DataTable();
|
||||
DataTable dt2 = new DataTable();
|
||||
string Apptype = "";
|
||||
string Extension = "";
|
||||
Logging.Logging.Debug("Generate_Doc_EDOKA", "Get_Vorlage", dokumentid);
|
||||
|
||||
dt = db.Get_Vorlage_By_DokumentID(dokumentid,useoffice);
|
||||
db.dsdaten.Tables.Clear();
|
||||
dt2 = db.Get_ApplicationType_from_Vorlage(Convert.ToInt32(dt.Rows[0]["nr"].ToString()));
|
||||
@@ -74,12 +78,21 @@ namespace DOCGEN.Generator
|
||||
SyncFWord sfword = new SyncFWord(resturi,apikey);
|
||||
generate_docdata(dokumentid, ref docdata);
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
if (useoffice == false) {
|
||||
dok.dokument = sfword.Generate_Word(dt.Rows[0][0].ToString(), docdata);
|
||||
} else
|
||||
if (useoffice == false) {
|
||||
Logging.Logging.Debug("Generate_Word", "Start", dokumentid);
|
||||
dok.dokument = sfword.Generate_Word(dt.Rows[0][0].ToString(), docdata);
|
||||
Logging.Logging.Debug("Generate_Word", "Ende", dokumentid);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.Debug("Generate_Word_in_Office", "Init", dokumentid);
|
||||
OnDocOffice.clsWordEdit oo = new OnDocOffice.clsWordEdit("", "","");
|
||||
dok.dokument = oo.Generate_Word_in_Office(ref docdata, ref dok, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype,Extension,OfficeSleep);
|
||||
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);
|
||||
Logging.Logging.Debug("Generate_Word_in_Office", "Ende", dokumentid);
|
||||
oo = null;
|
||||
}
|
||||
|
||||
dok.doktype = "D";
|
||||
@@ -88,12 +101,24 @@ namespace DOCGEN.Generator
|
||||
return dok;
|
||||
case "XLSM": case "XLSX": case "XLST": case "XLS": case "XLT":
|
||||
case "EXCEL":
|
||||
|
||||
SyncFExcel sfexcel = new SyncFExcel();
|
||||
generate_docdata(dokumentid, ref docdata);
|
||||
clsdok dokexcel = new clsdok("", "", "");
|
||||
dokexcel.dokument = sfexcel.Generate_Excel(dt.Rows[0][0].ToString(), docdata);
|
||||
dokexcel.doktype = "X";
|
||||
dokexcel.extension = dt2.Rows[0][1].ToString();
|
||||
if (useoffice == false)
|
||||
{
|
||||
dokexcel.dokument = sfexcel.Generate_Excel(dt.Rows[0][0].ToString(), docdata);
|
||||
dokexcel.doktype = "X";
|
||||
dokexcel.extension = dt2.Rows[0][1].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnDocOffice.clsExcelEdit eo = new OnDocOffice.clsExcelEdit("", "", "");
|
||||
dokexcel.dokument = eo.Generate_Excel_in_Office(ref docdata, ref dokexcel, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype, Extension, OfficeSleep, Office_Fill_DocIO);
|
||||
dokexcel.doktype = "X";
|
||||
dokexcel.extension = dt2.Rows[0][1].ToString();
|
||||
eo = null;
|
||||
}
|
||||
return dokexcel;
|
||||
//break;
|
||||
case "PDF": case "ACROBAT": case "FORMULAR": case "DOKUMENT":
|
||||
|
||||
Reference in New Issue
Block a user