Update 20251107
This commit is contained in:
@@ -29,6 +29,7 @@ using static BroadcastListener.Classes.Factory;
|
||||
using Windows.Graphics.Display;
|
||||
using Windows.Foundation.Metadata;
|
||||
using System.Threading;
|
||||
using OnDoc.Diverses;
|
||||
|
||||
namespace OnDoc.DocMgmt
|
||||
{
|
||||
@@ -38,7 +39,7 @@ namespace OnDoc.DocMgmt
|
||||
private DataTable dokumentpaket = new DataTable();
|
||||
private DataTable dokumentpaketvorlagen = new DataTable();
|
||||
private DataTable dokumentpaketvorlagen_Original = new DataTable();
|
||||
private int profilnr {get;set;}
|
||||
private int profilnr { get; set; }
|
||||
public int dokumentpaketnr { get; set; } = 0;
|
||||
public int partnernr { get; set; } = 0;
|
||||
private bool EinzelGenerierung { get; set; } = false;
|
||||
@@ -125,24 +126,25 @@ namespace OnDoc.DocMgmt
|
||||
this.BeginUpdate();
|
||||
if (dokumentpaketnr == 0)
|
||||
{
|
||||
if (!NeuesDokumentpaket()){ this.Close(); return; };
|
||||
if (!NeuesDokumentpaket()) { this.Close(); return; };
|
||||
}
|
||||
Update_PaketDetails();
|
||||
dokList1.set_vorschau_aus_dp();
|
||||
if (this.txtbpnummer.Text == "") { btnSearchBP_Click(sender, e); }
|
||||
|
||||
|
||||
this.EndUpdate();
|
||||
}
|
||||
private void Update_PaketDetails() {
|
||||
private void Update_PaketDetails()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select * from edex_dokumentpaket where dokumentpaketnr="+dokumentpaketnr.ToString(), false, true);
|
||||
db.Get_Tabledata("Select * from edex_dokumentpaket where dokumentpaketnr=" + dokumentpaketnr.ToString(), false, true);
|
||||
dokumentpaket = db.dsdaten.Tables[0].Copy();
|
||||
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dpnr", dokumentpaketnr.ToString());
|
||||
string sql = "sp_ondoc_dpdetails";
|
||||
db.Get_Tabledata(sql,true,false);
|
||||
db.Get_Tabledata(sql, true, false);
|
||||
//string sql = "SELECT dbo.edex_dokumentpaket.dokumentpaketnr, dbo.edex_dokumentpaket.bezeichnung, dbo.dokumenttyp.dokumenttypnr, ";
|
||||
//sql = sql + "dbo.dokumenttyp.bezeichnung AS dokumenttypbezeichnung, dbo.edex_dokumentpaketvorlage.zwingend, ";
|
||||
//sql = sql + "dbo.edex_dokumentpaketvorlage.sort FROM dbo.edex_dokumentpaket INNER JOIN dbo.edex_dokumentpaketvorlage ON ";
|
||||
@@ -160,7 +162,7 @@ namespace OnDoc.DocMgmt
|
||||
sfListView1.AllowTriStateMode = false;
|
||||
sfListView1.CheckedMember = "zwingend";
|
||||
TabControlDokuments.TabPages.Clear();
|
||||
foreach(System.Data.DataRow r in dokumentpaketvorlagen.Rows)
|
||||
foreach (System.Data.DataRow r in dokumentpaketvorlagen.Rows)
|
||||
{
|
||||
if (Convert.ToInt32(r[4]) == 1) { add_uc(r); }
|
||||
}
|
||||
@@ -175,8 +177,8 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
this.RibbonButtonGenerieren.Enabled = false;
|
||||
this.groupBox1.Enabled = false;
|
||||
this.groupBox2.Enabled=false;
|
||||
this.groupBox3.Enabled=false;
|
||||
this.groupBox2.Enabled = false;
|
||||
this.groupBox3.Enabled = false;
|
||||
}
|
||||
this.EndUpdate();
|
||||
}
|
||||
@@ -185,7 +187,7 @@ namespace OnDoc.DocMgmt
|
||||
dokList1.profilnr = this.profilnr;
|
||||
dokList1.hide_panels();
|
||||
dokList1.dokpaket_update_grid();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -201,9 +203,10 @@ namespace OnDoc.DocMgmt
|
||||
|
||||
private void btnSearchBP_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.partnernr == 0) {
|
||||
Partnersuche ps = new Partnersuche();
|
||||
ps.ShowDialog();
|
||||
if (this.partnernr == 0)
|
||||
{
|
||||
Partnersuche ps = new Partnersuche();
|
||||
ps.ShowDialog();
|
||||
if (ps.DialogResult == DialogResult.OK)
|
||||
{
|
||||
this.txtbpnummer.Text = ps.partnernr.ToString(); ;
|
||||
@@ -216,8 +219,8 @@ namespace OnDoc.DocMgmt
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
set_bp_person(ps.partnernr,0);
|
||||
|
||||
set_bp_person(ps.partnernr, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,23 +236,46 @@ namespace OnDoc.DocMgmt
|
||||
ps.ShowDialog();
|
||||
if (ps.DialogResult == DialogResult.OK)
|
||||
{
|
||||
this.txtpersonnummer.Text = ps.partnernr.ToString();
|
||||
this.txtpersonnummer.Text = ps.partnernr.ToString();
|
||||
this.lblKurznamePerson.Text = ps.partnerkurzname.ToString();
|
||||
if (this.txtpersonnummer.Text.Length < 9) {
|
||||
if (this.txtpersonnummer.Text.Length < 9)
|
||||
{
|
||||
MessageBox.Show("Beim gewählten Partner handelt es ich nicht um eine Person.", "Partnerselektion", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
this.txtpersonnummer.Text = "";
|
||||
this.lblKurznamePerson.Text = "";
|
||||
return;
|
||||
}
|
||||
set_bp_person(0,ps.partnernr);
|
||||
set_bp_person(0, ps.partnernr);
|
||||
}
|
||||
}
|
||||
private void add_uc(System.Data.DataRow r)
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Get_Tabledata("Select isnull(uri,'') as uri, isnull(uribeschreibung,'') as descr from dokumenttyp where dokumenttypnr = " + r[2].ToString(), false, true);
|
||||
if (db.dsdaten.Tables[0].Rows[0][0].ToString() != "")
|
||||
{
|
||||
UCAllgemeinDokumentParamExtern extdoc = new UCAllgemeinDokumentParamExtern();
|
||||
extdoc.Dock = DockStyle.Fill;
|
||||
extdoc.dokumenttypnr = Convert.ToInt32(r[2]);
|
||||
if (extdoc.set_personendokument() == true)
|
||||
{
|
||||
if (txtpersonnummer.Text != "") { extdoc.partnernr = Convert.ToInt32(txtpersonnummer.Text); }
|
||||
}
|
||||
else
|
||||
{
|
||||
if (txtbpnummer.Text != "") { extdoc.partnernr = Convert.ToInt32(txtbpnummer.Text); }
|
||||
}
|
||||
extdoc.Refresh_Details(db.dsdaten.Tables[0].Rows[0][0].ToString(), db.dsdaten.Tables[0].Rows[0][1].ToString());
|
||||
TabPageAdv tabPage1 = new TabPageAdv(r[3].ToString());
|
||||
tabPage1.Controls.Add(extdoc);
|
||||
|
||||
TabControlDokuments.TabPages.Add(tabPage1);
|
||||
return;
|
||||
}
|
||||
UCAllgemeineDokumentParam newdoc = new UCAllgemeineDokumentParam();
|
||||
Logging.Logging.Debug("Dokumentpaket - Profilnr", "Dokumentpaket", this.profilnr.ToString());
|
||||
newdoc.profilnr = profilnr;
|
||||
newdoc.Dock= DockStyle.Fill;
|
||||
newdoc.Dock = DockStyle.Fill;
|
||||
newdoc.checkpartner = false;
|
||||
newdoc.dokumenttypnr = Convert.ToInt32(r[2]);
|
||||
if (newdoc.set_personendokument() == true)
|
||||
@@ -260,12 +286,12 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
if (txtbpnummer.Text != "") { newdoc.partnernr = Convert.ToInt32(txtbpnummer.Text); }
|
||||
}
|
||||
|
||||
|
||||
newdoc.Refresh_Details();
|
||||
|
||||
|
||||
TabPageAdv tabPage = new TabPageAdv(r[3].ToString());
|
||||
tabPage.Controls.Add(newdoc);
|
||||
|
||||
|
||||
TabControlDokuments.TabPages.Add(tabPage);
|
||||
}
|
||||
private void remove_uc(System.Data.DataRow r)
|
||||
@@ -273,7 +299,7 @@ namespace OnDoc.DocMgmt
|
||||
foreach (TabPageAdv tab in TabControlDokuments.TabPages)
|
||||
{
|
||||
if (tab.Text == r[3].ToString()) { TabControlDokuments.TabPages.Remove(tab); return; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,24 +357,24 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
Database.DB db = new Database.DB(AppParams.connectionstring);
|
||||
db.clear_parameter();
|
||||
if (bpnummer !=0) db.add_parameter("@partnernr", bpnummer.ToString());
|
||||
if (personnummer !=0) db.add_parameter("@partnernr", personnummer.ToString());
|
||||
if (bpnummer != 0) db.add_parameter("@partnernr", bpnummer.ToString());
|
||||
if (personnummer != 0) db.add_parameter("@partnernr", personnummer.ToString());
|
||||
db.Get_Tabledata("sp_ondoc_bp_person", true, false);
|
||||
|
||||
if (bpnummer!=0 && db.dsdaten.Tables[0].Rows.Count ==1)
|
||||
if (bpnummer != 0 && db.dsdaten.Tables[0].Rows.Count == 1)
|
||||
{
|
||||
txtbpnummer.Text = db.dsdaten.Tables[0].Rows[0]["bp_nr"].ToString();
|
||||
lblKurznameBP.Text = db.dsdaten.Tables[0].Rows[0]["bp_kurzname"].ToString();
|
||||
lblKurznameBP.Text = db.dsdaten.Tables[0].Rows[0]["bp_kurzname"].ToString();
|
||||
txtpersonnummer.Text = "";
|
||||
if (txtpersonnummer.Text=="")
|
||||
if (txtpersonnummer.Text == "")
|
||||
{
|
||||
txtpersonnummer.Text = db.dsdaten.Tables[0].Rows[0]["pers_nr"].ToString();
|
||||
lblKurznamePerson.Text = db.dsdaten.Tables[0].Rows[0]["person_kurzname"].ToString();
|
||||
}
|
||||
update_dokumente_bp_person(bpnummer, true);
|
||||
if (txtpersonnummer.Text!="") { update_dokumente_bp_person(Convert.ToInt32(txtpersonnummer.Text), false); }
|
||||
if (txtpersonnummer.Text != "") { update_dokumente_bp_person(Convert.ToInt32(txtpersonnummer.Text), false); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void update_dokumente_bp_person(int partnernr, bool bp)
|
||||
@@ -357,19 +383,38 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
foreach (TabPageAdv tab in TabControlDokuments.TabPages)
|
||||
{
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
uc.ausDokumentpaket = true;
|
||||
if (bp && !uc.personendokument)
|
||||
string ty = tab.Controls[0].GetType().Name;
|
||||
if (ty == "UCAllgemeineDokumentParam")
|
||||
{
|
||||
uc.partnernr = partnernr;
|
||||
uc.update_partner();
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
uc.ausDokumentpaket = true;
|
||||
if (bp && !uc.personendokument)
|
||||
{
|
||||
uc.partnernr = partnernr;
|
||||
uc.update_partner();
|
||||
}
|
||||
if (!bp && uc.personendokument)
|
||||
{
|
||||
uc.partnernr = partnernr;
|
||||
uc.update_partner();
|
||||
}
|
||||
uc.ausDokumentpaket = false;
|
||||
}
|
||||
if (!bp && uc.personendokument)
|
||||
if (ty == "UCAllgemeinDokumentParamExtern")
|
||||
{
|
||||
uc.partnernr = partnernr;
|
||||
uc.update_partner();
|
||||
UCAllgemeinDokumentParamExtern uce = (UCAllgemeinDokumentParamExtern)tab.Controls[0];
|
||||
if (bp && !uce.personendokument)
|
||||
{
|
||||
uce.partnernr = partnernr;
|
||||
uce.update_partner();
|
||||
}
|
||||
if (!bp && uce.personendokument)
|
||||
{
|
||||
uce.partnernr = partnernr;
|
||||
uce.update_partner();
|
||||
}
|
||||
}
|
||||
uc.ausDokumentpaket = false;
|
||||
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -402,31 +447,49 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
string errormessage = "";
|
||||
string dokumenterror = "";
|
||||
|
||||
|
||||
foreach (TabPageAdv tab in TabControlDokuments.TabPages)
|
||||
{
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
uc.ausDokumentpaket = true;
|
||||
uc.genertated_dokumentid=uc.genertated_dokumentid;
|
||||
dokumenterror = "";
|
||||
|
||||
if (uc.partnernr == 0) { dokumenterror = dokumenterror + "- Kein Partner gewählt" + Environment.NewLine; }
|
||||
else
|
||||
string ty = tab.Controls[0].GetType().Name;
|
||||
if (ty == "UCAllgemeineDokumentParam")
|
||||
{
|
||||
uc.check_bp_person();
|
||||
if (uc.bpperson_error_type == 1) { dokumenterror = dokumenterror + "- Dokument muss für eine Person erstellt werden" + Environment.NewLine; }
|
||||
if (uc.bpperson_error_type == 2) { dokumenterror = dokumenterror + "- Dokument muss für einen BP erstellt werden" + Environment.NewLine; }
|
||||
}
|
||||
if (!uc.check_fields())
|
||||
{
|
||||
dokumenterror = dokumenterror + uc.check_error + Environment.NewLine;
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
uc.ausDokumentpaket = true;
|
||||
uc.genertated_dokumentid = uc.genertated_dokumentid;
|
||||
dokumenterror = "";
|
||||
|
||||
if (uc.partnernr == 0) { dokumenterror = dokumenterror + "- Kein Partner gewählt" + Environment.NewLine; }
|
||||
else
|
||||
{
|
||||
uc.check_bp_person();
|
||||
if (uc.bpperson_error_type == 1) { dokumenterror = dokumenterror + "- Dokument muss für eine Person erstellt werden" + Environment.NewLine; }
|
||||
if (uc.bpperson_error_type == 2) { dokumenterror = dokumenterror + "- Dokument muss für einen BP erstellt werden" + Environment.NewLine; }
|
||||
}
|
||||
if (!uc.check_fields())
|
||||
{
|
||||
dokumenterror = dokumenterror + uc.check_error + Environment.NewLine;
|
||||
|
||||
}
|
||||
uc.ausDokumentpaket = false;
|
||||
if (dokumenterror != "") { errormessage = errormessage + Environment.NewLine + tab.Text + ":" + Environment.NewLine + dokumenterror; }
|
||||
}
|
||||
uc.ausDokumentpaket = false;
|
||||
if (dokumenterror!="") { errormessage = errormessage + Environment.NewLine+ tab.Text +":"+ Environment.NewLine + dokumenterror; }
|
||||
|
||||
if (ty == "UCAllgemeinDokumentParamExtern")
|
||||
{
|
||||
UCAllgemeinDokumentParamExtern uce = (UCAllgemeinDokumentParamExtern)tab.Controls[0];
|
||||
dokumenterror = "";
|
||||
|
||||
if (uce.partnernr == 0) { dokumenterror = dokumenterror + "- Kein Partner gewählt" + Environment.NewLine; }
|
||||
else
|
||||
{
|
||||
uce.check_bp_person();
|
||||
if (uce.bpperson_error_type == 1) { dokumenterror = dokumenterror + "- Dokument muss für eine Person erstellt werden" + Environment.NewLine; }
|
||||
if (uce.bpperson_error_type == 2) { dokumenterror = dokumenterror + "- Dokument muss für einen BP erstellt werden" + Environment.NewLine; }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (errormessage != "")
|
||||
{
|
||||
@@ -443,11 +506,11 @@ namespace OnDoc.DocMgmt
|
||||
return;
|
||||
|
||||
}
|
||||
if (!dokList1.grid_empty() && dokList1.get_selected_records() != 0)
|
||||
if (!dokList1.grid_empty() && dokList1.get_selected_records() != 0)
|
||||
{
|
||||
if (MessageBox.Show("Alle Dokumente neu genererieren?"+Environment.NewLine+"(Bestehende Dokumente werden gelöscht)", "Generierung", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
if (MessageBox.Show("Alle Dokumente neu genererieren?" + Environment.NewLine + "(Bestehende Dokumente werden gelöscht)", "Generierung", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
if (MessageBox.Show("Neu hinzugefügte Dokumente generieren?","Generierung",MessageBoxButtons.YesNo, MessageBoxIcon.Question)== DialogResult.No) { return; }
|
||||
if (MessageBox.Show("Neu hinzugefügte Dokumente generieren?", "Generierung", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; }
|
||||
foreach (TabPageAdv tab in TabControlDokuments.TabPages)
|
||||
{
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
@@ -455,7 +518,7 @@ namespace OnDoc.DocMgmt
|
||||
{
|
||||
Generate_Docs("", uc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -464,7 +527,7 @@ namespace OnDoc.DocMgmt
|
||||
dokList1.delete_doks_in_list();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
progressBarAdv1.Minimum = 0;
|
||||
progressBarAdv1.Maximum = TabControlDokuments.TabPages.Count;
|
||||
progressBarAdv1.Value = 0;
|
||||
@@ -477,152 +540,164 @@ namespace OnDoc.DocMgmt
|
||||
string filter = "dokumentid in ('";
|
||||
foreach (TabPageAdv tab in TabControlDokuments.TabPages)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
tab.Select();
|
||||
TabControlDokuments.SelectedTab = tab;
|
||||
progressBarAdv1.Value = progressBarAdv1.Value + 1;
|
||||
Application.DoEvents();
|
||||
//Thread.Sleep(1000);
|
||||
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
if (((idokumentid == "" || uc.genertated_dokumentid == idokumentid) && iuc == null) || uc == iuc)
|
||||
string ty = tab.Controls[0].GetType().Name;
|
||||
if (ty == "UCAllgemeineDokumentParam")
|
||||
{
|
||||
//uc.Set_Edit_later();
|
||||
uc.Update_DocGenData();
|
||||
clsDocData dokdata = new clsDocData();
|
||||
uc.update_dokdata(ref dokdata);
|
||||
uc.update_partner();
|
||||
DOCGEN.DocGen docgen = new DOCGEN.DocGen(AppParams.connectionstring);
|
||||
string dokumentid = docgen.GenDocID(dokdata, false, "");
|
||||
dokdata.Dokumentid = dokumentid;
|
||||
uc.genertated_dokumentid = dokumentid;
|
||||
uc.Show_Neugenerieren();
|
||||
filter = filter + dokumentid + "','";
|
||||
dokumentid = dokdata.Dokumentid;
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentPreview) { uc.docgendata.erstellungsart = Erstellungsart.DokumentSpäterBearbeiten; }
|
||||
if (dokumentid != "")
|
||||
|
||||
UCAllgemeineDokumentParam uc = (UCAllgemeineDokumentParam)tab.Controls[0];
|
||||
if (((idokumentid == "" || uc.genertated_dokumentid == idokumentid) && iuc == null) || uc == iuc)
|
||||
{
|
||||
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")
|
||||
//uc.Set_Edit_later();
|
||||
uc.Update_DocGenData();
|
||||
clsDocData dokdata = new clsDocData();
|
||||
uc.update_dokdata(ref dokdata);
|
||||
uc.update_partner();
|
||||
DOCGEN.DocGen docgen = new DOCGEN.DocGen(AppParams.connectionstring);
|
||||
string dokumentid = docgen.GenDocID(dokdata, false, "");
|
||||
dokdata.Dokumentid = dokumentid;
|
||||
uc.genertated_dokumentid = dokumentid;
|
||||
uc.Show_Neugenerieren();
|
||||
filter = filter + dokumentid + "','";
|
||||
dokumentid = dokdata.Dokumentid;
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentPreview) { uc.docgendata.erstellungsart = Erstellungsart.DokumentSpäterBearbeiten; }
|
||||
if (dokumentid != "")
|
||||
{
|
||||
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.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")
|
||||
{
|
||||
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 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;
|
||||
lbldokumentname.Text = tab.Text;
|
||||
Application.DoEvents();
|
||||
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata, true, AppParams.OfficeSpleep1, AppParams.vbvorlagenmanagement == "Yes");
|
||||
//panelword.Visible = false;
|
||||
Application.DoEvents();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata);
|
||||
|
||||
}
|
||||
|
||||
dB = null;
|
||||
}
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.ErstellungInOffice)
|
||||
{
|
||||
//panelword.Visible = true;
|
||||
lbldokumentname.Text = tab.Text;
|
||||
Application.DoEvents();
|
||||
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata, true, AppParams.OfficeSpleep1, AppParams.vbvorlagenmanagement == "Yes");
|
||||
//panelword.Visible = false;
|
||||
Application.DoEvents();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dok = Generator.Generate_Doc_EDOKA(dokumentid, ref dokdata);
|
||||
|
||||
}
|
||||
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.ErstellungInOffice)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
filename = AppParams.tempdir + dok.dokumentname;
|
||||
string filename_temp = filename + ".tmp";
|
||||
System.IO.File.WriteAllBytes(filename_temp, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename_temp);
|
||||
db.Dok_in_Bearbeitung(1, dokdata.Dokumentid, AppParams.CurrentMitarbeiter);
|
||||
db = null;
|
||||
System.IO.File.Delete(filename_temp);
|
||||
Logging.Logging.Debug("Before Processwatch", "DonDoc", dokumentid);
|
||||
clsProcessWatch.AddToList(dokdata.Dokumentid, filename, "Word");
|
||||
|
||||
}
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentBearbeiten)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
//filename = AppParams.tempdir + dok.dokumentname;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
db = null;
|
||||
|
||||
switch (dok.doktype)
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.ErstellungInOffice)
|
||||
{
|
||||
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)
|
||||
{
|
||||
//Generator.DocToPDF(dokumentid, ref dok);
|
||||
dok.extension = "pdf";
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
}
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
filename = AppParams.tempdir + dok.dokumentname;
|
||||
string filename_temp = filename + ".tmp";
|
||||
System.IO.File.WriteAllBytes(filename_temp, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename_temp);
|
||||
db.Dok_in_Bearbeitung(1, dokdata.Dokumentid, AppParams.CurrentMitarbeiter);
|
||||
db = null;
|
||||
System.IO.File.Delete(filename_temp);
|
||||
Logging.Logging.Debug("Before Processwatch", "DonDoc", dokumentid);
|
||||
clsProcessWatch.AddToList(dokdata.Dokumentid, filename, "Word");
|
||||
|
||||
}
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentBearbeiten)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
//filename = AppParams.tempdir + dok.dokumentname;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
db = null;
|
||||
|
||||
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)
|
||||
{
|
||||
//Generator.DocToPDF(dokumentid, ref dok);
|
||||
dok.extension = "pdf";
|
||||
string filename = AppParams.tempdir + dokumentid + "." + dok.extension;
|
||||
System.IO.File.WriteAllBytes(filename, Convert.FromBase64String(dok.dokument));
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.Save_To_DB(dokdata.Dokumentid, filename);
|
||||
}
|
||||
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentSpäterBearbeiten)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + 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;
|
||||
}
|
||||
|
||||
if (uc.docgendata.erstellungsart == Erstellungsart.DokumentSpäterBearbeiten)
|
||||
{
|
||||
string filename = AppParams.tempdir + dokumentid + "." + 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;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
filter = filter + uc.genertated_dokumentid + "','";
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ty == "UCAllgemeinDokumentParamExtern" && idokumentid=="")
|
||||
{
|
||||
filter = filter + uc.genertated_dokumentid + "','";
|
||||
|
||||
UCAllgemeinDokumentParamExtern uce = (UCAllgemeinDokumentParamExtern)tab.Controls[0];
|
||||
uce.Show_Neugenerieren();
|
||||
uce.gendoc();
|
||||
}
|
||||
counter = counter + 1;
|
||||
if (this.EinzelGenerierung)
|
||||
@@ -643,8 +718,8 @@ namespace OnDoc.DocMgmt
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
progressBarAdv1.Visible = false;
|
||||
filter = filter.Substring(0, filter.Length - 2) + ")";
|
||||
dokList1.datafilter = filter;
|
||||
@@ -655,31 +730,31 @@ namespace OnDoc.DocMgmt
|
||||
public void ribbonButtonNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!NeuesDokumentpaket()) { return; }
|
||||
btnSearchBP_Click(sender, e);
|
||||
btnSearchBP_Click(sender, e);
|
||||
Update_PaketDetails();
|
||||
dokList1.datafilter = "dokumentid in ('n.a.')";
|
||||
dokList1.refresh_dokumente();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void sfListView1_SelectionChanged(object sender, ItemSelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
var dr = e.AddedItems[0] as DataRowView;
|
||||
|
||||
var dr = e.AddedItems[0] as DataRowView;
|
||||
foreach (TabPageAdv p in TabControlDokuments.TabPages)
|
||||
{
|
||||
if (p.Text == dr[3].ToString())
|
||||
{
|
||||
TabControlDokuments.SelectedTab=p;
|
||||
TabControlDokuments.SelectedTab = p;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sfListView1.CheckedItems.Add(this.sfListView1.SelectedItem);
|
||||
|
||||
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void sfListView1_ItemChecking(object sender, ItemCheckingEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user