Update 20241214

master
Stefan Hutter 1 year ago
parent 1682465067
commit 3c5380f422

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -93,10 +93,10 @@
this.ribbonPanel3 = new System.Windows.Forms.RibbonPanel();
this.RibbonButtonExcelImport = new System.Windows.Forms.RibbonButton();
this.ribbonPanel6 = new System.Windows.Forms.RibbonPanel();
this.ribbonButton1 = new System.Windows.Forms.RibbonButton();
this.ribbonButtonVorlageBearbeiten = new System.Windows.Forms.RibbonButton();
this.ribbonPanel7 = new System.Windows.Forms.RibbonPanel();
this.ribbonbuttonaddpartner = new System.Windows.Forms.RibbonButton();
this.ribbonButton2 = new System.Windows.Forms.RibbonButton();
this.ribbonButtonPartnerPruefen = new System.Windows.Forms.RibbonButton();
this.ribbonPanel8 = new System.Windows.Forms.RibbonPanel();
this.RibbonButtonGenerateSB = new System.Windows.Forms.RibbonButton();
this.ribbonButtonDruckstapel = new System.Windows.Forms.RibbonButton();
@ -110,6 +110,7 @@
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ribbonButtonDelete = new System.Windows.Forms.RibbonButton();
this.docPreview1 = new OnDoc.UIControls.DocPreview();
this.GrpDokumentInhalt.SuspendLayout();
this.grpDruckstapel.SuspendLayout();
@ -600,7 +601,7 @@
this.partnerLöschenToolStripMenuItem,
this.erneutGenerierenToolStripMenuItem});
this.ctxmenuEmpfaenger.Name = "ctxmenuEmpfaenger";
this.ctxmenuEmpfaenger.Size = new System.Drawing.Size(211, 92);
this.ctxmenuEmpfaenger.Size = new System.Drawing.Size(211, 70);
//
// partnerHinzufügenToolStripMenuItem
//
@ -636,6 +637,7 @@
new Syncfusion.Windows.Forms.Tools.StyleNamePair("Standard", treeNodeAdvStyleInfo2)});
this.treeViewAdv1.BeforeTouchSize = new System.Drawing.Size(230, 579);
this.treeViewAdv1.Dock = System.Windows.Forms.DockStyle.Left;
this.treeViewAdv1.Enabled = false;
//
//
//
@ -781,6 +783,7 @@
this.ribbonPanel2.ButtonMoreVisible = false;
this.ribbonPanel2.Items.Add(this.RibbonButtonNew);
this.ribbonPanel2.Items.Add(this.RibbonButtonOpen);
this.ribbonPanel2.Items.Add(this.ribbonButtonDelete);
this.ribbonPanel2.Name = "ribbonPanel2";
this.ribbonPanel2.Text = "";
//
@ -857,24 +860,24 @@
//
// ribbonPanel6
//
this.ribbonPanel6.Items.Add(this.ribbonButton1);
this.ribbonPanel6.Items.Add(this.ribbonButtonVorlageBearbeiten);
this.ribbonPanel6.Name = "ribbonPanel6";
this.ribbonPanel6.Text = "";
//
// ribbonButton1
// ribbonButtonVorlageBearbeiten
//
this.ribbonButton1.Enabled = false;
this.ribbonButton1.Image = global::OnDoc.Properties.Resources.EditDoc_32x32_32;
this.ribbonButton1.LargeImage = global::OnDoc.Properties.Resources.EditDoc_32x32_32;
this.ribbonButton1.Name = "ribbonButton1";
this.ribbonButton1.SmallImage = global::OnDoc.Properties.Resources.EditDoc_24x24_32;
this.ribbonButton1.Text = "Vorlage_bearbeiten";
this.ribbonButton1.Click += new System.EventHandler(this.ribbonButton1_Click);
this.ribbonButtonVorlageBearbeiten.Enabled = false;
this.ribbonButtonVorlageBearbeiten.Image = global::OnDoc.Properties.Resources.EditDoc_32x32_32;
this.ribbonButtonVorlageBearbeiten.LargeImage = global::OnDoc.Properties.Resources.EditDoc_32x32_32;
this.ribbonButtonVorlageBearbeiten.Name = "ribbonButtonVorlageBearbeiten";
this.ribbonButtonVorlageBearbeiten.SmallImage = global::OnDoc.Properties.Resources.EditDoc_24x24_32;
this.ribbonButtonVorlageBearbeiten.Text = "Vorlage_bearbeiten";
this.ribbonButtonVorlageBearbeiten.Click += new System.EventHandler(this.ribbonButton1_Click);
//
// ribbonPanel7
//
this.ribbonPanel7.Items.Add(this.ribbonbuttonaddpartner);
this.ribbonPanel7.Items.Add(this.ribbonButton2);
this.ribbonPanel7.Items.Add(this.ribbonButtonPartnerPruefen);
this.ribbonPanel7.Name = "ribbonPanel7";
this.ribbonPanel7.Text = "";
//
@ -889,15 +892,15 @@
this.ribbonbuttonaddpartner.TextAlignment = System.Windows.Forms.RibbonItem.RibbonItemTextAlignment.Center;
this.ribbonbuttonaddpartner.Click += new System.EventHandler(this.ribbonbuttonaddpartner_Click);
//
// ribbonButton2
// ribbonButtonPartnerPruefen
//
this.ribbonButton2.Enabled = false;
this.ribbonButton2.Image = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_32x32_32;
this.ribbonButton2.LargeImage = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_32x32_32;
this.ribbonButton2.Name = "ribbonButton2";
this.ribbonButton2.SmallImage = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_24x24_32;
this.ribbonButton2.Text = "Partnerlise_prüfen";
this.ribbonButton2.Click += new System.EventHandler(this.ribbonButton2_Click);
this.ribbonButtonPartnerPruefen.Enabled = false;
this.ribbonButtonPartnerPruefen.Image = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_32x32_32;
this.ribbonButtonPartnerPruefen.LargeImage = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_32x32_32;
this.ribbonButtonPartnerPruefen.Name = "ribbonButtonPartnerPruefen";
this.ribbonButtonPartnerPruefen.SmallImage = global::OnDoc.Properties.Resources.SB_Partnerliste_Pruefen_24x24_32;
this.ribbonButtonPartnerPruefen.Text = "Partnerlise_prüfen";
this.ribbonButtonPartnerPruefen.Click += new System.EventHandler(this.ribbonButton2_Click);
//
// ribbonPanel8
//
@ -1032,6 +1035,16 @@
this.splitContainer1.SplitterDistance = 900;
this.splitContainer1.TabIndex = 5;
//
// ribbonButtonDelete
//
this.ribbonButtonDelete.Enabled = false;
this.ribbonButtonDelete.Image = global::OnDoc.Properties.Resources.DeleteDoc_32x32_32;
this.ribbonButtonDelete.LargeImage = global::OnDoc.Properties.Resources.DeleteDoc_32x32_32;
this.ribbonButtonDelete.Name = "ribbonButtonDelete";
this.ribbonButtonDelete.SmallImage = global::OnDoc.Properties.Resources.DeleteDoc_24x24_32;
this.ribbonButtonDelete.Text = "Löschen";
this.ribbonButtonDelete.Click += new System.EventHandler(this.ribbonButton3_Click);
//
// docPreview1
//
this.docPreview1.Dock = System.Windows.Forms.DockStyle.Fill;
@ -1144,13 +1157,13 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private Syncfusion.WinForms.DataGrid.SfDataGrid sfdatagridsbload;
private System.Windows.Forms.RibbonButton ribbonButton1;
private System.Windows.Forms.RibbonButton ribbonButtonVorlageBearbeiten;
private System.Windows.Forms.RibbonPanel ribbonPanel7;
private System.Windows.Forms.RibbonButton ribbonbuttonaddpartner;
private System.Windows.Forms.ContextMenuStrip ctxmenuEmpfaenger;
private System.Windows.Forms.ToolStripMenuItem partnerHinzufügenToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem partnerLöschenToolStripMenuItem;
private System.Windows.Forms.RibbonButton ribbonButton2;
private System.Windows.Forms.RibbonButton ribbonButtonPartnerPruefen;
private System.Windows.Forms.RibbonPanel ribbonPanel8;
private System.Windows.Forms.RibbonButton RibbonButtonGenerateSB;
private DocPreview docPreview1;
@ -1169,5 +1182,6 @@
private System.Windows.Forms.RibbonPanel ribbonPanel9;
private System.Windows.Forms.RibbonButton RibbonButtonArchivierenUndAbschlessen;
private System.Windows.Forms.ToolStripMenuItem erneutGenerierenToolStripMenuItem;
private System.Windows.Forms.RibbonButton ribbonButtonDelete;
}
}

@ -73,6 +73,75 @@ namespace OnDoc.UIControls
}
private void enable_disable_functions(int type, bool enabled)
{
if (type == 1)
{
sb.dsempfaenger.Tables[0].Rows.Clear();
sb.dsempfaenger.AcceptChanges();
sfDataGridEmpfaenger.DataSource = null;
update_zahlen();
treeViewAdv1.Enabled = false;
ribbonbuttonsave.Enabled = false;
ribbonButtonDelete.Enabled = false;
RibbonButtonExcelImport.Enabled = false;
ribbonbuttonaddpartner.Enabled= false;
ribbonButtonPartnerPruefen.Enabled = false;
ribbonButtonVorlageBearbeiten.Enabled = false;
ribbonbuttonaddpartner.Enabled = false;
ribbonButtonPartnerPruefen.Enabled = false;
RibbonButtonGenerateSB.Enabled = false;
ribbonButtonDruckstapel.Enabled = false;
RibbonButtonArchivierenUndAbschlessen.Enabled = false;
}
if (type == 2)
{
RibbonButtonGenerateSB.Enabled = false;
RibbonButtonArchivierenUndAbschlessen.Enabled = false;
ribbonButtonDruckstapel.Enabled = false;
}
if (type == 3)
{
groupBox5.Enabled = enabled;
groupBox6.Enabled = enabled;
groupBox7.Enabled = enabled;
groupBox8.Enabled = enabled;
ribbonButtonVorlageBearbeiten.Enabled = enabled;
}
if (type == 4)
{
sfDataGridEmpfaenger.AllowEditing = true;
ctxmenuEmpfaenger.Enabled = true;
partnerHinzufügenToolStripMenuItem.Visible = true;
partnerLöschenToolStripMenuItem.Visible = true;
erneutGenerierenToolStripMenuItem.Visible = false;
docPreview1.Visible = false;
}
if (type == 5)
{
partnerHinzufügenToolStripMenuItem.Visible = false;
partnerLöschenToolStripMenuItem.Visible = false;
sfDataGridEmpfaenger.AllowEditing = false;
erneutGenerierenToolStripMenuItem.Visible = true;
docPreview1.clear_viewer();
docPreview1.Visible = true;
}
if (type == 6)
{
GrpEmpfaenger.Visible = true;
GrpDokumentInhalt.Visible = true;
ribbonbuttonsave.Enabled = true;
ribbonButtonDelete.Enabled = true;
RibbonButtonExcelImport.Enabled = true;
ribbonbuttonaddpartner.Enabled = true;
ribbonButtonPartnerPruefen.Enabled = true;
RibbonButtonEditWord.Enabled = true;
grpDruckstapel.Visible = false;
docPreview1.Visible = false;
treeViewAdv1.Enabled = true;
}
}
private void Refresh_Lists()
{
DB db = new DB(AppParams.connectionstring);
@ -119,7 +188,6 @@ namespace OnDoc.UIControls
private void RibbonButtonExcelImport_Click(object sender, EventArgs e)
{
System.Data.DataTable importdata = new System.Data.DataTable();
openFileDialog1.Filter = "Excel-Dateien files (*.xlsx)|*.xlsx|CSV-Dateien (*.csv)|*.csv|Alle Dateien (*.*)|*.*";
openFileDialog1.FilterIndex = 0;
@ -268,8 +336,8 @@ namespace OnDoc.UIControls
sb.dsempfaenger.Tables.Add(sbe.init_used_felder(false).Copy());
sb.dsempfaenger.Tables[sb.dsempfaenger.Tables.Count - 1].TableName = "UsedFelder";
update_serienbriefdaten(false);
treeViewAdv1.Enabled = true;
}
else
{
@ -280,13 +348,44 @@ namespace OnDoc.UIControls
private void vorlage_auslesen_und_speichern()
{
DOCGEN.DocGet dg = new DOCGEN.DocGet(AppParams.connectionstring);
string filedata = dg.get_word_vorlage(sb.officevorlagenr);
clsFileHelper fh = new clsFileHelper();
string tempfilename = "";
DB dB = new DB(AppParams.connectionstring);
dB.Get_ApplicationType_from_Vorlage(sb.officevorlagenr);
string Apptype = "";
Apptype = dB.dsdaten.Tables[0].Rows[0][1].ToString();
string filename = dB.get_vorlage_to_file(sb.officevorlagenr.ToString(), AppParams.tempdir, sb.serienbriefnr.ToString() + "." + Apptype);
sb.filename = dB.save_sb_vorlage_to_db(filename, Apptype, sb.serienbriefnr);
string filename = AppParams.tempdir+sb.serienbriefnr.ToString() + "." + Apptype;
fh.SaveBase64ToFile(filedata, filename);
sb.filename = filename;
}
//DB dB = new DB(AppParams.connectionstring);
//dB.Get_ApplicationType_from_Vorlage(sb.officevorlagenr);
//string Apptype = "";
//Apptype = dB.dsdaten.Tables[0].Rows[0][1].ToString();
//sb.filename = dB.save_sb_vorlage_to_db(filename, Apptype, sb.serienbriefnr);
//DB dB = new DB(AppParams.connectionstring);
//dB.Get_ApplicationType_from_Vorlage(sb.officevorlagenr);
//string Apptype = "";
//Apptype = dB.dsdaten.Tables[0].Rows[0][1].ToString();
//string filedata = dB.get_vorlage_for_file(sb.officevorlagenr.ToString(), AppParams.tempdir, sb.serienbriefnr.ToString() + "." + Apptype);
//string filename = AppParams.tempdir + sb.serienbriefnr.ToString() + "." + Apptype;
//sb.filename= filename;
//dB.Save_To_DB("", "", filedata, sb.serienbriefnr);
//sb.filename = dB.get_sb_vorlage(sb.serienbriefnr, AppParams.tempdir);
//// sb.filename = dB.save_sb_vorlage_to_db(filename, Apptype, sb.serienbriefnr);
private void vorlagenfelder(int dokumenttypnr)
{
DB db = new DB(AppParams.connectionstring);
@ -409,63 +508,25 @@ namespace OnDoc.UIControls
treeViewAdv1.SelectedNode = treeViewAdv1.Nodes[0];
update_grid();
RibbonButtonGenerateSB.Enabled = false;
RibbonButtonArchivierenUndAbschlessen.Enabled = false;
ribbonButtonDruckstapel.Enabled = false;
enable_disable_functions(2,false);
if (inbearbeitung > 0) { RibbonButtonGenerateSB.Enabled = true; }
if (fehlerhaft == 0 && inbearbeitung == 0 && generiert > 0)
{
RibbonButtonArchivierenUndAbschlessen.Enabled = true;
ribbonButtonDruckstapel.Enabled = true;
}
enable_disable(true);
enable_disable_functions(3, true);
if (generiert > 0 || abgeschlossen > 0)
{
enable_disable(false);
enable_disable_functions(3, false);
}
}
catch { }
}
private void enable_disable(bool enabled)
{
groupBox5.Enabled = enabled;
groupBox6.Enabled = enabled;
groupBox7.Enabled = enabled;
groupBox8.Enabled = enabled;
ribbonButton1.Enabled = enabled;
}
private void Set_Functions(int type)
{
if (type == 1 || type == 2)
{
sfDataGridEmpfaenger.AllowEditing = true;
ctxmenuEmpfaenger.Enabled = true;
partnerHinzufügenToolStripMenuItem.Visible = true;
partnerLöschenToolStripMenuItem.Visible = true;
erneutGenerierenToolStripMenuItem.Visible = false;
docPreview1.Visible = false;
}
if (type == 3 || type == 4)
{
partnerHinzufügenToolStripMenuItem.Visible = false;
partnerLöschenToolStripMenuItem.Visible = false;
sfDataGridEmpfaenger.AllowEditing = false;
erneutGenerierenToolStripMenuItem.Visible = true;
docPreview1.clear_viewer();
docPreview1.Visible = true;
//ctxmenuEmpfaenger.Enabled = false;
}
}
private void treeViewAdv1_AfterSelect(object sender, EventArgs e)
{
update_grid();
@ -482,27 +543,30 @@ namespace OnDoc.UIControls
sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten();
Set_Functions(1);
enable_disable_functions(4, false);
break;
case "Fehle":
dv.RowFilter = "Status=-1";
sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten();
Set_Functions(2);
enable_disable_functions(4, false);
break;
case "Gener":
dv.RowFilter = "Status = 1";
sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten(); Set_Functions(3);
refresh_spalten(); enable_disable_functions(5, false);
break;
case "Abges":
dv.RowFilter = "Status = 2";
sfDataGridEmpfaenger.DataSource = null;
sfDataGridEmpfaenger.DataSource = dv;
refresh_spalten();
Set_Functions(4);
enable_disable_functions(5, false);
break;
}
}
@ -531,13 +595,11 @@ namespace OnDoc.UIControls
System.Windows.Forms.Application.DoEvents();
ribbonbuttonsave.Enabled = true;
RibbonButtonExcelImport.Enabled = true;
RibbonButtonEditWord.Enabled = true;
grpDruckstapel.Visible = false;
docPreview1.Visible = false;
}
private void bntsbloadok_Click(object sender, EventArgs e)
{
DB db = new DB(AppParams.connectionstring);
@ -549,9 +611,7 @@ namespace OnDoc.UIControls
pnlLoad.Visible = false;
update_screen();
refresh_empfaenger(sb.dsempfaenger.Tables[0]);
GrpEmpfaenger.Visible = true;
GrpDokumentInhalt.Visible = true;
enable_disable_functions(6, false);
db = null;
}
private void update_screen()
@ -587,9 +647,13 @@ namespace OnDoc.UIControls
private void sfdatagridsbload_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
selectedsbnr = Convert.ToInt32(dataRow["serienbriefnr"].ToString());
try
{
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
selectedsbnr = Convert.ToInt32(dataRow["serienbriefnr"].ToString());
}
catch { }
}
@ -599,6 +663,9 @@ namespace OnDoc.UIControls
SerienbriefBearbeitung sbedit = new SerienbriefBearbeitung(this.sb);
sbedit.Show();
this.sb = sbedit.sb;
update_serienbriefdaten(false);
}
private void ribbonbuttonaddpartner_Click(object sender, EventArgs e)
@ -978,7 +1045,7 @@ namespace OnDoc.UIControls
}
catch { }
}
string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb));
Helper.FileHelper fh = new FileHelper();
DB db = new DB(AppParams.connectionstring);
System.Data.DataRow dr = sb.dsempfaenger.Tables[0].Select("intEintragnr = '" + vorlagendaten.Rows[i]["IntEintragnr"].ToString() + "'").FirstOrDefault();
@ -989,7 +1056,10 @@ namespace OnDoc.UIControls
}
if (dokumentid == "") { dokumentid = db.get_dbkey("Dokument"); }
string filename = dokumentid + ".pdf";
//string filename = "SB_" + sb.serienbriefnr.ToString() + vorlagendaten.Rows[i]["intEintragnr"].ToString() + ".pdf";
string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb, dokumentid));
//string filename = "SB_" + sb.serienbriefnr.ToString() + vorlagendaten.Rows[i]["intEintragnr"].ToString() + ".pdf";
fh.SaveBase64ToFile(pdfdoc, AppParams.tempdir + filename);
db.save_serienbrief_datei(sb.serienbriefnr, Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]), AppParams.tempdir + filename, dokumentid);
@ -1111,7 +1181,11 @@ namespace OnDoc.UIControls
}
if (i > 0)
colname = colname + "_" + i.ToString();
dt.Columns.Add(colname);
try
{
dt.Columns.Add(colname);
}
catch { }
return colname;
}
@ -1187,6 +1261,7 @@ namespace OnDoc.UIControls
}
catch { }
string s;
System.Data.DataTable dtx = sb.dsempfaenger.Tables["UsedFelder"].Copy();
var loopTo3 = sb.dsempfaenger.Tables["UsedFelder"].Rows.Count - 1;
for (i = 0; i <= loopTo3; i++)
{
@ -1231,7 +1306,8 @@ namespace OnDoc.UIControls
var dataRow = (e.DataRow.RowData as DataRowView).Row;
string inteintragnr = "0";
inteintragnr = dataRow["inteintragnr"].ToString();
docPreview1.Show_Serienbrief_Dokument(sb.serienbriefnr, Convert.ToInt32(inteintragnr));
string dokumentid = dataRow["dokumentid"].ToString();
docPreview1.Show_Serienbrief_Dokument(sb.serienbriefnr, Convert.ToInt32(inteintragnr), dokumentid);
}
catch { }
}
@ -1384,6 +1460,7 @@ namespace OnDoc.UIControls
db.add_parameter("@serienbriefnr", sb.serienbriefnr.ToString());
db.add_parameter("@intEintragnr", dr["intEintragnr"].ToString());
db.add_parameter("@partnernr", dr["Partnernr"].ToString());
db.add_parameter("@dokumentid", dr["dokumentid"].ToString());
db.Get_Tabledata("sp_get_onbase_parameters_sb", true, false);
if (db.dsdaten.Tables[0].Rows[0]["BpNummer"].ToString() == "")
{
@ -1419,6 +1496,7 @@ namespace OnDoc.UIControls
URL = URL + "?sbnr=" + sb.serienbriefnr.ToString();
URL = URL + "&intid=" + dr["inteintragnr"].ToString();
URL = URL + "&partnernr=" + dr["partnernr"].ToString();
URL = URL + "&dokumentid=" + dr["dokumentid"].ToString();
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(URL);
@ -1496,5 +1574,19 @@ namespace OnDoc.UIControls
refresh_empfaenger(sb.dsempfaenger.Tables[0]);
}
private void ribbonButton3_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Serienbrief löschen?", "Serienbrief löschen", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
DB dB = new DB(AppParams.connectionstring);
dB.Exec_SQL("Update edex_sb_serienbrief set aktiv=0, mutiert_am=getdate(),mutierer=" + AppParams.CurrentMitarbieter.ToString() + " where serienbriefnr=" + sb.serienbriefnr.ToString());
dB = null;
enable_disable_functions(1,false);
}
}
}
}

@ -32,30 +32,34 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SerienbriefBearbeitung));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.sfdatagridUsed = new Syncfusion.WinForms.DataGrid.SfDataGrid();
this.contextMenuUsed = new System.Windows.Forms.ContextMenuStrip(this.components);
this.cursorImDokumentPositionierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.platzhalterLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sfdatagridDokspezifisch = new Syncfusion.WinForms.DataGrid.SfDataGrid();
this.contextMenuIDV = new System.Windows.Forms.ContextMenuStrip(this.components);
this.platzhalterImDokumentEinfügenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.sfdatagridstandard = new Syncfusion.WinForms.DataGrid.SfDataGrid();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.contextMenuStandard = new System.Windows.Forms.ContextMenuStrip(this.components);
this.platzhalterImDokumentEinfügenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuIDV = new System.Windows.Forms.ContextMenuStrip(this.components);
this.platzhalterImDokumentEinfügenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuUsed = new System.Windows.Forms.ContextMenuStrip(this.components);
this.cursorImDokumentPositionierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.platzhalterLöschenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridUsed)).BeginInit();
this.contextMenuUsed.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridDokspezifisch)).BeginInit();
this.contextMenuIDV.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridstandard)).BeginInit();
this.contextMenuStandard.SuspendLayout();
this.contextMenuIDV.SuspendLayout();
this.contextMenuUsed.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.toolStrip1.Location = new System.Drawing.Point(2, 2);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(382, 25);
@ -76,6 +80,33 @@
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(7, 244);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Verwendete Werte";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(7, 119);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(190, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Verfügbare dokument-spzifische Werte";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(137, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Verfügbare Standard-Werte";
//
// sfdatagridUsed
//
this.sfdatagridUsed.AccessibleName = "Table";
@ -86,6 +117,27 @@
this.sfdatagridUsed.TabIndex = 2;
this.sfdatagridUsed.Text = "sfDataGrid1";
//
// contextMenuUsed
//
this.contextMenuUsed.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cursorImDokumentPositionierenToolStripMenuItem,
this.platzhalterLöschenToolStripMenuItem});
this.contextMenuUsed.Name = "contextMenuUsed";
this.contextMenuUsed.Size = new System.Drawing.Size(258, 48);
//
// cursorImDokumentPositionierenToolStripMenuItem
//
this.cursorImDokumentPositionierenToolStripMenuItem.Name = "cursorImDokumentPositionierenToolStripMenuItem";
this.cursorImDokumentPositionierenToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
this.cursorImDokumentPositionierenToolStripMenuItem.Text = "Cursor im Dokument positionieren";
this.cursorImDokumentPositionierenToolStripMenuItem.Click += new System.EventHandler(this.cursorImDokumentPositionierenToolStripMenuItem_Click);
//
// platzhalterLöschenToolStripMenuItem
//
this.platzhalterLöschenToolStripMenuItem.Name = "platzhalterLöschenToolStripMenuItem";
this.platzhalterLöschenToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
this.platzhalterLöschenToolStripMenuItem.Text = "Platzhalter löschen";
//
// sfdatagridDokspezifisch
//
this.sfdatagridDokspezifisch.AccessibleName = "Table";
@ -95,6 +147,21 @@
this.sfdatagridDokspezifisch.Size = new System.Drawing.Size(367, 101);
this.sfdatagridDokspezifisch.TabIndex = 1;
this.sfdatagridDokspezifisch.Text = "sfDataGrid1";
this.sfdatagridDokspezifisch.CellClick += new Syncfusion.WinForms.DataGrid.Events.CellClickEventHandler(this.sfdatagridDokspezifisch_CellClick);
//
// contextMenuIDV
//
this.contextMenuIDV.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.platzhalterImDokumentEinfügenToolStripMenuItem1});
this.contextMenuIDV.Name = "contextMenuIDV";
this.contextMenuIDV.Size = new System.Drawing.Size(256, 26);
//
// platzhalterImDokumentEinfügenToolStripMenuItem1
//
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Name = "platzhalterImDokumentEinfügenToolStripMenuItem1";
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Size = new System.Drawing.Size(255, 22);
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Text = "Platzhalter im Dokument einfügen";
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Click += new System.EventHandler(this.platzhalterImDokumentEinfügenToolStripMenuItem1_Click);
//
// sfdatagridstandard
//
@ -105,40 +172,14 @@
this.sfdatagridstandard.Size = new System.Drawing.Size(367, 84);
this.sfdatagridstandard.TabIndex = 0;
this.sfdatagridstandard.Text = "sfDataGrid1";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(137, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Verfügbare Standard-Werte";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(7, 119);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(190, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Verfügbare dokument-spzifische Werte";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(7, 244);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Verwendete Werte";
this.sfdatagridstandard.CellClick += new Syncfusion.WinForms.DataGrid.Events.CellClickEventHandler(this.sfdatagridstandard_CellClick);
//
// contextMenuStandard
//
this.contextMenuStandard.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.platzhalterImDokumentEinfügenToolStripMenuItem});
this.contextMenuStandard.Name = "contextMenuStandard";
this.contextMenuStandard.Size = new System.Drawing.Size(256, 48);
this.contextMenuStandard.Size = new System.Drawing.Size(256, 26);
//
// platzhalterImDokumentEinfügenToolStripMenuItem
//
@ -147,40 +188,15 @@
this.platzhalterImDokumentEinfügenToolStripMenuItem.Text = "Platzhalter im Dokument einfügen";
this.platzhalterImDokumentEinfügenToolStripMenuItem.Click += new System.EventHandler(this.platzhalterImDokumentEinfügenToolStripMenuItem_Click);
//
// contextMenuIDV
// toolStripButton1
//
this.contextMenuIDV.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.platzhalterImDokumentEinfügenToolStripMenuItem1});
this.contextMenuIDV.Name = "contextMenuIDV";
this.contextMenuIDV.Size = new System.Drawing.Size(256, 26);
//
// platzhalterImDokumentEinfügenToolStripMenuItem1
//
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Name = "platzhalterImDokumentEinfügenToolStripMenuItem1";
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Size = new System.Drawing.Size(255, 22);
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Text = "Platzhalter im Dokument einfügen";
this.platzhalterImDokumentEinfügenToolStripMenuItem1.Click += new System.EventHandler(this.platzhalterImDokumentEinfügenToolStripMenuItem1_Click);
//
// contextMenuUsed
//
this.contextMenuUsed.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cursorImDokumentPositionierenToolStripMenuItem,
this.platzhalterLöschenToolStripMenuItem});
this.contextMenuUsed.Name = "contextMenuUsed";
this.contextMenuUsed.Size = new System.Drawing.Size(258, 48);
//
// cursorImDokumentPositionierenToolStripMenuItem
//
this.cursorImDokumentPositionierenToolStripMenuItem.Name = "cursorImDokumentPositionierenToolStripMenuItem";
this.cursorImDokumentPositionierenToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
this.cursorImDokumentPositionierenToolStripMenuItem.Text = "Cursor im Dokument positionieren";
this.cursorImDokumentPositionierenToolStripMenuItem.Click += new System.EventHandler(this.cursorImDokumentPositionierenToolStripMenuItem_Click);
//
// platzhalterLöschenToolStripMenuItem
//
this.platzhalterLöschenToolStripMenuItem.Name = "platzhalterLöschenToolStripMenuItem";
this.platzhalterLöschenToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
this.platzhalterLöschenToolStripMenuItem.Text = "Platzhalter löschen";
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "toolStripButton1";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// SerienbriefBearbeitung
//
@ -195,14 +211,16 @@
this.Style.MdiChild.IconVerticalAlignment = System.Windows.Forms.VisualStyles.VerticalAlignment.Center;
this.Text = "SerienbriefBearbeitung";
this.Load += new System.EventHandler(this.SerienbriefBearbeitung_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridUsed)).EndInit();
this.contextMenuUsed.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.sfdatagridDokspezifisch)).EndInit();
this.contextMenuIDV.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.sfdatagridstandard)).EndInit();
this.contextMenuStandard.ResumeLayout(false);
this.contextMenuIDV.ResumeLayout(false);
this.contextMenuUsed.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -225,5 +243,6 @@
private System.Windows.Forms.ContextMenuStrip contextMenuUsed;
private System.Windows.Forms.ToolStripMenuItem cursorImDokumentPositionierenToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem platzhalterLöschenToolStripMenuItem;
private System.Windows.Forms.ToolStripButton toolStripButton1;
}
}

