diff --git a/API_NetFramework/API_NetFramework.csproj.user b/API_NetFramework/API_NetFramework.csproj.user index aab579a4..49c01a40 100644 --- a/API_NetFramework/API_NetFramework.csproj.user +++ b/API_NetFramework/API_NetFramework.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU ApiControllerEmptyScaffolder root/Common 600 diff --git a/API_NetFramework/bin/DOCGEN.dll b/API_NetFramework/bin/DOCGEN.dll index 2bf69b2b..ea541a45 100644 Binary files a/API_NetFramework/bin/DOCGEN.dll and b/API_NetFramework/bin/DOCGEN.dll differ diff --git a/API_NetFramework/bin/DOCGEN.pdb b/API_NetFramework/bin/DOCGEN.pdb index 9029404b..334dc463 100644 Binary files a/API_NetFramework/bin/DOCGEN.pdb and b/API_NetFramework/bin/DOCGEN.pdb differ diff --git a/API_NetFramework/bin/Database.dll b/API_NetFramework/bin/Database.dll index 5c8d7e17..617df48a 100644 Binary files a/API_NetFramework/bin/Database.dll and b/API_NetFramework/bin/Database.dll differ diff --git a/API_NetFramework/bin/Database.pdb b/API_NetFramework/bin/Database.pdb index e7bac381..e8918837 100644 Binary files a/API_NetFramework/bin/Database.pdb and b/API_NetFramework/bin/Database.pdb differ diff --git a/API_NetFramework/bin/Helper.dll b/API_NetFramework/bin/Helper.dll index a5c09067..26b96769 100644 Binary files a/API_NetFramework/bin/Helper.dll and b/API_NetFramework/bin/Helper.dll differ diff --git a/API_NetFramework/bin/Helper.pdb b/API_NetFramework/bin/Helper.pdb index 8e6e3523..c67ed204 100644 Binary files a/API_NetFramework/bin/Helper.pdb and b/API_NetFramework/bin/Helper.pdb differ diff --git a/API_NetFramework/bin/Logging.dll b/API_NetFramework/bin/Logging.dll index bb31fe4e..52e70b41 100644 Binary files a/API_NetFramework/bin/Logging.dll and b/API_NetFramework/bin/Logging.dll differ diff --git a/API_NetFramework/bin/Logging.pdb b/API_NetFramework/bin/Logging.pdb index 2e8b02d0..e837a9d7 100644 Binary files a/API_NetFramework/bin/Logging.pdb and b/API_NetFramework/bin/Logging.pdb differ diff --git a/API_NetFramework/bin/Model.dll b/API_NetFramework/bin/Model.dll index 8d1bb622..82ff892d 100644 Binary files a/API_NetFramework/bin/Model.dll and b/API_NetFramework/bin/Model.dll differ diff --git a/API_NetFramework/bin/Model.pdb b/API_NetFramework/bin/Model.pdb index 92cd7919..4d2db873 100644 Binary files a/API_NetFramework/bin/Model.pdb and b/API_NetFramework/bin/Model.pdb differ diff --git a/API_NetFramework/bin/OnDoc_NetFramework.dll b/API_NetFramework/bin/OnDoc_NetFramework.dll index a431ae66..834a2175 100644 Binary files a/API_NetFramework/bin/OnDoc_NetFramework.dll and b/API_NetFramework/bin/OnDoc_NetFramework.dll differ diff --git a/API_NetFramework/bin/OnDoc_NetFramework.pdb b/API_NetFramework/bin/OnDoc_NetFramework.pdb index d67f7deb..666b9f07 100644 Binary files a/API_NetFramework/bin/OnDoc_NetFramework.pdb and b/API_NetFramework/bin/OnDoc_NetFramework.pdb differ diff --git a/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache b/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache index f3728a4a..0be1ba87 100644 Binary files a/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache and b/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache differ diff --git a/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll b/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll index d2f4e560..834a2175 100644 Binary files a/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll and b/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll differ diff --git a/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb b/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb index 3d86d0a2..666b9f07 100644 Binary files a/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb and b/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb differ diff --git a/API_NetFramework/obj/Debug/build.force b/API_NetFramework/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/BarcodeLib/bin/Debug/Database.dll b/BarcodeLib/bin/Debug/Database.dll index cf86c724..617df48a 100644 Binary files a/BarcodeLib/bin/Debug/Database.dll and b/BarcodeLib/bin/Debug/Database.dll differ diff --git a/BarcodeLib/bin/Debug/Database.pdb b/BarcodeLib/bin/Debug/Database.pdb index 51f3dde3..e8918837 100644 Binary files a/BarcodeLib/bin/Debug/Database.pdb and b/BarcodeLib/bin/Debug/Database.pdb differ diff --git a/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache b/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache index 96f98ea4..c8bf704d 100644 Binary files a/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache and b/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache differ diff --git a/Client/DocMgmt/Serienbrief.Designer.cs b/Client/DocMgmt/Serienbrief.Designer.cs index 8c109bee..f8c4697c 100644 --- a/Client/DocMgmt/Serienbrief.Designer.cs +++ b/Client/DocMgmt/Serienbrief.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/Client/DocMgmt/Serienbrief.cs b/Client/DocMgmt/Serienbrief.cs index f778fc28..cc51190e 100644 --- a/Client/DocMgmt/Serienbrief.cs +++ b/Client/DocMgmt/Serienbrief.cs @@ -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); + + } + + + } } } diff --git a/Client/DocMgmt/SerienbriefBearbeitung.Designer.cs b/Client/DocMgmt/SerienbriefBearbeitung.Designer.cs index ae51124a..1b38ee0e 100644 --- a/Client/DocMgmt/SerienbriefBearbeitung.Designer.cs +++ b/Client/DocMgmt/SerienbriefBearbeitung.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/Client/DocMgmt/SerienbriefBearbeitung.cs b/Client/DocMgmt/SerienbriefBearbeitung.cs index a90aa29d..dc71343e 100644 --- a/Client/DocMgmt/SerienbriefBearbeitung.cs +++ b/Client/DocMgmt/SerienbriefBearbeitung.cs @@ -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(); } } } diff --git a/Client/DocMgmt/SerienbriefBearbeitung.resx b/Client/DocMgmt/SerienbriefBearbeitung.resx index fae60f75..b97f2be0 100644 --- a/Client/DocMgmt/SerienbriefBearbeitung.resx +++ b/Client/DocMgmt/SerienbriefBearbeitung.resx @@ -120,6 +120,22 @@ 17, 17 + + + + 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== + + 437, 17 @@ -129,7 +145,6 @@ 122, 17 - AAABAAUAAAAAAAEAIAAXZwAAVgAAADAwAAABACAAqCUAAG1nAAAgIAAAAQAgAKgQAAAVjQAAGBgAAAEA diff --git a/Client/UIControls/DocPreview.cs b/Client/UIControls/DocPreview.cs index 0a8c322a..fa59b4e0 100644 --- a/Client/UIControls/DocPreview.cs +++ b/Client/UIControls/DocPreview.cs @@ -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 { diff --git a/Client/UIControls/DokList.cs b/Client/UIControls/DokList.cs index 185648b4..2d0dd826 100644 --- a/Client/UIControls/DokList.cs +++ b/Client/UIControls/DokList.cs @@ -645,7 +645,6 @@ namespace OnDoc.UICintrols createnewdoc(0, 0); } - public void hide_panels() { this.RibbonButtonFavoriten.Visible = false; diff --git a/Client/bin/Debug/DOCGEN.dll b/Client/bin/Debug/DOCGEN.dll index a1b4faf5..ea541a45 100644 Binary files a/Client/bin/Debug/DOCGEN.dll and b/Client/bin/Debug/DOCGEN.dll differ diff --git a/Client/bin/Debug/DOCGEN.pdb b/Client/bin/Debug/DOCGEN.pdb index 5304dbd6..334dc463 100644 Binary files a/Client/bin/Debug/DOCGEN.pdb and b/Client/bin/Debug/DOCGEN.pdb differ diff --git a/Client/bin/Debug/Database.dll b/Client/bin/Debug/Database.dll index cf86c724..617df48a 100644 Binary files a/Client/bin/Debug/Database.dll and b/Client/bin/Debug/Database.dll differ diff --git a/Client/bin/Debug/Database.pdb b/Client/bin/Debug/Database.pdb index 51f3dde3..e8918837 100644 Binary files a/Client/bin/Debug/Database.pdb and b/Client/bin/Debug/Database.pdb differ diff --git a/Client/bin/Debug/OnDoc.exe b/Client/bin/Debug/OnDoc.exe index a168b836..fd808526 100644 Binary files a/Client/bin/Debug/OnDoc.exe and b/Client/bin/Debug/OnDoc.exe differ diff --git a/Client/bin/Debug/OnDoc.pdb b/Client/bin/Debug/OnDoc.pdb index e535001c..8b588943 100644 Binary files a/Client/bin/Debug/OnDoc.pdb and b/Client/bin/Debug/OnDoc.pdb differ diff --git a/Client/bin/Debug/de-DE/OnDoc.resources.dll b/Client/bin/Debug/de-DE/OnDoc.resources.dll index cf2181c3..c14d49b0 100644 Binary files a/Client/bin/Debug/de-DE/OnDoc.resources.dll and b/Client/bin/Debug/de-DE/OnDoc.resources.dll differ diff --git a/Client/obj/Debug/Client.csproj.AssemblyReference.cache b/Client/obj/Debug/Client.csproj.AssemblyReference.cache index 9b120f6d..6cc35048 100644 Binary files a/Client/obj/Debug/Client.csproj.AssemblyReference.cache and b/Client/obj/Debug/Client.csproj.AssemblyReference.cache differ diff --git a/Client/obj/Debug/Client.csproj.GenerateResource.cache b/Client/obj/Debug/Client.csproj.GenerateResource.cache index 00316fbd..07b2fab2 100644 Binary files a/Client/obj/Debug/Client.csproj.GenerateResource.cache and b/Client/obj/Debug/Client.csproj.GenerateResource.cache differ diff --git a/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 094167ca..f82ebcf0 100644 Binary files a/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Client/obj/Debug/OnDoc.DocMgmt.SerienbriefBearbeitung.resources b/Client/obj/Debug/OnDoc.DocMgmt.SerienbriefBearbeitung.resources index f5cea509..b9097f91 100644 Binary files a/Client/obj/Debug/OnDoc.DocMgmt.SerienbriefBearbeitung.resources and b/Client/obj/Debug/OnDoc.DocMgmt.SerienbriefBearbeitung.resources differ diff --git a/Client/obj/Debug/OnDoc.exe b/Client/obj/Debug/OnDoc.exe index a168b836..fd808526 100644 Binary files a/Client/obj/Debug/OnDoc.exe and b/Client/obj/Debug/OnDoc.exe differ diff --git a/Client/obj/Debug/OnDoc.pdb b/Client/obj/Debug/OnDoc.pdb index e535001c..8b588943 100644 Binary files a/Client/obj/Debug/OnDoc.pdb and b/Client/obj/Debug/OnDoc.pdb differ diff --git a/Client/obj/Debug/build.force b/Client/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/Client/obj/Debug/de-DE/OnDoc.resources.dll b/Client/obj/Debug/de-DE/OnDoc.resources.dll index cf2181c3..c14d49b0 100644 Binary files a/Client/obj/Debug/de-DE/OnDoc.resources.dll and b/Client/obj/Debug/de-DE/OnDoc.resources.dll differ diff --git a/DOCGEN/Klassen/SyncFWord.cs b/DOCGEN/Klassen/SyncFWord.cs index bbc1a9cc..2d81de5b 100644 --- a/DOCGEN/Klassen/SyncFWord.cs +++ b/DOCGEN/Klassen/SyncFWord.cs @@ -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); diff --git a/DOCGEN/bin/Debug/DOCGEN.dll b/DOCGEN/bin/Debug/DOCGEN.dll index a1b4faf5..ea541a45 100644 Binary files a/DOCGEN/bin/Debug/DOCGEN.dll and b/DOCGEN/bin/Debug/DOCGEN.dll differ diff --git a/DOCGEN/bin/Debug/DOCGEN.pdb b/DOCGEN/bin/Debug/DOCGEN.pdb index 5304dbd6..334dc463 100644 Binary files a/DOCGEN/bin/Debug/DOCGEN.pdb and b/DOCGEN/bin/Debug/DOCGEN.pdb differ diff --git a/DOCGEN/bin/Debug/Database.dll b/DOCGEN/bin/Debug/Database.dll index cf86c724..617df48a 100644 Binary files a/DOCGEN/bin/Debug/Database.dll and b/DOCGEN/bin/Debug/Database.dll differ diff --git a/DOCGEN/bin/Debug/Database.pdb b/DOCGEN/bin/Debug/Database.pdb index 51f3dde3..e8918837 100644 Binary files a/DOCGEN/bin/Debug/Database.pdb and b/DOCGEN/bin/Debug/Database.pdb differ diff --git a/DOCGEN/clsDocGen.cs b/DOCGEN/clsDocGen.cs index 86b11a59..5396298a 100644 --- a/DOCGEN/clsDocGen.cs +++ b/DOCGEN/clsDocGen.cs @@ -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(); - dd.Dokumentid = ""; + dd.Dokumentid = dokumentid; dd.DokumentDatum = sb.dokumentdatum.ToString(); dd.Unterschrift_Links=sb.unterschriftlinks.ToString(); dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString(); diff --git a/DOCGEN/clsDocGet.cs b/DOCGEN/clsDocGet.cs index ee07a89d..8dc1a3b9 100644 --- a/DOCGEN/clsDocGet.cs +++ b/DOCGEN/clsDocGet.cs @@ -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)); diff --git a/DOCGEN/obj/Debug/DOCGEN.dll b/DOCGEN/obj/Debug/DOCGEN.dll index a1b4faf5..ea541a45 100644 Binary files a/DOCGEN/obj/Debug/DOCGEN.dll and b/DOCGEN/obj/Debug/DOCGEN.dll differ diff --git a/DOCGEN/obj/Debug/DOCGEN.pdb b/DOCGEN/obj/Debug/DOCGEN.pdb index 5304dbd6..334dc463 100644 Binary files a/DOCGEN/obj/Debug/DOCGEN.pdb and b/DOCGEN/obj/Debug/DOCGEN.pdb differ diff --git a/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache b/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache index 77c3e91c..db30b29b 100644 Binary files a/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache and b/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache differ diff --git a/DOCGEN/obj/Debug/build.force b/DOCGEN/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/Database/bin/Debug/Database.dll b/Database/bin/Debug/Database.dll index cf86c724..617df48a 100644 Binary files a/Database/bin/Debug/Database.dll and b/Database/bin/Debug/Database.dll differ diff --git a/Database/bin/Debug/Database.pdb b/Database/bin/Debug/Database.pdb index 51f3dde3..e8918837 100644 Binary files a/Database/bin/Debug/Database.pdb and b/Database/bin/Debug/Database.pdb differ diff --git a/Database/db.cs b/Database/db.cs index 85e7adc0..14a8f2bb 100644 --- a/Database/db.cs +++ b/Database/db.cs @@ -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]"; diff --git a/Database/obj/Debug/Database.dll b/Database/obj/Debug/Database.dll index cf86c724..617df48a 100644 Binary files a/Database/obj/Debug/Database.dll and b/Database/obj/Debug/Database.dll differ diff --git a/Database/obj/Debug/Database.pdb b/Database/obj/Debug/Database.pdb index 51f3dde3..e8918837 100644 Binary files a/Database/obj/Debug/Database.pdb and b/Database/obj/Debug/Database.pdb differ diff --git a/Database/obj/Debug/build.force b/Database/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/ILMocup/ILMocup.csproj.user b/ILMocup/ILMocup.csproj.user index 5c90209e..8f0abe62 100644 --- a/ILMocup/ILMocup.csproj.user +++ b/ILMocup/ILMocup.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU ApiControllerEmptyScaffolder root/Common/Web API 600 diff --git a/OnDocWeb/OnDocWeb.csproj.user b/OnDocWeb/OnDocWeb.csproj.user index 71ba3b2a..198c1316 100644 --- a/OnDocWeb/OnDocWeb.csproj.user +++ b/OnDocWeb/OnDocWeb.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU