update 20250119
This commit is contained in:
@@ -21,6 +21,7 @@ using static BroadcastListener.Classes.Factory;
|
||||
using OnDoc.Helper;
|
||||
using DOCGEN;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
|
||||
namespace OnDoc.DocMgmt
|
||||
{
|
||||
@@ -183,12 +184,17 @@ namespace OnDoc.DocMgmt
|
||||
//Erstellung Office
|
||||
if (ucAllgemeineDokumentParam1.docgendata.erstellungsart == Erstellungsart.ErstellungInOffice)
|
||||
{
|
||||
Logging.Logging.Debug("Dokumentbearbeitung Erstellungsart.ErstellungInOffice", "OnDocClient", "");
|
||||
string filename = AppParams.tempdir + dokumentid + "_Erstellt_." + dok.extension;
|
||||
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
db = null;
|
||||
Logging.Logging.Debug("Dokumentbearbtung Saved", "OnDocClient", "");
|
||||
System.IO.File.Delete(filename);
|
||||
Logging.Logging.Debug("Dokumentbearbtung Deleted", "OnDocClient", "");
|
||||
|
||||
filename = AppParams.tempdir + dokumentid +"." + dok.extension;
|
||||
this.filename = filename;
|
||||
DocFunction = 6;
|
||||
@@ -198,10 +204,11 @@ namespace OnDoc.DocMgmt
|
||||
//Bearbeiten
|
||||
if (ucAllgemeineDokumentParam1.docgendata.erstellungsart == Erstellungsart.DokumentBearbeiten)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
Logging.Logging.Debug("Dokumentbearbietung Erstellungsart.DokumentBearbeiten", "OnDocClient", "");
|
||||
//string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
string filename = AppParams.tempdir + dokumentid + "_Erstellt_." + dok.extension;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
db.Get_Tabledata("Select count(*) from idvmakro_office_vorlage where office_vorlagenr=" + ucAllgemeineDokumentParam1.vorlagenr.ToString(), false, true);
|
||||
if (Convert.ToInt32(db.dsdaten.Tables[0].Rows[0][0]) > 0)
|
||||
@@ -210,13 +217,17 @@ namespace OnDoc.DocMgmt
|
||||
runmacros = true;
|
||||
}
|
||||
db = null;
|
||||
Logging.Logging.Debug("Dokumentbearbeitung DocFunction1", "OnDocClient", "");
|
||||
DocFunction = 1;
|
||||
System.IO.File.Delete(filename);
|
||||
filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
this.filename = filename;
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
if (ucAllgemeineDokumentParam1.docgendata.erstellungsart == Erstellungsart.DokumentPreview)
|
||||
{
|
||||
Logging.Logging.Debug("Dokumentbearbietung Erstellungsart.DokumentBearbeiten", "DokumentPreview", "");
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
@@ -225,6 +236,7 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
if (ucAllgemeineDokumentParam1.docgendata.erstellungsart == Erstellungsart.DokumentAlsPDF)
|
||||
{
|
||||
Logging.Logging.Debug("Dokumentbearbietung Erstellungsart.DokumentAlsPDF", "DokumentPreview", "");
|
||||
//Generator.DocToPDF(dokumentid, ref dok);
|
||||
dok.extension = "pdf";
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
@@ -235,6 +247,7 @@ namespace OnDoc.DocMgmt
|
||||
|
||||
if (ucAllgemeineDokumentParam1.docgendata.erstellungsart == Erstellungsart.DokumentSpäterBearbeiten)
|
||||
{
|
||||
Logging.Logging.Debug("Dokumentbearbietung Erstellungsart.DokumentSpäterBearbeiten", "DokumentPreview", "");
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
|
||||
@@ -63,6 +63,19 @@ namespace OnDoc.DocMgmt
|
||||
this.dokumentpaketnr = dokumentpaketnr;
|
||||
this.partnernr = partnernr;
|
||||
}
|
||||
public Dokumentpaket(int dokumentpaketnr, int partnernr, int profilnr)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Style.TitleBar.BackColor = Theaming.Titelbar();
|
||||
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
|
||||
this.Style.ShadowOpacity = Theaming.ShadowOpacity;
|
||||
this.Style.InactiveShadowOpacity = Theaming.InactivShadowOpacity;
|
||||
Broadcaster().AddListener(this);
|
||||
Closing += Form_Closing;
|
||||
this.dokumentpaketnr = dokumentpaketnr;
|
||||
this.partnernr = partnernr;
|
||||
this.profilnr = profilnr;
|
||||
}
|
||||
|
||||
public Dokumentpaket(int profilnr)
|
||||
{
|
||||
@@ -232,6 +245,7 @@ namespace OnDoc.DocMgmt
|
||||
private void add_uc(System.Data.DataRow r)
|
||||
{
|
||||
UCAllgemeineDokumentParam newdoc = new UCAllgemeineDokumentParam();
|
||||
Logging.Logging.Debug("Dokumentpaket - Profilnr", "Dokumentpaket", this.profilnr.ToString());
|
||||
newdoc.profilnr = profilnr;
|
||||
newdoc.Dock= DockStyle.Fill;
|
||||
newdoc.checkpartner = false;
|
||||
@@ -483,6 +497,42 @@ namespace OnDoc.DocMgmt
|
||||
Logging.DocLog.Info("Dokument erstellt", "Dokumentpaket", dokumentid, uc.partnernr.ToString(), "Dokument erstellt");
|
||||
DOCGEN.Generator.DocGenerator_from_EDOKA Generator = new DOCGEN.Generator.DocGenerator_from_EDOKA(AppParams.connectionstring, AppParams.tempdir, AppParams.RESTURI,AppParams.apikey,AppParams.Office_Fill_DocIO);
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
if (dokdata.barcode_type == "1")
|
||||
{
|
||||
DB dB = new DB(AppParams.connectionstring);
|
||||
dB.clear_parameter();
|
||||
dB.add_parameter("@dokumentid", dokumentid);
|
||||
dB.add_parameter("@DokumentidBR", "");
|
||||
dB.add_parameter("@BARCODEFONTNAME", "");
|
||||
dB.add_parameter("@BARCODEFONTSIZE", "");
|
||||
dB.add_parameter("@BarcodeKantenlaenge", "");
|
||||
dB.Get_Tabledata("sp_get_OnDoc_barcodetype_and_value", true, false);
|
||||
dokdata.barcode_content = dB.dsdaten.Tables[0].Rows[0][1].ToString();
|
||||
dokdata.barcode_formatn = dB.dsdaten.Tables[0].Rows[0][3].ToString();
|
||||
dokdata.barcode_text = dB.dsdaten.Tables[0].Rows[0][4].ToString();
|
||||
dokdata.barcode_kantenlaenge = dB.dsdaten.Tables[0].Rows[0][5].ToString();
|
||||
dokdata.Zusatz_Font = dB.dsdaten.Tables[0].Rows[0][6].ToString();
|
||||
dokdata.Zusatz_FontSize = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][7]);
|
||||
dokdata.barcode_width = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][8]);
|
||||
dokdata.barcode_height = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0][9]);
|
||||
|
||||
//dokdata.barcode_type= dB.dsdaten.Tables[0].Rows[0][3].ToString();
|
||||
string sql = "";
|
||||
sql = "select bcpt, bcpl, bcw, bch, bchorizontal from OnDocBarcodeMpping ";
|
||||
sql = sql + "where orig_bcpt = " + dokdata.barcode_top.ToString() + " and orig_bcpl=" + dokdata.barcode_left.ToString() + " ";
|
||||
sql = sql + "and orig_bcw=" + dokdata.barcode_width.ToString() + " and orig_bch=" + dokdata.barcode_height.ToString();
|
||||
dB.Get_Tabledata(sql, false, true);
|
||||
if (dB.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
Logging.Logging.Debug("Barcode-Übersteuerung" + dokdata.DokumenttypNr.ToString(), "Dokumenterstellung", "");
|
||||
dokdata.barcode_left = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcpl"]);
|
||||
dokdata.barcode_top = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcpt"]);
|
||||
dokdata.barcode_width = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bcw"]);
|
||||
dokdata.barcode_height = Convert.ToInt32(dB.dsdaten.Tables[0].Rows[0]["bch"]);
|
||||
}
|
||||
|
||||
dB = null;
|
||||
}
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.ErstellungInOffice)
|
||||
{
|
||||
//panelword.Visible = true;
|
||||
@@ -520,9 +570,22 @@ namespace OnDoc.DocMgmt
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
db = null;
|
||||
|
||||
System.Diagnostics.Process.Start("winword.exe", filename);
|
||||
clsProcessWatch.AddToList(dokdata.Dokumentid, filename, "Word");
|
||||
|
||||
switch (dok.doktype)
|
||||
{
|
||||
case "W":
|
||||
System.Diagnostics.Process.Start("winword.exe", filename);
|
||||
clsProcessWatch.AddToList(dokdata.Dokumentid, filename, "Word");
|
||||
break;
|
||||
case "X":
|
||||
System.Diagnostics.Process.Start("excel.exe", " " + filename);
|
||||
clsProcessWatch.AddToList(dokdata.Dokumentid, filename, "Excel");
|
||||
break;
|
||||
case "P":
|
||||
System.Diagnostics.Process.Start(filename);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentAlsPDF)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user