@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Model;
using OnDoc.Helper;
using OnDoc.Klassen;
using OnDoc.UIControls;
using Syncfusion.Windows.Forms.Tools;
@ -28,7 +29,7 @@ namespace OnDoc.DocMgmt
DataTable IDVFelder = new DataTable();
DataTable UsedFelder = new DataTable();
int dokumenttypnr = 0;
serienbrief sb = new serienbrief();
public serienbrief sb = new serienbrief();
private Microsoft.Office.Interop.Word.Application word;
private Microsoft.Office.Interop.Word.Document doc;
@ -257,13 +258,15 @@ namespace OnDoc.DocMgmt
}
}
public void insert_tm(ref SfDataGrid grid)
public void insert_tm(ref System.Data.DataRow data)
{
if (!Row_Selected(ref grid)) { return; }
var records = grid.View.GetSelectedRecords();
foreach (var record in records)
{
var data = record as DataRowView;
//if (!Row_Selected(ref grid)) { return; }
//var records = grid.View.GetSelectedRecords();
//foreach (var record in records)
//{
// var data = record as DataRowView;
if (data["Feldname"].ToString() != "")
{
@ -272,11 +275,11 @@ namespace OnDoc.DocMgmt
word.Selection.FormFields[1].Name = data["Feldname"].ToString();
}
if (data["beginntextmarke"].ToString() != "")
if (data["Beginntextmarke"].ToString() != "")
{
word.Selection.Bookmarks.Add(data["beginntextmarke"].ToString());
}
}
}
public void cursorImDokumentPositionierenToolStripMenuItem_Click(object sender, EventArgs e)
{
@ -285,12 +288,101 @@ namespace OnDoc.DocMgmt
private void platzhalterImDokumentEinfügenToolStripMenuItem1_Click(object sender, EventArgs e)
{
insert_tm(ref sfdatagridDokspezifisch);
int i;
string s;
int sbtmindex = 0;
var loopTo = this.UsedFelder.Rows.Count - 1;
for (i = 0; i <= loopTo; i++)
{
try
{
if (Strings.Left(this.UsedFelder.Rows[i]["beginntextmarke"].ToString(), 4) == "TMSB")
{
sbtmindex = sbtmindex + 1;
}
}
catch
{
}
}
s = "TMSB_" + sbtmindex.ToString();
System.Data.DataRow row;
row = this.UsedFelder.NewRow();
row[0] = 0;
row[1] = regelbez;
row[2] = "";
row[3] = s;
row[4] = "";
this.UsedFelder.Rows.Add(row);
// insert_tm(ref sfdatagridDokspezifisch);
insert_tm(ref row);
}
private void platzhalterImDokumentEinfügenToolStripMenuItem_Click(object sender, EventArgs e)
{
insert_tm(ref sfdatagridstandard);
int i;
string s;
int sbtmindex = 0;
var loopTo = this.UsedFelder.Rows.Count - 1;
for (i = 0; i <= loopTo; i++)
{
try
{
if (Strings.Left(this.UsedFelder.Rows[i]["beginntextmarke"].ToString(), 4) == "TMSB")
{
sbtmindex = sbtmindex + 1;
}
}
catch
{
}
}
s = "TMSB_" + sbtmindex.ToString();
System.Data.DataRow row;
row = this.UsedFelder.NewRow();
row[0] = regelnr.ToString();
row[1] = regelbez;
row[2] = "";
row[3] = s;
row[4] = "";
this.UsedFelder.Rows.Add(row);
//insert_tm(ref sfdatagridstandard);
insert_tm(ref row);
}
int regelnr = 0;
string regelbez = "";
private void sfdatagridstandard_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
regelnr = Convert.ToInt32(dataRow[0].ToString());
regelbez = dataRow[1].ToString();
}
private void sfdatagridDokspezifisch_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
regelnr = 0;
regelbez = dataRow[0].ToString();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
UsedFelder.AcceptChanges();
sb.dsempfaenger.Tables["UsedFelder"].Rows.Clear();
for (int i = 0; i < UsedFelder.Rows.Count; i++)
{
sb.dsempfaenger.Tables["UsedFelder"].ImportRow(UsedFelder.Rows[i]);
}
sb.dsempfaenger.Tables["UsedFelder"].AcceptChanges();
this.Close();
}
}
}

