diff --git a/API_NetFramework/bin/DOCGEN.dll b/API_NetFramework/bin/DOCGEN.dll index bd32419e..bd7be8e4 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 f489da3a..2aa1a24a 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 ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/API_NetFramework/bin/Database.pdb and b/API_NetFramework/bin/Database.pdb differ diff --git a/API_NetFramework/bin/Model.dll b/API_NetFramework/bin/Model.dll index 48ce111f..91ba45c6 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 2a81fe61..056fa267 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 fa6952b4..a2611625 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 6cebaf31..0052fbe0 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 ff38854e..506a1b82 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 fa6952b4..a2611625 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 6cebaf31..0052fbe0 100644 Binary files a/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb and b/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb differ diff --git a/BarcodeLib/bin/Debug/Database.dll b/BarcodeLib/bin/Debug/Database.dll index ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/BarcodeLib/bin/Debug/Database.pdb and b/BarcodeLib/bin/Debug/Database.pdb differ diff --git a/BarcodeLib/bin/Debug/Model.dll b/BarcodeLib/bin/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/BarcodeLib/bin/Debug/Model.dll and b/BarcodeLib/bin/Debug/Model.dll differ diff --git a/BarcodeLib/bin/Debug/Model.pdb b/BarcodeLib/bin/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/BarcodeLib/bin/Debug/Model.pdb and b/BarcodeLib/bin/Debug/Model.pdb differ diff --git a/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache b/BarcodeLib/obj/Debug/BarcodeLib.csproj.AssemblyReference.cache index ab604da4..d9b8a028 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/Client.csproj b/Client/Client.csproj index 142df9b9..2a1a9d85 100644 --- a/Client/Client.csproj +++ b/Client/Client.csproj @@ -223,6 +223,7 @@ + @@ -594,11 +595,6 @@ - - - - - @@ -781,6 +777,21 @@ + + + + + + + + + + + + + + + diff --git a/Client/DocMgmt/Serienbrief.Designer.cs b/Client/DocMgmt/Serienbrief.Designer.cs index a7c659ff..a2327ba5 100644 --- a/Client/DocMgmt/Serienbrief.Designer.cs +++ b/Client/DocMgmt/Serienbrief.Designer.cs @@ -74,17 +74,19 @@ this.ribbonPanel2 = new System.Windows.Forms.RibbonPanel(); this.RibbonButtonNew = new System.Windows.Forms.RibbonButton(); this.RibbonButtonOpen = new System.Windows.Forms.RibbonButton(); - this.ribbonPanel3 = new System.Windows.Forms.RibbonPanel(); - this.RibbonButtonExcelImport = new System.Windows.Forms.RibbonButton(); this.ribbonPanel4 = new System.Windows.Forms.RibbonPanel(); this.RibbonButtonEditWord = new System.Windows.Forms.RibbonButton(); this.ribbonPanel5 = new System.Windows.Forms.RibbonPanel(); this.ribbonbuttonsave = new System.Windows.Forms.RibbonButton(); + 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.ribbonPanel7 = new System.Windows.Forms.RibbonPanel(); this.ribbonbuttonaddpartner = new System.Windows.Forms.RibbonButton(); this.ribbonButton2 = new System.Windows.Forms.RibbonButton(); + this.ribbonPanel8 = new System.Windows.Forms.RibbonPanel(); + this.RibbonButtonGenerateSB = new System.Windows.Forms.RibbonButton(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.pnlLoad = new System.Windows.Forms.Panel(); this.sfdatagridsbload = new Syncfusion.WinForms.DataGrid.SfDataGrid(); @@ -92,7 +94,8 @@ this.btnsbloadok = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); - this.ribbonPanel8 = new System.Windows.Forms.RibbonPanel(); + this.docPreview1 = new OnDoc.UIControls.DocPreview(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.GrpDokumentInhalt.SuspendLayout(); this.groupBox8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.cbboxteam)).BeginInit(); @@ -112,6 +115,10 @@ this.pnlLoad.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.sfdatagridsbload)).BeginInit(); this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); this.SuspendLayout(); // // GrpDokumentInhalt @@ -124,7 +131,7 @@ this.GrpDokumentInhalt.Enabled = false; this.GrpDokumentInhalt.Location = new System.Drawing.Point(2, 101); this.GrpDokumentInhalt.Name = "GrpDokumentInhalt"; - this.GrpDokumentInhalt.Size = new System.Drawing.Size(1255, 254); + this.GrpDokumentInhalt.Size = new System.Drawing.Size(1629, 254); this.GrpDokumentInhalt.TabIndex = 1; this.GrpDokumentInhalt.TabStop = false; this.GrpDokumentInhalt.Text = "Dokument-Inahalt"; @@ -393,9 +400,9 @@ this.GrpEmpfaenger.Controls.Add(this.treeViewAdv1); this.GrpEmpfaenger.Controls.Add(this.GridEmpfänger); this.GrpEmpfaenger.Dock = System.Windows.Forms.DockStyle.Fill; - this.GrpEmpfaenger.Location = new System.Drawing.Point(2, 355); + this.GrpEmpfaenger.Location = new System.Drawing.Point(0, 0); this.GrpEmpfaenger.Name = "GrpEmpfaenger"; - this.GrpEmpfaenger.Size = new System.Drawing.Size(1255, 598); + this.GrpEmpfaenger.Size = new System.Drawing.Size(900, 598); this.GrpEmpfaenger.TabIndex = 2; this.GrpEmpfaenger.TabStop = false; this.GrpEmpfaenger.Text = "Empfänger"; @@ -408,9 +415,10 @@ this.sfDataGridEmpfaenger.Location = new System.Drawing.Point(233, 16); this.sfDataGridEmpfaenger.Name = "sfDataGridEmpfaenger"; this.sfDataGridEmpfaenger.SelectionMode = Syncfusion.WinForms.DataGrid.Enums.GridSelectionMode.Extended; - this.sfDataGridEmpfaenger.Size = new System.Drawing.Size(1019, 579); + this.sfDataGridEmpfaenger.Size = new System.Drawing.Size(664, 579); this.sfDataGridEmpfaenger.TabIndex = 4; this.sfDataGridEmpfaenger.Text = "sfDataGrid1"; + this.sfDataGridEmpfaenger.CellClick += new Syncfusion.WinForms.DataGrid.Events.CellClickEventHandler(this.sfDataGridEmpfaenger_CellClick); // // ctxmenuEmpfaenger // @@ -530,7 +538,7 @@ this.GridEmpfänger.EditMode = Syncfusion.WinForms.DataGrid.Enums.EditMode.SingleClick; this.GridEmpfänger.Location = new System.Drawing.Point(3, 16); this.GridEmpfänger.Name = "GridEmpfänger"; - this.GridEmpfänger.Size = new System.Drawing.Size(1249, 579); + this.GridEmpfänger.Size = new System.Drawing.Size(894, 579); this.GridEmpfänger.TabIndex = 2; this.GridEmpfänger.Text = "sfDataGrid1"; // @@ -552,7 +560,7 @@ this.ribbon1.OrbStyle = System.Windows.Forms.RibbonOrbStyle.Office_2013; this.ribbon1.OrbVisible = false; this.ribbon1.RibbonTabFont = new System.Drawing.Font("Trebuchet MS", 9F); - this.ribbon1.Size = new System.Drawing.Size(1255, 99); + this.ribbon1.Size = new System.Drawing.Size(1629, 99); this.ribbon1.TabIndex = 3; this.ribbon1.Tabs.Add(this.ribbonTab1); this.ribbon1.TabSpacing = 4; @@ -563,9 +571,9 @@ this.ribbonTab1.Name = "ribbonTab1"; this.ribbonTab1.Panels.Add(this.ribbonPanel1); this.ribbonTab1.Panels.Add(this.ribbonPanel2); - this.ribbonTab1.Panels.Add(this.ribbonPanel3); this.ribbonTab1.Panels.Add(this.ribbonPanel4); this.ribbonTab1.Panels.Add(this.ribbonPanel5); + this.ribbonTab1.Panels.Add(this.ribbonPanel3); this.ribbonTab1.Panels.Add(this.ribbonPanel6); this.ribbonTab1.Panels.Add(this.ribbonPanel7); this.ribbonTab1.Panels.Add(this.ribbonPanel8); @@ -613,31 +621,13 @@ this.RibbonButtonOpen.Text = "Öffnen/bearbeiten"; this.RibbonButtonOpen.Click += new System.EventHandler(this.RibbonButtonOpen_Click); // - // ribbonPanel3 - // - this.ribbonPanel3.ButtonMoreEnabled = false; - this.ribbonPanel3.ButtonMoreVisible = false; - this.ribbonPanel3.Items.Add(this.RibbonButtonExcelImport); - this.ribbonPanel3.Name = "ribbonPanel3"; - this.ribbonPanel3.Text = ""; - // - // RibbonButtonExcelImport - // - this.RibbonButtonExcelImport.Image = global::OnDoc.Properties.Resources.Excel_32x32_32; - this.RibbonButtonExcelImport.LargeImage = global::OnDoc.Properties.Resources.Excel_32x32_32; - this.RibbonButtonExcelImport.Name = "RibbonButtonExcelImport"; - this.RibbonButtonExcelImport.SmallImage = global::OnDoc.Properties.Resources.Excel_16x16_32; - this.RibbonButtonExcelImport.Text = "Excel-Liste importieren"; - this.RibbonButtonExcelImport.TextAlignment = System.Windows.Forms.RibbonItem.RibbonItemTextAlignment.Center; - this.RibbonButtonExcelImport.ToolTip = "Excel-Liste importieren"; - this.RibbonButtonExcelImport.Click += new System.EventHandler(this.RibbonButtonExcelImport_Click); - // // ribbonPanel4 // this.ribbonPanel4.ButtonMoreVisible = false; this.ribbonPanel4.Items.Add(this.RibbonButtonEditWord); this.ribbonPanel4.Name = "ribbonPanel4"; this.ribbonPanel4.Text = ""; + this.ribbonPanel4.Visible = false; // // RibbonButtonEditWord // @@ -663,6 +653,25 @@ this.ribbonbuttonsave.Text = "Speichern"; this.ribbonbuttonsave.Click += new System.EventHandler(this.ribbonbuttonsave_Click); // + // ribbonPanel3 + // + this.ribbonPanel3.ButtonMoreEnabled = false; + this.ribbonPanel3.ButtonMoreVisible = false; + this.ribbonPanel3.Items.Add(this.RibbonButtonExcelImport); + this.ribbonPanel3.Name = "ribbonPanel3"; + this.ribbonPanel3.Text = ""; + // + // RibbonButtonExcelImport + // + this.RibbonButtonExcelImport.Image = global::OnDoc.Properties.Resources.Excel_32x32_32; + this.RibbonButtonExcelImport.LargeImage = global::OnDoc.Properties.Resources.Excel_32x32_32; + this.RibbonButtonExcelImport.Name = "RibbonButtonExcelImport"; + this.RibbonButtonExcelImport.SmallImage = global::OnDoc.Properties.Resources.Excel_16x16_32; + this.RibbonButtonExcelImport.Text = "Excel-Liste_importieren"; + this.RibbonButtonExcelImport.TextAlignment = System.Windows.Forms.RibbonItem.RibbonItemTextAlignment.Center; + this.RibbonButtonExcelImport.ToolTip = "Excel-Liste importieren"; + this.RibbonButtonExcelImport.Click += new System.EventHandler(this.RibbonButtonExcelImport_Click); + // // ribbonPanel6 // this.ribbonPanel6.Items.Add(this.ribbonButton1); @@ -675,7 +684,7 @@ 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.Text = "Vorlage_bearbeiten"; this.ribbonButton1.Click += new System.EventHandler(this.ribbonButton1_Click); // // ribbonPanel7 @@ -683,26 +692,42 @@ this.ribbonPanel7.Items.Add(this.ribbonbuttonaddpartner); this.ribbonPanel7.Items.Add(this.ribbonButton2); this.ribbonPanel7.Name = "ribbonPanel7"; - this.ribbonPanel7.Text = "ribbonPanel7"; + this.ribbonPanel7.Text = ""; // // ribbonbuttonaddpartner // - this.ribbonbuttonaddpartner.Image = ((System.Drawing.Image)(resources.GetObject("ribbonbuttonaddpartner.Image"))); - this.ribbonbuttonaddpartner.LargeImage = ((System.Drawing.Image)(resources.GetObject("ribbonbuttonaddpartner.LargeImage"))); + this.ribbonbuttonaddpartner.Image = global::OnDoc.Properties.Resources.Partner_32x32_32; + this.ribbonbuttonaddpartner.LargeImage = global::OnDoc.Properties.Resources.Partner_32x32_32; this.ribbonbuttonaddpartner.Name = "ribbonbuttonaddpartner"; - this.ribbonbuttonaddpartner.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribbonbuttonaddpartner.SmallImage"))); - this.ribbonbuttonaddpartner.Text = "Partner hinzufügen"; + this.ribbonbuttonaddpartner.SmallImage = global::OnDoc.Properties.Resources.Partner_16x16_32; + this.ribbonbuttonaddpartner.Text = "Partner_hinzufügen"; + this.ribbonbuttonaddpartner.TextAlignment = System.Windows.Forms.RibbonItem.RibbonItemTextAlignment.Center; this.ribbonbuttonaddpartner.Click += new System.EventHandler(this.ribbonbuttonaddpartner_Click); // // ribbonButton2 // - this.ribbonButton2.Image = ((System.Drawing.Image)(resources.GetObject("ribbonButton2.Image"))); - this.ribbonButton2.LargeImage = ((System.Drawing.Image)(resources.GetObject("ribbonButton2.LargeImage"))); + 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 = ((System.Drawing.Image)(resources.GetObject("ribbonButton2.SmallImage"))); - this.ribbonButton2.Text = "Partnerlise prüfen"; + 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); // + // ribbonPanel8 + // + this.ribbonPanel8.Items.Add(this.RibbonButtonGenerateSB); + this.ribbonPanel8.Name = "ribbonPanel8"; + this.ribbonPanel8.Text = ""; + // + // RibbonButtonGenerateSB + // + this.RibbonButtonGenerateSB.Image = global::OnDoc.Properties.Resources.SB_Generierung_32x32_32; + this.RibbonButtonGenerateSB.LargeImage = global::OnDoc.Properties.Resources.SB_Generierung_32x32_32; + this.RibbonButtonGenerateSB.Name = "RibbonButtonGenerateSB"; + this.RibbonButtonGenerateSB.SmallImage = global::OnDoc.Properties.Resources.SB_Generierung_24x24_32; + this.RibbonButtonGenerateSB.Text = "Serienbrief_generieren"; + this.RibbonButtonGenerateSB.Click += new System.EventHandler(this.RibbonButtonGenerateSB_Click); + // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; @@ -715,7 +740,7 @@ this.pnlLoad.Controls.Add(this.btnsbloadcancel); this.pnlLoad.Controls.Add(this.btnsbloadok); this.pnlLoad.Controls.Add(this.panel1); - this.pnlLoad.Location = new System.Drawing.Point(241, 101); + this.pnlLoad.Location = new System.Drawing.Point(795, 45); this.pnlLoad.Name = "pnlLoad"; this.pnlLoad.Size = new System.Drawing.Size(965, 637); this.pnlLoad.TabIndex = 4; @@ -775,18 +800,38 @@ this.label1.TabIndex = 0; this.label1.Text = "Serienbrief öffnen"; // - // ribbonPanel8 + // docPreview1 // - this.ribbonPanel8.Name = "ribbonPanel8"; - this.ribbonPanel8.Text = "ribbonPanel8"; + this.docPreview1.Dock = System.Windows.Forms.DockStyle.Fill; + this.docPreview1.Location = new System.Drawing.Point(0, 0); + this.docPreview1.Name = "docPreview1"; + this.docPreview1.Size = new System.Drawing.Size(725, 598); + this.docPreview1.TabIndex = 4; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(2, 355); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.GrpEmpfaenger); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.docPreview1); + this.splitContainer1.Size = new System.Drawing.Size(1629, 598); + this.splitContainer1.SplitterDistance = 900; + this.splitContainer1.TabIndex = 5; // // Serienbrief // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1259, 955); + this.ClientSize = new System.Drawing.Size(1633, 955); + this.Controls.Add(this.splitContainer1); this.Controls.Add(this.pnlLoad); - this.Controls.Add(this.GrpEmpfaenger); this.Controls.Add(this.GrpDokumentInhalt); this.Controls.Add(this.ribbon1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -819,6 +864,10 @@ ((System.ComponentModel.ISupportInitialize)(this.sfdatagridsbload)).EndInit(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); this.ResumeLayout(false); } @@ -882,5 +931,8 @@ private System.Windows.Forms.ToolStripMenuItem partnerLöschenToolStripMenuItem; private System.Windows.Forms.RibbonButton ribbonButton2; private System.Windows.Forms.RibbonPanel ribbonPanel8; + private System.Windows.Forms.RibbonButton RibbonButtonGenerateSB; + private DocPreview docPreview1; + private System.Windows.Forms.SplitContainer splitContainer1; } } \ No newline at end of file diff --git a/Client/DocMgmt/Serienbrief.cs b/Client/DocMgmt/Serienbrief.cs index 24563cc1..9fccc703 100644 --- a/Client/DocMgmt/Serienbrief.cs +++ b/Client/DocMgmt/Serienbrief.cs @@ -17,6 +17,7 @@ using Microsoft.Office.Interop.Word; using Model; using NLog; using OnDoc.DocMgmt; +using OnDoc.Helper; using OnDoc.Klassen; using OnDoc.UIControls.Administrator; using Syncfusion.Windows.Forms.Tools; @@ -24,6 +25,8 @@ using Syncfusion.Windows.Forms.Tools.Renderers; using Syncfusion.WinForms.Controls; using Syncfusion.WinForms.DataGrid; using Syncfusion.WinForms.DataGrid.Interactivity; +using Windows.ApplicationModel.Activation; +using Windows.Media.Ocr; namespace OnDoc.UIControls @@ -35,6 +38,8 @@ namespace OnDoc.UIControls private int profilnr = 0; private serienbrief sb = new serienbrief(); private int serienbriefnr = 0; + private DOCGEN.DocGen dg = null; + private DOCGEN.DocGet dget = null; //private DataSet dsempfaenger = new DataSet(); private int selectedsbnr = 0; @@ -328,10 +333,12 @@ namespace OnDoc.UIControls sb.mutiert_am = DateTime.Now; sb.mutierer = AppParams.CurrentMitarbieter; sb.verantwortlich = AppParams.CurrentMitarbieter; + if (rbzustaendigkube.Checked) { sb.zustaendig = -1; } else { sb.zustaendig = Convert.ToInt32(cbboxzustaendigmitarbeiter.SelectedValue); } try { sb.postzustellung = Convert.ToInt32(cbboxpostzustellung.SelectedValue.ToString()); } catch { sb.postzustellung = 0; } try { sb.unterschriftlinks = Convert.ToInt32(cbboxunterschriftlinks.SelectedValue.ToString()); } catch { sb.unterschriftlinks = 0; } try { sb.unterschriftrechts = Convert.ToInt32(cbboxunterschriftrechts.SelectedValue.ToString()); } catch { sb.unterschriftrechts = 0; } try { sb.team = Convert.ToInt32(cbboxteam.SelectedValue.ToString()); } catch { sb.team = 0; } + sb.archivdatum = Convert.ToDateTime(DateDokumentDatum.Value); DB db = new DB(AppParams.connectionstring); sb.serienbriefnr = db.Save_Serienbrief(sb, AppParams.tempdir); db.save_sb_vorlage_to_db(sb.filename, "", sb.serienbriefnr); @@ -354,7 +361,7 @@ namespace OnDoc.UIControls treeViewAdv1.Nodes[0].Text = "In Bearbeitung (" + dv.Count.ToString() + ")"; dv.RowFilter = "Status =-1"; treeViewAdv1.Nodes[1].Text = "Fehlerhaft (" + dv.Count.ToString() + ")"; - if (dv.Count > 0) treeViewAdv1.Nodes[1].TextColor = Color.Red; else treeViewAdv1.Nodes[1].TextColor= Color.Black; + if (dv.Count > 0) treeViewAdv1.Nodes[1].TextColor = Color.Red; else treeViewAdv1.Nodes[1].TextColor = Color.Black; dv.RowFilter = "Status = 1"; treeViewAdv1.Nodes[2].Text = "Generiert (" + dv.Count.ToString() + ")"; dv.RowFilter = "Status = 2"; @@ -444,6 +451,17 @@ namespace OnDoc.UIControls cbboxunterschriftlinks.SelectedValue = sb.unterschriftlinks; cbboxunterschriftrechts.SelectedValue = sb.unterschriftrechts; cbboxverantwortlich.SelectedValue = sb.verantwortlich; + DateDokumentDatum.Value = sb.archivdatum; + if (sb.zustaendig == -1) + { + rbzustaendigkube.Checked = true; rbzustaendigmitarbeiter.Checked = false; + } + else + { + rbzustaendigkube.Checked = false; + rbzustaendigmitarbeiter.Checked = true; + cbboxzustaendigmitarbeiter.SelectedValue = sb.zustaendig; + } update_zahlen(); GrpDokumentInhalt.Enabled = true; @@ -573,13 +591,13 @@ namespace OnDoc.UIControls } } - + if (Convert.ToInt32(dt.Rows[i][4]) == 1) { bldossier = true; }; } if (sb.dsempfaenger.Tables[0].Columns.Count > 20) { check_zwingende_felder(); } refresh_empfaenger(sb.dsempfaenger.Tables[0]); - if (msg !="") { MessageBox.Show(msg,"Serienbrief",MessageBoxButtons.OK, MessageBoxIcon.Error); } + if (msg != "") { MessageBox.Show(msg, "Serienbrief", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void check_zwingende_felder() @@ -613,5 +631,456 @@ namespace OnDoc.UIControls Partnerliste_Pruefen(); treeViewAdv1_AfterSelect(sender, e); } + + System.Data.DataTable vorlagendaten = new System.Data.DataTable(); + private void RibbonButtonGenerateSB_Click(object sender, EventArgs e) + { + ribbonbuttonsave_Click(sender, e); + ToastMessage.ShowToast("Speichern", "Serienbriefdaten wurden gespeichert"); + vorlagendaten = null; + vorlagendaten = new System.Data.DataTable(); + vorlagendaten = Datentabelle_Generieren(); + dg = new DOCGEN.DocGen(); + dget = new DOCGEN.DocGet(AppParams.connectionstring); + DB dB = new DB(AppParams.connectionstring); + string fn = dB.get_sb_vorlage(sb.serienbriefnr, AppParams.tempdir); + sb.VorlageBase64 = dB.dsdaten.Tables[0].Rows[0][0].ToString(); + sb.DocValues = new List(); + vorlagendaten_aufbereiten(); + + } + + private void vorlagendaten_aufbereiten() + { + for (int i = 0, loopTo = vorlagendaten.Rows.Count - 1; i <= loopTo; i++) + { + + + string sp1 = ""; + string[] sp2; + string feldnr; + for (int i1 = 0, loopTo1 = vorlagendaten.Columns.Count - 1; i1 <= loopTo1; i1++) + { + try + { + sp1 = vorlagendaten.Columns[i1].ColumnName; + sp2 = sp1.Split(new string[] { "_09_" }, StringSplitOptions.None); + sp1 = sp2[0] + "_09_" + sp2[2]; + feldnr = sp2[1].ToString(); + sp1 = sp1; + } + catch + { + sp1 = vorlagendaten.Columns[i1].ColumnName; + feldnr = sp1; + } + switch (sp1) + { + // Mapping Zustelladresse + case "F_09_1": + case "F_09_10": + { + if (vorlagendaten.Rows[i]["Zustelladresse"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Zustelladresse"]; + } + + break; + } + case "F_09_89": + { + if (vorlagendaten.Rows[i]["Name"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Name"]; + } + + break; + } + case "F_09_111": + { + if (vorlagendaten.Rows[i]["Vorname"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Vorname"]; + } + + break; + } + case "F_09_122": + case "F_09_123": + case "F_09_20": + { + string s = ""; + string s1; + if (vorlagendaten.Rows[i]["Briefanrede1"] != "") + { + s = vorlagendaten.Rows[i]["Briefanrede1"].ToString(); + if (s.Substring(0,4)=="Herr") + { + s = "r " + s; + } + else + { + s = " " + s; + } + } + if (vorlagendaten.Rows[i]["Briefanrede2"] != "") + { + if (!string.IsNullOrEmpty(s)) + s = s + Environment.NewLine; + s1 = vorlagendaten.Rows[i]["Briefanrede2"].ToString(); + if (s.Substring(0,4)=="Herr") + { + s = s + "Sehr geehrter " + s1; + } + else + { + s = s + "Sehr geehrte " + s1; + } + } + if (!string.IsNullOrEmpty(s)) + { + vorlagendaten.Rows[i][i1] = s; + } + + break; + } + case "F_09_98": + { + if (vorlagendaten.Rows[i]["Strasse"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Strasse"]; + } + + break; + } + case "F_09_93": + { + if (vorlagendaten.Rows[i]["Ort"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"]; + } + + break; + } + case var @case when @case == "F_09_93": + { + if (vorlagendaten.Rows[i]["Ort"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"]; + } + + break; + } + case "F_09_96": + { + if (vorlagendaten.Rows[i]["PLZ"] != "") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["PLZ"]; + } + + break; + } + case "F_09_132": + { + if (vorlagendaten.Rows[i]["PLZ"].ToString() != "" | vorlagendaten.Rows[i]["Ort"].ToString() != "0") + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["PLZ"] + " " + vorlagendaten.Rows[i]["Ort"]; + } + + break; + } + + default: + { + break; + } + } + + // Verknüpfte Felder + try + { + int i2; + var loopTo2 = sb.dsempfaenger.Tables["VerkFelder"].Rows.Count - 1; + for (i2 = 0; i2 <= loopTo2; i2++) + { + if (feldnr == sb.dsempfaenger.Tables["verkfelder"].Rows[i2]["Vorlagenfeldnr"].ToString()) + { + vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i][sb.dsempfaenger.Tables["verkfelder"].Rows[i2]["IDVWert"].ToString()]; + } + } + } + + catch + { + + } + if (object.ReferenceEquals(vorlagendaten.Rows[i][i1], DBNull.Value)) + { + vorlagendaten.Rows[i][i1] = ""; + } + try + { + if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 5) == "F_09_") + { + Insert_Value(vorlagendaten.Rows[i][i1].ToString(), vorlagendaten.Columns[i1].ColumnName); + } + }catch { } + try + { + if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 5) == "I_09_") + { + string intfeldname; + string Intbookmark; + string IntWert; + intfeldname = vorlagendaten.Columns[i1].ColumnName; + Intbookmark = Helper.Strings.Right(vorlagendaten.Columns[i1].ColumnName, vorlagendaten.Columns[i1].ColumnName.Length - 5); + IntWert = Helper.Strings.Right(vorlagendaten.Columns[i1].ColumnName, vorlagendaten.Columns[i1].ColumnName.Length - 14); + + int ind; + ind = IntWert.IndexOf("_09_"); + IntWert = Helper.Strings.Left(IntWert, ind); + // SplitArray = IntWert.Split("_09_") + // IntWert = SplitArray(0) + // IntWert = RenCol(IntWert) + Insert_Value(vorlagendaten.Rows[i][IntWert].ToString(), Intbookmark); + } + }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); + 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); + //db = null; + sb.DocValues.Clear(); + + } + } + + private void insert_PPZeile(string position, string typ) + { + + } + private void Insert_Value(string feldwert, string feldname) + { + System.Data.DataRow dc; + int pos1; + int pos2; + string beginntextmarke = ""; + string endetextmarke = ""; + // Test + if (feldwert == "**PPZeileB") + { + // MsgBox(beginntextmarke) + foreach (System.Data.DataRow currentDc in sb.dsempfaenger.Tables["UsedFelder"].Rows) + { + dc = currentDc; + if (dc["TempFeldName"] == feldname) + { + beginntextmarke = dc["Beginntextmarke"].ToString(); + endetextmarke = dc["Endetextmarke"].ToString(); + feldname = dc["Feldname"].ToString(); + insert_PPZeile(beginntextmarke, "B"); + return; + } + } + } + if (feldwert == "**PPZeileA") + { + // MsgBox(beginntextmarke) + foreach (System.Data.DataRow currentDc in sb.dsempfaenger.Tables["UsedFelder"].Rows) + { + dc = currentDc; + if (dc["TempFeldName"] == feldname) + { + beginntextmarke = dc["Beginntextmarke"].ToString(); + endetextmarke = dc["Endetextmarke"].ToString(); + feldname = dc["Feldname"].ToString(); + insert_PPZeile(beginntextmarke, "A"); + return; + } + } + } + if (Helper.Strings.Left(feldname, 5) == "TMISB") + { + beginntextmarke = feldname; + endetextmarke = ""; + feldname = ""; + } + else + { + foreach (System.Data.DataRow currentDc2 in sb.dsempfaenger.Tables["UsedFelder"].Rows) + { + dc = currentDc2; + if (dc["TempFeldName"].ToString() == feldname) + { + beginntextmarke = dc["Beginntextmarke"].ToString(); + endetextmarke = dc["Endetextmarke"].ToString(); + feldname = dc["Feldname"].ToString(); + break; + } + } + } + // contentcontrols + try + { + if (feldname.Length > 2) + { + if (feldname != "" & feldname.Substring(0, 3) == "cc_") + { + //objword.ActiveDocument.SelectContentControlsByTag(feldname).Item(1).Range.Text = feldwert; + } + } + } + catch (Exception ex) + { + } + + clsDocValue dv = new clsDocValue(); + dv.TMBeginn=beginntextmarke; ; + dv.TMEnd = endetextmarke; + dv.Value = feldwert; + dv.FieldName=feldname; + sb.DocValues.Add(dv); + + } + + private string Insert_DT_Column(ref System.Data.DataTable dt, string colname) + { + int i = 0; + foreach (DataColumn dc in dt.Columns) + { + if (dc.ColumnName.Length >= colname.Length) + { + if (dc.ColumnName.Substring(0, colname.Length - 1).ToUpper() == colname.ToUpper()) + { + i = i + 1; + } + } + } + if (i > 0) + colname = colname + "_" + i.ToString(); + dt.Columns.Add(colname); + return colname; + } + + private System.Data.DataTable Datentabelle_Generieren() + { + var dt = new System.Data.DataTable(); + System.Data.DataRow dn; + int i; + + var aPrimaryKey = new DataColumn[1]; + DataColumn oDatacolumn; + try + { + sb.dsempfaenger.Tables[0].Columns.Add("IntEintragnr"); + } + catch { } + var loopTo = sb.dsempfaenger.Tables[0].Rows.Count - 1; + for (i = 0; i <= loopTo; i++) + sb.dsempfaenger.Tables[0].Rows[i]["IntEintragNr"] = i; + oDatacolumn = sb.dsempfaenger.Tables[0].Columns["IntEintragnr"]; + aPrimaryKey[0] = oDatacolumn; + sb.dsempfaenger.Tables[0].PrimaryKey = aPrimaryKey; + sb.dsempfaenger.AcceptChanges(); + dt.TableName = "EDKB09_" + sb.serienbriefnr.ToString(); + var loopTo1 = sb.dsempfaenger.Tables[0].Columns.Count - 1; + for (i = 0; i <= loopTo1; i++) + dt.Columns.Add(sb.dsempfaenger.Tables[0].Columns[i].ColumnName); + System.Data.DataRow[] dv; + + dv = sb.dsempfaenger.Tables[0].Select("Dokumentid='' or dokumentid<>''"); + + + foreach (System.Data.DataRow dr in dv) + { + dt.ImportRow(dr); + } + + + bool tmkopfzeile = false; + sb.dsempfaenger.Tables["UsedFelder"].AcceptChanges(); + try + { + var loopTo2 = sb.dsempfaenger.Tables["UsedFelder"].Rows.Count - 1; + for (i = 0; i <= loopTo2; i++) + { + if (sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Nr"].ToString() == "33") + { + tmkopfzeile = true; + } + } + } + catch (Exception ex) + { + object a; + a = 1; + } + + if (tmkopfzeile == false) + { + dn = sb.dsempfaenger.Tables["UsedFelder"].NewRow(); + dn[0] = 33; + dn[1] = "TGEDKCompanyBBEB99"; + dn[2] = ""; + dn[3] = "TGEDKCompanyBBEB99"; + dn[4] = ""; + sb.dsempfaenger.Tables["UsedFelder"].Rows.Add(dn); + } + + try + { + sb.dsempfaenger.Tables["UsedFelder"].Columns.Add("Fnkt"); + sb.dsempfaenger.Tables["UsedFelder"].Columns.Add("TempFeldname"); + } + catch { } + string s; + var loopTo3 = sb.dsempfaenger.Tables["UsedFelder"].Rows.Count - 1; + for (i = 0; i <= loopTo3; i++) + { + + if (Convert.ToInt32(sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Nr"]) != 0) + { + s = "F_09_" + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Nr"].ToString(); + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["fnkt"] = s; + s = Insert_DT_Column(ref dt, s); + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Tempfeldname"] = s; + } + else + { + s = "I_09_" + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Beginntextmarke"]; + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["fnkt"] = s; + s = Insert_DT_Column(ref dt, s); + sb.dsempfaenger.Tables["UsedFelder"].Rows[i]["Tempfeldname"] = s; + } + } + // Me.dsempfaenger.WriteXml("d:\test.xmls") + //dt.Columns["intEintragnr"]. + DB db = new DB(AppParams.connectionstring); + //db.Get_Tabledata_for_Update("Select * from edkb09_" + sb.serienbriefnr.ToString(), false, true); + //db.daten.Tables.Clear(); + //db.daten.Tables.Add(dt.Copy()); + //db.daten.Tables[0].Columns["Partnernr"].ColumnName = "NRPAR00"; + //db.daten.Tables[0].TableName = "Daten"; + //db.Update_Data(); + //dt.Columns["Partnernr"].ColumnName = "NRPAR00"; + db.Create_sb_SQL_Server_Table(ref dt, sb); + db.Save_sb_Data_To_Temptable(ref dt, sb); + return db.Fill_And_Get_Data(sb); + } + + private void sfDataGridEmpfaenger_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e) + { + if (docPreview1.Visible == true) + { + var selectedItem = e.DataRow; + var dataRow = (e.DataRow.RowData as DataRowView).Row; + string inteintragnr = "0"; + inteintragnr = dataRow["inteintragnr"].ToString(); + docPreview1.Show_Serienbrief_Dokument(sb.serienbriefnr, Convert.ToInt32(inteintragnr)); + } + } } } diff --git a/Client/DocMgmt/Serienbrief.resx b/Client/DocMgmt/Serienbrief.resx index 4b8a2a43..c7f796ba 100644 --- a/Client/DocMgmt/Serienbrief.resx +++ b/Client/DocMgmt/Serienbrief.resx @@ -120,46 +120,10 @@ 156, 17 - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII= - - 17, 17 + AAABAAUAAAAAAAEAIABVIgAAVgAAADAwAAABACAAqCUAAKsiAAAgIAAAAQAgAKgQAABTSAAAGBgAAAEA diff --git a/Client/Helper/Strings.cs b/Client/Helper/Strings.cs new file mode 100644 index 00000000..51b86272 --- /dev/null +++ b/Client/Helper/Strings.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OnDoc.Helper +{ + public static class Strings + { + public static string Right(this string value, int length) + { + if (String.IsNullOrEmpty(value)) return string.Empty; + + return value.Length <= length ? value : value.Substring(value.Length - length); + } + + public static string Left(this string value, int maxLength) + { + if (string.IsNullOrEmpty(value)) return value; + maxLength = Math.Abs(maxLength); + + return (value.Length <= maxLength + ? value + : value.Substring(0, maxLength) + ); + } + } +} diff --git a/Client/Properties/Resources.Designer.cs b/Client/Properties/Resources.Designer.cs index aeeb2f66..08708744 100644 --- a/Client/Properties/Resources.Designer.cs +++ b/Client/Properties/Resources.Designer.cs @@ -2010,6 +2010,106 @@ namespace OnDoc.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Generierung_16x16_32 { + get { + object obj = ResourceManager.GetObject("SB_Generierung_16x16_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Generierung_24x24_32 { + get { + object obj = ResourceManager.GetObject("SB_Generierung_24x24_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Generierung_256x256_32 { + get { + object obj = ResourceManager.GetObject("SB_Generierung_256x256_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Generierung_32x32_32 { + get { + object obj = ResourceManager.GetObject("SB_Generierung_32x32_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Generierung_48x48_32 { + get { + object obj = ResourceManager.GetObject("SB_Generierung_48x48_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Partnerliste_Pruefen_16x16_32 { + get { + object obj = ResourceManager.GetObject("SB_Partnerliste_Pruefen_16x16_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Partnerliste_Pruefen_24x24_32 { + get { + object obj = ResourceManager.GetObject("SB_Partnerliste_Pruefen_24x24_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Partnerliste_Pruefen_256x256_32 { + get { + object obj = ResourceManager.GetObject("SB_Partnerliste_Pruefen_256x256_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Partnerliste_Pruefen_32x32_32 { + get { + object obj = ResourceManager.GetObject("SB_Partnerliste_Pruefen_32x32_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SB_Partnerliste_Pruefen_48x48_32 { + get { + object obj = ResourceManager.GetObject("SB_Partnerliste_Pruefen_48x48_32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// diff --git a/Client/Properties/Resources.resx b/Client/Properties/Resources.resx index 05ac69aa..7fdbbd88 100644 --- a/Client/Properties/Resources.resx +++ b/Client/Properties/Resources.resx @@ -703,6 +703,36 @@ ..\Resources\save_48x48-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SB_Generierung_16x16-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Generierung_24x24-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Generierung_256x256-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Generierung_32x32-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Generierung_48x48-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Partnerliste_Pruefen_16x16-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Partnerliste_Pruefen_24x24-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Partnerliste_Pruefen_256x256-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Partnerliste_Pruefen_32x32-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SB_Partnerliste_Pruefen_48x48-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Search_16x16-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Client/Resources/SB_Generierung_16x16-32.png b/Client/Resources/SB_Generierung_16x16-32.png new file mode 100644 index 00000000..9535eda9 Binary files /dev/null and b/Client/Resources/SB_Generierung_16x16-32.png differ diff --git a/Client/Resources/SB_Generierung_24x24-32.png b/Client/Resources/SB_Generierung_24x24-32.png new file mode 100644 index 00000000..3fe64917 Binary files /dev/null and b/Client/Resources/SB_Generierung_24x24-32.png differ diff --git a/Client/Resources/SB_Generierung_256x256-32.png b/Client/Resources/SB_Generierung_256x256-32.png new file mode 100644 index 00000000..f99c1219 Binary files /dev/null and b/Client/Resources/SB_Generierung_256x256-32.png differ diff --git a/Client/Resources/SB_Generierung_32x32-32.png b/Client/Resources/SB_Generierung_32x32-32.png new file mode 100644 index 00000000..e661846b Binary files /dev/null and b/Client/Resources/SB_Generierung_32x32-32.png differ diff --git a/Client/Resources/SB_Generierung_48x48-32.png b/Client/Resources/SB_Generierung_48x48-32.png new file mode 100644 index 00000000..39ad66a9 Binary files /dev/null and b/Client/Resources/SB_Generierung_48x48-32.png differ diff --git a/Client/Resources/SB_Partnerliste_Pruefen_16x16-32.png b/Client/Resources/SB_Partnerliste_Pruefen_16x16-32.png new file mode 100644 index 00000000..78ada4a2 Binary files /dev/null and b/Client/Resources/SB_Partnerliste_Pruefen_16x16-32.png differ diff --git a/Client/Resources/SB_Partnerliste_Pruefen_24x24-32.png b/Client/Resources/SB_Partnerliste_Pruefen_24x24-32.png new file mode 100644 index 00000000..83265766 Binary files /dev/null and b/Client/Resources/SB_Partnerliste_Pruefen_24x24-32.png differ diff --git a/Client/Resources/SB_Partnerliste_Pruefen_256x256-32.png b/Client/Resources/SB_Partnerliste_Pruefen_256x256-32.png new file mode 100644 index 00000000..cc5c5e15 Binary files /dev/null and b/Client/Resources/SB_Partnerliste_Pruefen_256x256-32.png differ diff --git a/Client/Resources/SB_Partnerliste_Pruefen_32x32-32.png b/Client/Resources/SB_Partnerliste_Pruefen_32x32-32.png new file mode 100644 index 00000000..335b5be9 Binary files /dev/null and b/Client/Resources/SB_Partnerliste_Pruefen_32x32-32.png differ diff --git a/Client/Resources/SB_Partnerliste_Pruefen_48x48-32.png b/Client/Resources/SB_Partnerliste_Pruefen_48x48-32.png new file mode 100644 index 00000000..4b4467ac Binary files /dev/null and b/Client/Resources/SB_Partnerliste_Pruefen_48x48-32.png differ diff --git a/Client/UIControls/DocPreview.cs b/Client/UIControls/DocPreview.cs index 59693958..36aad1d2 100644 --- a/Client/UIControls/DocPreview.cs +++ b/Client/UIControls/DocPreview.cs @@ -12,6 +12,8 @@ using System.Net; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Database; +using System.Linq.Expressions; namespace OnDoc.UIControls { @@ -63,6 +65,30 @@ namespace OnDoc.UIControls } } + + public void Show_Serienbrief_Dokument(int Serienbriefnr, int Eintragnr) + { + 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); + try + { + + var stream = new MemoryStream(Convert.FromBase64String(db.dsdaten.Tables[0].Rows[0][0].ToString())); + if (stream.Length > 0) + { + this.pdfViewerControl1.Load(stream); + this.pdfViewerControl1.Visible = true; + } + else + { + + } + } + catch { } + db = null; + + + } private clsdok GetDoc(bool AsPDF, string dokumentid) { clsdok dok = new clsdok("", "", ""); diff --git a/Client/bin/Debug/DOCGEN.dll b/Client/bin/Debug/DOCGEN.dll index bd32419e..bd7be8e4 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 f489da3a..2aa1a24a 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 ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/Client/bin/Debug/Database.pdb and b/Client/bin/Debug/Database.pdb differ diff --git a/Client/bin/Debug/Model.dll b/Client/bin/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/Client/bin/Debug/Model.dll and b/Client/bin/Debug/Model.dll differ diff --git a/Client/bin/Debug/Model.pdb b/Client/bin/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/Client/bin/Debug/Model.pdb and b/Client/bin/Debug/Model.pdb differ diff --git a/Client/bin/Debug/OnDoc.exe b/Client/bin/Debug/OnDoc.exe index e697f0a0..f3d08a8e 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 a95aa805..278e5a27 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 338157f9..d424617b 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 b6b84674..2f85fa0f 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.CoreCompileInputs.cache b/Client/obj/Debug/Client.csproj.CoreCompileInputs.cache index 5a224631..df23bc2f 100644 --- a/Client/obj/Debug/Client.csproj.CoreCompileInputs.cache +++ b/Client/obj/Debug/Client.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -814802d754b2128b3f6dad2b8544b2a517e2d5ae467a7e6b9ae6acd890a15d4b +8da378f2397f300b8808b6f801306aaa269d19cd08b0d41d8535b9125dcef444 diff --git a/Client/obj/Debug/Client.csproj.GenerateResource.cache b/Client/obj/Debug/Client.csproj.GenerateResource.cache index ebd4c4bf..2aa30453 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 2853d65a..84c3d059 100644 Binary files a/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index abb2bb02..175ba054 100644 Binary files a/Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Client/obj/Debug/OnDoc.Properties.Resources.resources b/Client/obj/Debug/OnDoc.Properties.Resources.resources index 1857e50b..ede94854 100644 Binary files a/Client/obj/Debug/OnDoc.Properties.Resources.resources and b/Client/obj/Debug/OnDoc.Properties.Resources.resources differ diff --git a/Client/obj/Debug/OnDoc.UIControls.Serienbrief.resources b/Client/obj/Debug/OnDoc.UIControls.Serienbrief.resources index 85485290..cc34211a 100644 Binary files a/Client/obj/Debug/OnDoc.UIControls.Serienbrief.resources and b/Client/obj/Debug/OnDoc.UIControls.Serienbrief.resources differ diff --git a/Client/obj/Debug/OnDoc.exe b/Client/obj/Debug/OnDoc.exe index e697f0a0..f3d08a8e 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 a95aa805..278e5a27 100644 Binary files a/Client/obj/Debug/OnDoc.pdb and b/Client/obj/Debug/OnDoc.pdb differ diff --git a/Client/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/Client/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll index 8b02102f..f0d484bf 100644 Binary files a/Client/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and b/Client/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/Client/obj/Debug/de-DE/OnDoc.resources.dll b/Client/obj/Debug/de-DE/OnDoc.resources.dll index 338157f9..d424617b 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/bin/Debug/DOCGEN.dll b/DOCGEN/bin/Debug/DOCGEN.dll index bd32419e..bd7be8e4 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 f489da3a..2aa1a24a 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 ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/DOCGEN/bin/Debug/Database.pdb and b/DOCGEN/bin/Debug/Database.pdb differ diff --git a/DOCGEN/bin/Debug/Model.dll b/DOCGEN/bin/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/DOCGEN/bin/Debug/Model.dll and b/DOCGEN/bin/Debug/Model.dll differ diff --git a/DOCGEN/bin/Debug/Model.pdb b/DOCGEN/bin/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/DOCGEN/bin/Debug/Model.pdb and b/DOCGEN/bin/Debug/Model.pdb differ diff --git a/DOCGEN/clsDocGen.cs b/DOCGEN/clsDocGen.cs index 357709dc..affe37db 100644 --- a/DOCGEN/clsDocGen.cs +++ b/DOCGEN/clsDocGen.cs @@ -13,6 +13,9 @@ using System.Runtime.CompilerServices; using Model; using Database; using NLog.Config; +using System.Runtime.Serialization; +using System.Xml.Linq; +using NLog.LayoutRenderers; namespace DOCGEN { @@ -66,5 +69,24 @@ namespace DOCGEN { return ""; } + + public string generate_serienbrief(string vorlage,serienbrief sb) + { + SyncFWord sfword = new SyncFWord(); + clsdok dok = new clsdok("", "", ""); + clsDocData dd = new clsDocData(); + dd.DocMacros = new List(); + dd.Dokumentid = ""; + dd.DokumentDatum = sb.dokumentdatum.ToString(); + dd.Unterschrift_Links=sb.unterschriftlinks.ToString(); + dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString(); + dd.DocValues = sb.DocValues; + dd.As_Faksimile = sb.faksimile_unterschrfit.ToString(); + dok.dokument = sfword.Generate_Word(vorlage,dd); + dok.doktype = "D"; + + sfword = null; + return dok.dokument; + } } } diff --git a/DOCGEN/obj/Debug/DOCGEN.dll b/DOCGEN/obj/Debug/DOCGEN.dll index bd32419e..bd7be8e4 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 f489da3a..2aa1a24a 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 a66f87ff..fc17a336 100644 Binary files a/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache and b/DOCGEN/obj/Debug/DocGen.csproj.AssemblyReference.cache differ diff --git a/Database/bin/Debug/Database.dll b/Database/bin/Debug/Database.dll index ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/Database/bin/Debug/Database.pdb and b/Database/bin/Debug/Database.pdb differ diff --git a/Database/bin/Debug/Model.dll b/Database/bin/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/Database/bin/Debug/Model.dll and b/Database/bin/Debug/Model.dll differ diff --git a/Database/bin/Debug/Model.pdb b/Database/bin/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/Database/bin/Debug/Model.pdb and b/Database/bin/Debug/Model.pdb differ diff --git a/Database/db.cs b/Database/db.cs index 9c76b0fa..9f9d482d 100644 --- a/Database/db.cs +++ b/Database/db.cs @@ -162,6 +162,7 @@ namespace Database } // sqlcmd.CommandType = CommandType.StoredProcedure // sqlcmd.CommandText = "Berufsliste" + da.SelectCommand = sqlcmd; da.Fill(daten, "Daten"); qb = new SqlCommandBuilder(da); @@ -170,7 +171,7 @@ namespace Database public void Update_Data() { - da.Update(daten, "Daten"); + int i = da.Update(daten, "Daten"); //SqlDataAdapter dadaten = new SqlDataAdapter(); //var cb = new SqlCommandBuilder(dadaten); //dadaten.Update(dsdaten, dsdaten.Tables[0].TableName); @@ -179,7 +180,23 @@ namespace Database } #endregion + public string generate_key(string dbkey) + { + string skey = "OFFEDK000"; + string s = ""; + s = DateTime.Now.Year.ToString().Trim(); + string dt = s; + skey = skey + s; + while (dbkey.Length < 8) + { + dbkey = "0" + dbkey; + } + skey = skey + dbkey; + s = Helper.DivFnkt.modulo10(dt + dbkey).ToString(); + skey = skey + s; + return skey; + } public string get_dbkey(string Tablename) { clsMyKey_Tabelle myKey_Tabelle = new clsMyKey_Tabelle(); @@ -187,20 +204,8 @@ namespace Database string dbkey = myKey_Tabelle.get_dbkey(Tablename).ToString(); if (Tablename == "Dokument") { - string skey = "OFFEDK000"; - string s = ""; - s = DateTime.Now.Year.ToString().Trim(); - string dt = s; - skey = skey + s; + return generate_key(dbkey); - while (dbkey.Length < 8) - { - dbkey = "0" + dbkey; - } - skey = skey + dbkey; - s = Helper.DivFnkt.modulo10(dt + dbkey).ToString(); - skey = skey + s; - return skey; } else { return dbkey; } } @@ -1367,6 +1372,56 @@ namespace Database } return true; } + + public string save_serienbrief_datei(int serienbriefnr, int eintragnr, string filename) + { + SqlConnection Connection = new SqlConnection(); + SqlDataAdapter DA = new SqlDataAdapter("select top 1 * from edex_sb_serienbrief_dokument where inteintragnr=" + eintragnr.ToString() + " and serienbriefnr=" + serienbriefnr.ToString(), Connection); + SqlCommandBuilder cb = new SqlCommandBuilder(DA); + DataSet ds = new DataSet(); + FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read); + byte[] mydata = new byte[fs.Length]; + try + { + fs.Read(mydata, 0, Convert.ToInt32(fs.Length)); + fs.Close(); + Connection.ConnectionString = connectionstring; + Connection.Open(); + DA.Fill(ds, "sbdokument"); + DataRow myRow; + if (ds.Tables[0].Rows.Count == 0) + { + myRow = ds.Tables[0].NewRow(); + myRow[1] = serienbriefnr.ToString(); + myRow[2] = eintragnr.ToString(); + myRow[3] = mydata; + ds.Tables[0].Rows.Add(myRow); + DA.Update(ds, "sbdokument"); + } + else + { + myRow = ds.Tables[0].Rows[0]; + myRow[3] = mydata; + DA.Update(ds, "sbdokument"); + } + } + catch (Exception ex) + { + return ""; + } + finally + { + fs = null; + cb = null; + ds = null; + DA = null; + Connection.Close(); + Connection = null; + } + return filename; + } + + public string save_sb_vorlage_to_db(string filename, string doctype, int serienbriefnr) { try @@ -1513,7 +1568,7 @@ namespace Database return; } - public DataTable Check_sb_Data(int mitarbeiternr,serienbrief sb) + public DataTable Check_sb_Data(int mitarbeiternr, serienbrief sb) { clear_parameter(); add_parameter("@manr", mitarbeiternr.ToString()); @@ -1523,9 +1578,167 @@ namespace Database return dsdaten.Tables[0]; } + public void Create_sb_SQL_Server_Table(ref DataTable dt, serienbrief sb) + { + string s; + string s1; + int i; + // dt.Columns.Add("NRPAR00") + // dt.Columns.Add("IntEintragNr") + + s1 = "Drop Table DBO.EDKB09_" + sb.serienbriefnr.ToString(); + + // s = "Create Table EDKB09_" + Me.Serienbriefnr.ToString + "( NRPAR00 int, intEintragNr int," + 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.Substring(0, s.Length - 1); + s = s + ""; + s = s + " " + ",CONSTRAINT [PK_EDKB09_" + sb.serienbriefnr.ToString() + "] PRIMARY KEY CLUSTERED ([IntEintragnr] ASC)) ON[DEFAULT]"; + + + + + var conn = new SqlConnection(); + conn.ConnectionString = connectionstring; + conn.Open(); + var sqlcmd0 = new SqlCommand(s1, conn); + try + { + sqlcmd0.ExecuteNonQuery(); + } + catch + { + } + + var sqlcmd = new SqlCommand(s, conn); + sqlcmd.ExecuteNonQuery(); + conn.Close(); + } + public void Save_sb_Data_To_Temptable(ref DataTable dt, serienbrief sb) + { + Get_Tabledata_for_Update("Select * from EDKB09_" + sb.serienbriefnr.ToString() + " where inteintragnr=-1", false, true); + System.Data.DataTable ndt = dt.Copy(); + ndt.Columns[0].ColumnName = "NRPAR00"; + ndt.AcceptChanges(); + foreach (System.Data.DataRow dr in ndt.Rows) + { + System.Data.DataRow nr = daten.Tables[0].NewRow(); + foreach (System.Data.DataColumn col in ndt.Columns) + { + nr[col.ColumnName] = dr[col.ColumnName].ToString(); + } + daten.Tables[0].Rows.Add(nr); + } + + foreach (System.Data.DataRow dr in ndt.Rows) + { + + string s = "insert into edkb09_" + sb.serienbriefnr.ToString(); + s = s + "("; + foreach (System.Data.DataColumn col in ndt.Columns) + { + s = s + "[" + col.ColumnName.ToString() + "],"; + } + s = s.Substring(0, s.Length - 1); + s = s + ") values ("; + foreach (System.Data.DataColumn col in ndt.Columns) + { + s = s + "'" + dr[col.ColumnName].ToString() + "',"; + } + s = s.Substring(0, s.Length - 1); + s = s + ")"; + + Exec_SQL(s); + + } + return; + + //var connection = new SqlConnection(); + //var da = new SqlDataAdapter("Select * from EDKB09_" + sb.serienbriefnr.ToString(), connection); + //var cb = new SqlCommandBuilder(da); + //connection.ConnectionString = connectionstring; + //connection.Open(); + //da.Update(ndt); + //connection.Close(); + + + //daten.AcceptChanges(); + //Update_Data(); + //da.Update(dt); + + //var tdt = new DataTable("EDKB09_" + sb.serienbriefnr.ToString()); + //DataRow tdr; + //int i; + //int ii; + //tdt = dt.Copy(); + //tdt.Columns[0].ColumnName = "NRPAR00"; + + //daten.Tables.Clear(); + //daten.Tables.Add(tdt.Copy()); + //daten.Tables[0].TableName = "Daten"; + //daten.WriteXml(@"x:\gaga.xml"); + //daten.AcceptChanges(); + //Update_Data(); + ////var connection = new SqlConnection(); + ////var da = new SqlDataAdapter("Select * from EDKB09_" + sb.serienbriefnr.ToString(), connection); + ////var cb = new SqlCommandBuilder(da); + ////connection.ConnectionString = connectionstring; + ////connection.Open(); + ////da.Update(tdt); + ////connection.Close(); + } + + public DataTable Fill_And_Get_Data(serienbrief sb) + { + var scmCmdToExecute = new SqlCommand(); + int i; + SqlConnection con = new SqlConnection(connectionstring); + var dtToReturn = new DataTable(); + var sdaAdapter = new SqlDataAdapter(scmCmdToExecute); + scmCmdToExecute.CommandText = "dbo.sp_edex_sb_fill_sbdata"; + scmCmdToExecute.CommandType = CommandType.StoredProcedure; + scmCmdToExecute.Connection = con; + string Dokid = ""; + try + { + scmCmdToExecute.Parameters.Add(new SqlParameter("@serienbriefnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, sb.serienbriefnr)); + scmCmdToExecute.Parameters.Add(new SqlParameter("@ROWCOUNT", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, sb.dsempfaenger.Tables[0].Rows.Count)); + scmCmdToExecute.Parameters.Add(new SqlParameter("@dokumentid", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, 0)); + scmCmdToExecute.Parameters.Add(new SqlParameter("@bedr", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, 0)); + scmCmdToExecute.Parameters.Add(new SqlParameter("@preview", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, 1)); + sdaAdapter.Fill(dtToReturn); + Dokid = scmCmdToExecute.Parameters["@dokumentid"].Value.ToString(); + var loopTo = dtToReturn.Rows.Count - 1; + for (i = 0; i <= loopTo; i++) + { + dtToReturn.Rows[i]["Dokumentid"] = generate_key(Dokid); + Dokid = Dokid + 1; + if (scmCmdToExecute.Parameters["@bedr"].Value.ToString() == "1") + { + dtToReturn.Rows[i]["dokumentidbdr"] = generate_key(Dokid); + Dokid = Dokid + 1; + } + } + return dtToReturn; + } + + catch (Exception ex) + { + throw new Exception("sp_check_dokumentreaktivierung::" + scmCmdToExecute.CommandText + "::Error occured." + ex.Message, ex); + } + finally + { + scmCmdToExecute.Dispose(); + sdaAdapter.Dispose(); + } + } + + } - + } diff --git a/Database/obj/Debug/Database.csproj.AssemblyReference.cache b/Database/obj/Debug/Database.csproj.AssemblyReference.cache index 1ea8b2bc..a26cf799 100644 Binary files a/Database/obj/Debug/Database.csproj.AssemblyReference.cache and b/Database/obj/Debug/Database.csproj.AssemblyReference.cache differ diff --git a/Database/obj/Debug/Database.dll b/Database/obj/Debug/Database.dll index ff62c79a..52752ac1 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 3708ad72..5782dad7 100644 Binary files a/Database/obj/Debug/Database.pdb and b/Database/obj/Debug/Database.pdb differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Generierung_16x16-32.png b/Images/Icons/Icons/Blue/Images/SB_Generierung_16x16-32.png new file mode 100644 index 00000000..9535eda9 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Generierung_16x16-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Generierung_24x24-32.png b/Images/Icons/Icons/Blue/Images/SB_Generierung_24x24-32.png new file mode 100644 index 00000000..3fe64917 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Generierung_24x24-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Generierung_256x256-32.png b/Images/Icons/Icons/Blue/Images/SB_Generierung_256x256-32.png new file mode 100644 index 00000000..f99c1219 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Generierung_256x256-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Generierung_32x32-32.png b/Images/Icons/Icons/Blue/Images/SB_Generierung_32x32-32.png new file mode 100644 index 00000000..e661846b Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Generierung_32x32-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Generierung_48x48-32.png b/Images/Icons/Icons/Blue/Images/SB_Generierung_48x48-32.png new file mode 100644 index 00000000..39ad66a9 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Generierung_48x48-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_16x16-32.png b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_16x16-32.png new file mode 100644 index 00000000..78ada4a2 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_16x16-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_24x24-32.png b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_24x24-32.png new file mode 100644 index 00000000..83265766 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_24x24-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_256x256-32.png b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_256x256-32.png new file mode 100644 index 00000000..cc5c5e15 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_256x256-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_32x32-32.png b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_32x32-32.png new file mode 100644 index 00000000..335b5be9 Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_32x32-32.png differ diff --git a/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_48x48-32.png b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_48x48-32.png new file mode 100644 index 00000000..4b4467ac Binary files /dev/null and b/Images/Icons/Icons/Blue/Images/SB_Partnerliste_Pruefen_48x48-32.png differ diff --git a/Images/Icons/Icons/Blue/SB_Generierung.ico b/Images/Icons/Icons/Blue/SB_Generierung.ico new file mode 100644 index 00000000..01323af3 Binary files /dev/null and b/Images/Icons/Icons/Blue/SB_Generierung.ico differ diff --git a/Images/Icons/Icons/Blue/SB_Partnerliste_Pruefen.ico b/Images/Icons/Icons/Blue/SB_Partnerliste_Pruefen.ico new file mode 100644 index 00000000..2dc30b9d Binary files /dev/null and b/Images/Icons/Icons/Blue/SB_Partnerliste_Pruefen.ico differ diff --git a/Model/bin/Debug/Model.dll b/Model/bin/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/Model/bin/Debug/Model.dll and b/Model/bin/Debug/Model.dll differ diff --git a/Model/bin/Debug/Model.pdb b/Model/bin/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/Model/bin/Debug/Model.pdb and b/Model/bin/Debug/Model.pdb differ diff --git a/Model/clsSerienbrief.cs b/Model/clsSerienbrief.cs index f9175a51..a5491eb9 100644 --- a/Model/clsSerienbrief.cs +++ b/Model/clsSerienbrief.cs @@ -18,6 +18,10 @@ namespace Model public int zustaendig { get; set; } = 0; public int unterschriftlinks { get; set; } = 0; public int unterschriftrechts { get; set; } = 0; + + public bool ohne_unterschrift { get; set; } = false; + public bool faksimile_unterschrfit { get; set; } = false; + public int team { get; set; } = 0; public DateTime archivdatum { get; set; } = DateTime.Now; public DateTime termin { get; set; } = DateTime.Now; @@ -42,6 +46,8 @@ namespace Model public int officevorlagenr { get; set; } = 0; public string filename { get; set; } public DataSet dsempfaenger { get; set; } + public List DocValues { get; set; } + public string VorlageBase64 { get; set; } = ""; } diff --git a/Model/obj/Debug/Model.dll b/Model/obj/Debug/Model.dll index 48ce111f..91ba45c6 100644 Binary files a/Model/obj/Debug/Model.dll and b/Model/obj/Debug/Model.dll differ diff --git a/Model/obj/Debug/Model.pdb b/Model/obj/Debug/Model.pdb index 2a81fe61..056fa267 100644 Binary files a/Model/obj/Debug/Model.pdb and b/Model/obj/Debug/Model.pdb differ