@ -120,6 +120,22 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="contextMenuUsed.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>437, 17</value>
</metadata>
@ -129,7 +145,6 @@
<metadata name="contextMenuStandard.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAUAAAAAAAEAIAAXZwAAVgAAADAwAAABACAAqCUAAG1nAAAgIAAAAQAgAKgQAAAVjQAAGBgAAAEA

@ -71,10 +71,10 @@ namespace OnDoc.UIControls
{
pdfViewerControl1.Visible= false;
}
public void Show_Serienbrief_Dokument(int Serienbriefnr, int Eintragnr)
public void Show_Serienbrief_Dokument(int Serienbriefnr, int Eintragnr, string dokumentid)
{
DB db = new DB(AppParams.connectionstring);
db.Get_Tabledata("Select dbo.BinaryToBase64(dokument) from edex_sb_serienbrief_dokument where serienbriefnr=" + Serienbriefnr.ToString() + " and inteintragnr=" + Eintragnr.ToString(), false, true);
db.Get_Tabledata("Select dbo.BinaryToBase64(dokument) from edex_sb_serienbrief_dokument where serienbriefnr=" + Serienbriefnr.ToString() + " and dokumentid='" + dokumentid+"'", false, true);
try
{

@ -645,7 +645,6 @@ namespace OnDoc.UICintrols
createnewdoc(0, 0);
}
public void hide_panels()
{
this.RibbonButtonFavoriten.Visible = false;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -68,7 +68,6 @@ namespace DOCGEN.Klassen
}
public string Generate_Word(string base64, clsDocData docdata)
{
string formattype = "";
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
WordDocument document = new WordDocument(ms, FormatType.Automatic);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -70,13 +70,13 @@ namespace DOCGEN
return "";
}
public string generate_serienbrief(string vorlage,serienbrief sb)
public string generate_serienbrief(string vorlage,serienbrief sb, string dokumentid)
{
SyncFWord sfword = new SyncFWord();
clsdok dok = new clsdok("", "", "");
clsDocData dd = new clsDocData();
dd.DocMacros = new List<clsDocMacro>();
dd.Dokumentid = "";
dd.Dokumentid = dokumentid;
dd.DokumentDatum = sb.dokumentdatum.ToString();
dd.Unterschrift_Links=sb.unterschriftlinks.ToString();
dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString();

@ -24,6 +24,7 @@ using DOCGEN.Klassen;
using System.Data;
using Helper;
using Syncfusion.XlsIO.Parser.Biff_Records;
using System.Buffers.Text;
namespace DOCGEN
@ -77,6 +78,33 @@ namespace DOCGEN
return "";
}
public string get_word_vorlage(int vorlagenr)
{
DB db = new DB(connectionstring);
string sql = "Select dbo.BinaryToBase64(vorlage) as Data from office_vorlage_datei where office_vorlage_dateinr=" + vorlagenr;
db.Get_Tabledata(sql, false, true);
string base64 = db.dsdaten.Tables[0].Rows[0][0].ToString();
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
WordDocument document = new WordDocument(ms, FormatType.Automatic);
var formattype_original = document.ActualFormatType;
MemoryStream destms = new MemoryStream();
if (formattype_original.ToString().ToUpper() == "DOTMXXX")
{
document.Save(destms, FormatType.Docm);
}
else
{
document.Save(destms, formattype_original);
}
document.Close();
document.Dispose();
byte[] imageArray = destms.ToArray();
ms.Close();
ms.Dispose();
return Convert.ToBase64String(imageArray);
}
public string Get_FileType(string b64)
{
var streamword = new MemoryStream(Convert.FromBase64String(b64));

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -283,24 +283,28 @@ namespace Database
Get_Tabledata(sql, false, true);
return dsdaten.Tables[0].Rows[0][0].ToString();
}
public string get_vorlage_to_file(string nr, string tempdir, string dokumentid)
public string get_vorlage_for_file(string nr, string tempdir, string dokumentid)
{
string filename = "";
SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand sc = new SqlCommand("Select vorlage from office_vorlage_datei where dbo.office_vorlage_datei.office_vorlage_dateinr=" + nr, conn);
conn.Open();
SqlDataReader sqldr = sc.ExecuteReader();
while (sqldr.Read())
{
filename = tempdir + @"\" + dokumentid;
byte[] attachment = (byte[])sqldr.GetValue(0);
FileStream fs = new FileStream(filename, FileMode.Create);
fs.Write(attachment, 0, attachment.Length);
fs.Close();
}
conn.Close();
return filename;
string sql = "Select dbo.BinaryToBase64(vorlage) from office_vorlage_datei where dbo.office_vorlage_datei.office_vorlage_dateinr=" + nr;
Get_Tabledata(sql, false, true);
return dsdaten.Tables[0].Rows[0][0].ToString();
//string filename = "";
//SqlConnection conn = new SqlConnection(connectionstring);
//SqlCommand sc = new SqlCommand("Select dbo.BinaryToBase64(vorlage) from office_vorlage_datei where dbo.office_vorlage_datei.office_vorlage_dateinr=" + nr, conn);
//conn.Open();
//SqlDataReader sqldr = sc.ExecuteReader();
//while (sqldr.Read())
//{
// filename = tempdir + @"\" + dokumentid;
// byte[] attachment = (byte[])sqldr.GetValue(0);
// FileStream fs = new FileStream(filename, FileMode.Create);
// fs.Write(attachment, 0, attachment.Length);
// fs.Close();
//}
//conn.Close();
//return filename;
}
public DataTable Get_ApplicationType_from_Vorlage(int vorlagenr)
@ -789,14 +793,20 @@ namespace Database
}
public bool Save_To_DB(string sDokumentID, string sDokumentName, string base64document = "")
public bool Save_To_DB(string sDokumentID, string sDokumentName, string base64document = "", int serienbriefnr = 0)
{
try
{
string DokumentID = sDokumentID;
string Dokumentname = sDokumentName;
SqlConnection Connection = new SqlConnection();
SqlDataAdapter DA = new SqlDataAdapter("select * from doks where dokumentid='" + DokumentID + "'", Connection);
string sql = "";
if (serienbriefnr == 0) { sql = "select * from doks where dokumentid='" + DokumentID + "'"; }
if (serienbriefnr !=0) {
sql = "select top 1 * from edex_sb_vorlage where serienbriefnr=" + serienbriefnr.ToString();
DokumentID = serienbriefnr.ToString();
}
SqlDataAdapter DA = new SqlDataAdapter(sql, Connection);
SqlCommandBuilder cb = new SqlCommandBuilder(DA);
DataSet ds = new DataSet();
byte[] mydata = null;
@ -814,7 +824,6 @@ namespace Database
}
try
{
Connection.ConnectionString = connectionstring;
Connection.Open();
DA.Fill(ds, "docs");
@ -890,7 +899,6 @@ namespace Database
{
try
{
SqlConnection Connection = new SqlConnection();
SqlDataAdapter DA = new SqlDataAdapter("select top 1 * from office_vorlage_datei where office_vorlage_dateinr='" + office_vorlage_nr + "'", Connection);
SqlCommandBuilder cb = new SqlCommandBuilder(DA);
@ -1227,7 +1235,7 @@ namespace Database
sb.gedruckt = Convert.ToInt32(dbsb.iGedruckt.Value);
sb.bestaetigt = Convert.ToInt32(dbsb.iBestaetigt.Value);
sb.ausgeloest = Convert.ToInt32(dbsb.iAusgeloest.Value);
try { sb.bldossier = Convert.ToInt32(dbsb.iBldossier.Value); } catch { };
try { sb.vertrag = Convert.ToInt32(dbsb.iBldossier.Value); } catch { };
string fn = read_empfaengerdata(sb.serienbriefnr, temppath);
if (fn != "")
{
@ -1277,7 +1285,7 @@ namespace Database
dbsb.iGedruckt = sb.gedruckt;
dbsb.iBestaetigt = sb.bestaetigt;
dbsb.iAusgeloest = sb.ausgeloest;
dbsb.iBldossier = sb.bldossier;
dbsb.iBldossier = sb.vertrag;
edoka_conn.OpenConnection();
if (sb.serienbriefnr == 0)
{
@ -1498,6 +1506,25 @@ namespace Database
return filename;
}
public string get_vorlage_to_file(string nr, string tempdir, string dokumentid)
{
string filename = "";
SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand sc = new SqlCommand("Select vorlage from office_vorlage_datei where dbo.office_vorlage_datei.office_vorlage_dateinr=" + nr, conn);
conn.Open();
SqlDataReader sqldr = sc.ExecuteReader();
while (sqldr.Read())
{
filename = tempdir + @"\" + dokumentid;
byte[] attachment = (byte[])sqldr.GetValue(0);
FileStream fs = new FileStream(filename, FileMode.Create);
fs.Write(attachment, 0, attachment.Length);
fs.Close();
}
conn.Close();
return filename;
}
public void create_sb_check_table(int mitarbeiternr)
{
clear_parameter();
@ -1594,7 +1621,7 @@ namespace Database
s = "Create Table DBO.EDKB09_" + sb.serienbriefnr.ToString() + "( NRPAR00 varchar(11),";
var loopTo = dt.Columns.Count - 1;
for (i = 0; i <= loopTo; i++)
s = s + dt.Columns[i].ColumnName + " varchar(255),";
s = s + "["+dt.Columns[i].ColumnName + "] varchar(255),";
s = s.Substring(0, s.Length - 1);
s = s + "";
s = s + " " + ",CONSTRAINT [PK_EDKB09_" + sb.serienbriefnr.ToString() + "] PRIMARY KEY CLUSTERED ([IntEintragnr] ASC)) ON[DEFAULT]";

Binary file not shown.

Binary file not shown.

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

Loading…
Cancel
Save