update 20241128

This commit is contained in:
Stefan Hutter
2024-11-28 22:33:49 +01:00
parent 2a652c7325
commit 470d2e1bb5
82 changed files with 1629 additions and 365 deletions

View File

@@ -86,6 +86,7 @@
this.ribbonPanel2 = new System.Windows.Forms.RibbonPanel();
this.RibbonButtonNew = new System.Windows.Forms.RibbonButton();
this.RibbonButtonOpen = new System.Windows.Forms.RibbonButton();
this.ribbonButtonDelete = 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();
@@ -110,8 +111,11 @@
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.groupBox1 = new System.Windows.Forms.GroupBox();
this.rbppohne = new System.Windows.Forms.RadioButton();
this.rbppa = new System.Windows.Forms.RadioButton();
this.rbbpb = new System.Windows.Forms.RadioButton();
this.GrpDokumentInhalt.SuspendLayout();
this.grpDruckstapel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeviewDruckstapel)).BeginInit();
@@ -139,10 +143,12 @@
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// GrpDokumentInhalt
//
this.GrpDokumentInhalt.Controls.Add(this.groupBox1);
this.GrpDokumentInhalt.Controls.Add(this.grpDruckstapel);
this.GrpDokumentInhalt.Controls.Add(this.pnlprogress);
this.GrpDokumentInhalt.Controls.Add(this.groupBox8);
@@ -312,9 +318,9 @@
// groupBox8
//
this.groupBox8.Controls.Add(this.cbboxteam);
this.groupBox8.Location = new System.Drawing.Point(546, 174);
this.groupBox8.Location = new System.Drawing.Point(546, 138);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(534, 73);
this.groupBox8.Size = new System.Drawing.Size(534, 48);
this.groupBox8.TabIndex = 15;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "Team";
@@ -323,7 +329,7 @@
//
this.cbboxteam.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.cbboxteam.DropDownPosition = Syncfusion.WinForms.Core.Enums.PopupRelativeAlignment.Center;
this.cbboxteam.Location = new System.Drawing.Point(151, 19);
this.cbboxteam.Location = new System.Drawing.Point(22, 19);
this.cbboxteam.Name = "cbboxteam";
this.cbboxteam.Size = new System.Drawing.Size(354, 19);
this.cbboxteam.Style.DropDownStyle.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100)))));
@@ -341,7 +347,7 @@
this.groupBox7.Controls.Add(this.lblUnterschriftlinks);
this.groupBox7.Location = new System.Drawing.Point(546, 23);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(534, 145);
this.groupBox7.Size = new System.Drawing.Size(534, 109);
this.groupBox7.TabIndex = 14;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Unterschriften";
@@ -359,7 +365,7 @@
// cbdigitaleunterschrfiten
//
this.cbdigitaleunterschrfiten.AutoSize = true;
this.cbdigitaleunterschrfiten.Location = new System.Drawing.Point(22, 113);
this.cbdigitaleunterschrfiten.Location = new System.Drawing.Point(189, 18);
this.cbdigitaleunterschrfiten.Name = "cbdigitaleunterschrfiten";
this.cbdigitaleunterschrfiten.Size = new System.Drawing.Size(111, 17);
this.cbdigitaleunterschrfiten.TabIndex = 10;
@@ -370,9 +376,9 @@
//
this.cbboxunterschriftrechts.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.cbboxunterschriftrechts.DropDownPosition = Syncfusion.WinForms.Core.Enums.PopupRelativeAlignment.Center;
this.cbboxunterschriftrechts.Location = new System.Drawing.Point(151, 79);
this.cbboxunterschriftrechts.Location = new System.Drawing.Point(189, 79);
this.cbboxunterschriftrechts.Name = "cbboxunterschriftrechts";
this.cbboxunterschriftrechts.Size = new System.Drawing.Size(354, 19);
this.cbboxunterschriftrechts.Size = new System.Drawing.Size(316, 19);
this.cbboxunterschriftrechts.Style.DropDownStyle.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100)))));
this.cbboxunterschriftrechts.Style.TokenStyle.CloseButtonBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.cbboxunterschriftrechts.TabIndex = 9;
@@ -382,9 +388,9 @@
//
this.cbboxunterschriftlinks.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.cbboxunterschriftlinks.DropDownPosition = Syncfusion.WinForms.Core.Enums.PopupRelativeAlignment.Center;
this.cbboxunterschriftlinks.Location = new System.Drawing.Point(151, 50);
this.cbboxunterschriftlinks.Location = new System.Drawing.Point(189, 50);
this.cbboxunterschriftlinks.Name = "cbboxunterschriftlinks";
this.cbboxunterschriftlinks.Size = new System.Drawing.Size(354, 19);
this.cbboxunterschriftlinks.Size = new System.Drawing.Size(316, 19);
this.cbboxunterschriftlinks.Style.DropDownStyle.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100)))));
this.cbboxunterschriftlinks.Style.TokenStyle.CloseButtonBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.cbboxunterschriftlinks.TabIndex = 8;
@@ -805,6 +811,16 @@
this.RibbonButtonOpen.Text = "Öffnen/bearbeiten";
this.RibbonButtonOpen.Click += new System.EventHandler(this.RibbonButtonOpen_Click);
//
// 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);
//
// ribbonPanel4
//
this.ribbonPanel4.ButtonMoreVisible = false;
@@ -1035,16 +1051,6 @@
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;
@@ -1054,6 +1060,50 @@
this.docPreview1.TabIndex = 4;
this.docPreview1.ZoomPercentage = 0;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.rbbpb);
this.groupBox1.Controls.Add(this.rbppa);
this.groupBox1.Controls.Add(this.rbppohne);
this.groupBox1.Location = new System.Drawing.Point(546, 192);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(534, 55);
this.groupBox1.TabIndex = 16;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Fakturierung";
//
// rbppohne
//
this.rbppohne.AutoSize = true;
this.rbppohne.Checked = true;
this.rbppohne.Location = new System.Drawing.Point(20, 23);
this.rbppohne.Name = "rbppohne";
this.rbppohne.Size = new System.Drawing.Size(52, 17);
this.rbppohne.TabIndex = 0;
this.rbppohne.TabStop = true;
this.rbppohne.Text = "Keine";
this.rbppohne.UseVisualStyleBackColor = true;
//
// rbppa
//
this.rbppa.AutoSize = true;
this.rbppa.Location = new System.Drawing.Point(87, 24);
this.rbppa.Name = "rbppa";
this.rbppa.Size = new System.Drawing.Size(73, 17);
this.rbppa.TabIndex = 1;
this.rbppa.Text = "PP-A-Post";
this.rbppa.UseVisualStyleBackColor = true;
//
// rbbpb
//
this.rbbpb.AutoSize = true;
this.rbbpb.Location = new System.Drawing.Point(166, 24);
this.rbbpb.Name = "rbbpb";
this.rbbpb.Size = new System.Drawing.Size(73, 17);
this.rbbpb.TabIndex = 2;
this.rbbpb.Text = "PP-B-Post";
this.rbbpb.UseVisualStyleBackColor = true;
//
// Serienbrief
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1102,6 +1152,8 @@
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
@@ -1183,5 +1235,9 @@
private System.Windows.Forms.RibbonButton RibbonButtonArchivierenUndAbschlessen;
private System.Windows.Forms.ToolStripMenuItem erneutGenerierenToolStripMenuItem;
private System.Windows.Forms.RibbonButton ribbonButtonDelete;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbbpb;
private System.Windows.Forms.RadioButton rbppa;
private System.Windows.Forms.RadioButton rbppohne;
}
}

View File

@@ -6,6 +6,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Messaging;
using System.Text;
@@ -13,6 +14,8 @@ using System.Threading.Tasks;
using System.Web.Caching;
using System.Windows.Forms;
using System.Xml.Linq;
using BroadcastListener.Classes;
using BroadcastListener.Interfaces;
using Database;
using DOCGEN.Klassen;
using Helper;
@@ -35,11 +38,12 @@ using Windows.ApplicationModel.VoiceCommands;
using Windows.Media.Ocr;
using Windows.Perception.Spatial;
using static Model.OnBaseDocUpload;
using static BroadcastListener.Classes.Factory;
namespace OnDoc.UIControls
{
public partial class Serienbrief : SfForm
public partial class Serienbrief : SfForm, IMessageListener1
{
//private int dokumenttypnr = 0;
private int officevorlagenr = 0;
@@ -48,7 +52,7 @@ namespace OnDoc.UIControls
private int serienbriefnr = 0;
private DOCGEN.DocGen dg = null;
private DOCGEN.DocGet dget = null;
SerienbriefBearbeitung sbedit;
//private DataSet dsempfaenger = new DataSet();
private int selectedsbnr = 0;
public Serienbrief()
@@ -56,6 +60,8 @@ namespace OnDoc.UIControls
InitializeComponent();
this.Style.TitleBar.BackColor = Theaming.Titelbar();
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
Broadcaster().AddListener(this);
Closing += Form_Closing;
}
public Serienbrief(int profilnr)
@@ -64,15 +70,53 @@ namespace OnDoc.UIControls
this.Style.TitleBar.BackColor = Theaming.Titelbar();
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
this.profilnr = profilnr;
Broadcaster().AddListener(this);
Closing += Form_Closing;
}
private void Serienbrief_Load(object sender, EventArgs e)
{
Refresh_Lists();
Refresh_Team();
//Broadcaster().AddListener(this);
//Closing += Form_Closing;
}
private void Form_Closing(object sender, CancelEventArgs e)
{
Broadcaster().RemoveListener(this);
}
private bool IsPreview = false;
private string PreviewFiename = "";
public void OnListen(string message, SenderInfo sender)
{
if (message == "BtnSBVorschau")
{
if (sender.SenderName=="Serienbriefbearbeitung")
{
string[] details = sender.Function.Split(' ');
foreach (System.Data.DataRow dr in sb.dsempfaenger.Tables[0].Rows)
{
if (dr[0].ToString() == details[0].ToString())
{
IsPreview = true;
PreviewFiename = sender.Details.ToString()+".tmp";
ribbonbuttonsave_Click(sender, null);
Generate(Convert.ToInt32(dr["intEintragnr"]));
System.IO.File.Delete(PreviewFiename);
PreviewFiename = "";
IsPreview = false;
}
}
}
}
if (message== "BtnSBVorschauSave")
{
ribbonbuttonsave_Click(sender, null);
}
}
private void enable_disable_functions(int type, bool enabled)
{
if (type == 1)
@@ -226,6 +270,27 @@ namespace OnDoc.UIControls
}
DB dB = new DB(AppParams.connectionstring);
//sb.dsempfaenger.Tables[0].Rows.Clear();
foreach (System.Data.DataColumn dc in importdata.Columns)
{
bool found = false;
foreach (System.Data.DataColumn edc in sb.dsempfaenger.Tables[0].Columns)
{
if (edc.ColumnName == dc.ColumnName) { found = true; break; }
}
if (!found)
{
try
{
sb.dsempfaenger.Tables[0].Columns.Add("$$" + dc.ColumnName + "$$");
dc.ColumnName = "$$" + dc.ColumnName + "$$";
}
catch { }
}
}
importdata.AcceptChanges();
sfDataGridEmpfaenger.DataSource = null;
foreach (System.Data.DataRow dr in importdata.Rows)
{
@@ -269,15 +334,20 @@ namespace OnDoc.UIControls
}
private void refresh_spalten()
{
//sfDataGridEmpfaenger.Columns["STATUS"].Visible = false;
//sfDataGridEmpfaenger.Columns["FEHLERCODE"].Visible = false;
//sfDataGridEmpfaenger.Columns["BLKUNDE"].Visible = false;
//sfDataGridEmpfaenger.Columns["DOKUMENT_GEDRUCKT"].Visible = false;
//sfDataGridEmpfaenger.Columns["DOKUMENTID"].Visible = false;
//sfDataGridEmpfaenger.Columns["DOKUMENTIDBDR"].Visible = false;
//sfDataGridEmpfaenger.Columns["ERSTELLER"].Visible = false;
//sfDataGridEmpfaenger.Columns["DRUCKJOBID"].Visible = false;
//sfDataGridEmpfaenger.Columns["AKTIV"].Visible = false;
try
{
sfDataGridEmpfaenger.Columns["IntEintragnr"].Visible = false;
}
catch { }
sfDataGridEmpfaenger.Columns["STATUS"].Visible = false;
sfDataGridEmpfaenger.Columns["FEHLERCODE"].Visible = false;
sfDataGridEmpfaenger.Columns["BLKUNDE"].Visible = false;
sfDataGridEmpfaenger.Columns["DOKUMENT_GEDRUCKT"].Visible = false;
sfDataGridEmpfaenger.Columns["DOKUMENTID"].Visible = false;
sfDataGridEmpfaenger.Columns["DOKUMENTIDBDR"].Visible = false;
sfDataGridEmpfaenger.Columns["ERSTELLER"].Visible = false;
sfDataGridEmpfaenger.Columns["DRUCKJOBID"].Visible = false;
sfDataGridEmpfaenger.Columns["AKTIV"].Visible = false;
sfDataGridEmpfaenger.Columns["Zustelladresse"].Visible = false;
sfDataGridEmpfaenger.Columns["Briefanrede1"].Visible = false;
sfDataGridEmpfaenger.Columns["Briefanrede2"].Visible = false;
@@ -287,8 +357,7 @@ namespace OnDoc.UIControls
sfDataGridEmpfaenger.Columns["Strasse"].Visible = false;
sfDataGridEmpfaenger.Columns["PLZ"].Visible = false;
sfDataGridEmpfaenger.Columns["Ort"].Visible = false;
sfDataGridEmpfaenger.AutoSizeColumnsMode = Syncfusion.WinForms.DataGrid.Enums.AutoSizeColumnsMode.AllCells;
}
private void init_empfaenger(int serienbriefnr)
{
@@ -488,13 +557,18 @@ namespace OnDoc.UIControls
{
sb.faksimile_unterschrfit = "False";
}
}catch { sb.faksimile_unterschrfit = "False"; }
} catch { sb.faksimile_unterschrfit = "False"; }
try { sb.team = Convert.ToInt32(cbboxteam.SelectedValue.ToString()); } catch { sb.team = 0; }
sb.archivdatum = Convert.ToDateTime(DateDokumentDatum.Value);
sb.dokumentdatum = Convert.ToDateTime(DateDokumentDatum.Value);
if (rbppa.Checked) { sb.ppfaktura = 1; }
if (rbbpb.Checked) { sb.ppfaktura = 2; }
if (rbppohne.Checked) { sb.ppfaktura = 0; }
DB db = new DB(AppParams.connectionstring);
sb.serienbriefnr = db.Save_Serienbrief(sb, AppParams.tempdir);
db.save_sb_vorlage_to_db(sb.filename, "", sb.serienbriefnr);
//sb.dsempfaenger.WriteXml(@"x:\test.xml");
if (!IsPreview) { db.save_sb_vorlage_to_db(sb.filename, "", sb.serienbriefnr); }
else { db.save_sb_vorlage_to_db(PreviewFiename, "", sb.serienbriefnr); }
}
@@ -641,6 +715,12 @@ namespace OnDoc.UIControls
cbboxunterschriftrechts.SelectedValue = sb.unterschriftrechts;
cbboxverantwortlich.SelectedValue = sb.verantwortlich;
DateDokumentDatum.Value = sb.archivdatum;
switch (sb.ppfaktura)
{
case 0:rbppohne.Checked = true;break;
case 1: rbppa.Checked = true;break;
case 2:rbbpb.Checked = true;break;
}
if (sb.zustaendig == -1)
{
rbzustaendigkube.Checked = true; rbzustaendigmitarbeiter.Checked = false;
@@ -680,8 +760,15 @@ namespace OnDoc.UIControls
private void ribbonButton1_Click(object sender, EventArgs e)
{
SerienbriefBearbeitung sbedit = new SerienbriefBearbeitung(this.sb);
try
{
sbedit.Dispose();
}
catch { }
sbedit = new SerienbriefBearbeitung(this.sb);
sbedit.Show();
this.sb = sbedit.sb;
update_serienbriefdaten(false);
@@ -845,6 +932,12 @@ namespace OnDoc.UIControls
private void RibbonButtonGenerateSB_Click(object sender, EventArgs e)
{
ribbonbuttonsave_Click(sender, e);
Generate();
}
private void Generate(int vorschauid = 0)
{
ToastMessage.ShowToast("Speichern", "Serienbriefdaten wurden gespeichert");
vorlagendaten = null;
vorlagendaten = new System.Data.DataTable();
@@ -852,10 +945,34 @@ namespace OnDoc.UIControls
dg = new DOCGEN.DocGen();
dget = new DOCGEN.DocGet(AppParams.connectionstring);
DB dB = new DB(AppParams.connectionstring);
if (IsPreview)
{
Helper.FileHelper fh = new FileHelper();
sb.VorlageBase64 = fh.Base64FromFile(PreviewFiename);
} else {
string fn = dB.get_sb_vorlage(sb.serienbriefnr, AppParams.tempdir);
sb.VorlageBase64 = dB.dsdaten.Tables[0].Rows[0][0].ToString();
sb.VorlageBase64 = dB.dsdaten.Tables[0].Rows[0][0].ToString(); }
sb.DocValues = new List<clsDocValue>();
vorlagendaten_aufbereiten();
APIHelper imghelper = new APIHelper(AppParams.RESTURI, AppParams.apikey);
if (sb.faksimile_unterschrfit == "True")
{
sb.img_unterschriftlinks = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(imghelper.get_unterschrift(sb.unterschriftlinks.ToString()));
sb.img_unterschrfitrechts = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(imghelper.get_unterschrift(sb.unterschriftrechts.ToString()));
}
if (sb.ppfaktura == 1)
{
sb.img_faktura = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(imghelper.get_image(1, -1, 0));
}
if (sb.ppfaktura == 2)
{
sb.img_faktura = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(imghelper.get_image(2, -1, 0));
}
imghelper = null;
vorlagendaten_aufbereiten(vorschauid);
update_serienbriefdaten(false);
update_zahlen();
treeViewAdv1.SelectedNode = treeViewAdv1.Nodes[2];
@@ -863,235 +980,251 @@ namespace OnDoc.UIControls
}
private void vorlagendaten_aufbereiten()
private void vorlagendaten_aufbereiten(int vorschauid = 0)
{
init_progressbar("Dokumente generieren", vorlagendaten.Rows.Count);
for (int i = 0, loopTo = vorlagendaten.Rows.Count - 1; i <= loopTo; i++)
{
add_progress();
System.Windows.Forms.Application.DoEvents();
string sp1 = "";
string[] sp2;
string feldnr;
for (int i1 = 0, loopTo1 = vorlagendaten.Columns.Count - 1; i1 <= loopTo1; i1++)
if (vorschauid == 0 || Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]) == vorschauid)
{
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"];
}
add_progress();
System.Windows.Forms.Application.DoEvents();
break;
}
case "F_09_89":
{
if (vorlagendaten.Rows[i]["Name"] != "")
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":
{
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")
if (vorlagendaten.Rows[i]["Zustelladresse"] != "")
{
s = "r " + s;
}
else
{
s = " " + s;
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Zustelladresse"];
}
break;
}
if (vorlagendaten.Rows[i]["Briefanrede2"] != "")
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))
s = s + Environment.NewLine;
s1 = vorlagendaten.Rows[i]["Briefanrede2"].ToString();
if (s.Substring(0, 4) == "Herr")
{
s = s + "Sehr geehrter " + s1;
vorlagendaten.Rows[i][i1] = s;
}
else
break;
}
case "F_09_98":
{
if (vorlagendaten.Rows[i]["Strasse"] != "")
{
s = s + "Sehr geehrte " + s1;
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Strasse"];
}
break;
}
if (!string.IsNullOrEmpty(s))
case "F_09_93":
{
vorlagendaten.Rows[i][i1] = s;
}
if (vorlagendaten.Rows[i]["Ort"] != "")
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"];
}
break;
}
case "F_09_98":
{
if (vorlagendaten.Rows[i]["Strasse"] != "")
break;
}
case var @case when @case == "F_09_93":
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Strasse"];
}
if (vorlagendaten.Rows[i]["Ort"] != "")
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"];
}
break;
}
case "F_09_93":
{
if (vorlagendaten.Rows[i]["Ort"] != "")
break;
}
case "F_09_96":
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"];
}
if (vorlagendaten.Rows[i]["PLZ"] != "")
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["PLZ"];
}
break;
}
case var @case when @case == "F_09_93":
{
if (vorlagendaten.Rows[i]["Ort"] != "")
break;
}
case "F_09_132":
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["Ort"];
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;
}
break;
}
case "F_09_96":
{
if (vorlagendaten.Rows[i]["PLZ"] != "")
default:
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i]["PLZ"];
break;
}
}
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++)
// Verknüpfte Felder
try
{
if (feldnr == sb.dsempfaenger.Tables["verkfelder"].Rows[i2]["Vorlagenfeldnr"].ToString())
int i2;
var loopTo2 = sb.dsempfaenger.Tables["VerkFelder"].Rows.Count - 1;
for (i2 = 0; i2 <= loopTo2; i2++)
{
vorlagendaten.Rows[i][i1] = vorlagendaten.Rows[i][sb.dsempfaenger.Tables["verkfelder"].Rows[i2]["IDVWert"].ToString()];
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_")
catch
{
Insert_Value(vorlagendaten.Rows[i][i1].ToString(), vorlagendaten.Columns[i1].ColumnName);
}
}
catch { }
try
{
if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 5) == "I_09_")
if (object.ReferenceEquals(vorlagendaten.Rows[i][i1], DBNull.Value))
{
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);
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 { }
try
{
if (vorlagendaten.Columns[i1].ColumnName.ToString().Substring(0, 2) == "$$")
{
Insert_Value(vorlagendaten.Rows[i][i1].ToString(), vorlagendaten.Columns[i1].ColumnName);
}
}
catch { }
}
catch { }
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();
string dokumentid = "";
if (dr != null)
{
dokumentid = dr["dokumentid"].ToString();
}
if (dokumentid == "") { dokumentid = db.get_dbkey("Dokument"); }
string filename = dokumentid + ".pdf";
if (vorschauid != 0 && Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]) == vorschauid)
{
string pdfdoc_preview = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb, dokumentid, AppParams.RESTURI, AppParams.apikey));
sbedit.Update_Preview(pdfdoc_preview);
}
else
{
string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb, dokumentid, AppParams.RESTURI, AppParams.apikey));
fh.SaveBase64ToFile(pdfdoc, AppParams.tempdir + filename);
db.save_serienbrief_datei(sb.serienbriefnr, Convert.ToInt32(vorlagendaten.Rows[i]["IntEintragnr"]), AppParams.tempdir + filename, dokumentid);
System.IO.File.Delete(AppParams.tempdir + filename);
}
db = null;
if (dr != null && vorschauid == 0)
{
dr["STATUS"] = "1";
dr["Dokumentid"] = dokumentid;
}
sb.DocValues.Clear();
}
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();
string dokumentid = "";
if (dr != null)
{
dokumentid = dr["dokumentid"].ToString();
}
if (dokumentid == "") { dokumentid = db.get_dbkey("Dokument"); }
string filename = dokumentid + ".pdf";
string pdfdoc = dget.Convert_Word_To_PDF(dg.generate_serienbrief(sb.VorlageBase64, sb, dokumentid, AppParams.RESTURI, AppParams.apikey));
//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);
System.IO.File.Delete(AppParams.tempdir + filename);
db = null;
if (dr != null)
{
dr["STATUS"] = "1";
dr["Dokumentid"] = dokumentid;
}
sb.DocValues.Clear();
}
finish_progress();
@@ -1177,6 +1310,7 @@ namespace OnDoc.UIControls
}
clsDocValue dv = new clsDocValue();
dv.TMBeginn = beginntextmarke; ;
dv.TMEnd = endetextmarke;
dv.Value = feldwert;

View File

@@ -31,87 +31,155 @@
this.components = new System.ComponentModel.Container();
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.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.sfdatagridstandard = new Syncfusion.WinForms.DataGrid.SfDataGrid();
this.contextMenuStandard = new System.Windows.Forms.ContextMenuStrip(this.components);
this.platzhalterImDokumentEinfügenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
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.label3 = 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.contextMenuStandard = new System.Windows.Forms.ContextMenuStrip(this.components);
this.platzhalterImDokumentEinfügenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.label4 = new System.Windows.Forms.Label();
this.txtfilter = new System.Windows.Forms.TextBox();
this.tscomboboxbp = new System.Windows.Forms.ToolStripComboBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.docPreview1 = new OnDoc.UIControls.DocPreview();
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();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridDokspezifisch)).BeginInit();
this.contextMenuIDV.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sfdatagridUsed)).BeginInit();
this.contextMenuUsed.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.toolStripButton1,
this.tscomboboxbp,
this.toolStripButton2,
this.toolStripButton3});
this.toolStrip1.Location = new System.Drawing.Point(2, 2);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(382, 25);
this.toolStrip1.Size = new System.Drawing.Size(375, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// groupBox1
// toolStripButton1
//
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.sfdatagridUsed);
this.groupBox1.Controls.Add(this.sfdatagridDokspezifisch);
this.groupBox1.Controls.Add(this.sfdatagridstandard);
this.groupBox1.Location = new System.Drawing.Point(5, 30);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(379, 435);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = global::OnDoc.Properties.Resources.save_24x24_32;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "Speichern und schliessen";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// label3
// toolStripButton2
//
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.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton2.Image = global::OnDoc.Properties.Resources.Preview_Rechts_24x24_32;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
this.toolStripButton2.Text = "Vorschau";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// sfdatagridstandard
//
this.sfdatagridstandard.AccessibleName = "Table";
this.sfdatagridstandard.AllowFiltering = true;
this.sfdatagridstandard.ContextMenuStrip = this.contextMenuStandard;
this.sfdatagridstandard.Location = new System.Drawing.Point(3, 39);
this.sfdatagridstandard.Name = "sfdatagridstandard";
this.sfdatagridstandard.Size = new System.Drawing.Size(373, 481);
this.sfdatagridstandard.TabIndex = 0;
this.sfdatagridstandard.Text = "sfDataGrid1";
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, 26);
//
// platzhalterImDokumentEinfügenToolStripMenuItem
//
this.platzhalterImDokumentEinfügenToolStripMenuItem.Name = "platzhalterImDokumentEinfügenToolStripMenuItem";
this.platzhalterImDokumentEinfügenToolStripMenuItem.Size = new System.Drawing.Size(255, 22);
this.platzhalterImDokumentEinfügenToolStripMenuItem.Text = "Platzhalter im Dokument einfügen";
this.platzhalterImDokumentEinfügenToolStripMenuItem.Click += new System.EventHandler(this.platzhalterImDokumentEinfügenToolStripMenuItem_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(7, 119);
this.label2.Location = new System.Drawing.Point(6, 526);
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";
this.label2.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 16);
this.label1.Location = new System.Drawing.Point(6, 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";
//
// sfdatagridDokspezifisch
//
this.sfdatagridDokspezifisch.AccessibleName = "Table";
this.sfdatagridDokspezifisch.ContextMenuStrip = this.contextMenuIDV;
this.sfdatagridDokspezifisch.Location = new System.Drawing.Point(3, 542);
this.sfdatagridDokspezifisch.Name = "sfdatagridDokspezifisch";
this.sfdatagridDokspezifisch.Size = new System.Drawing.Size(367, 101);
this.sfdatagridDokspezifisch.TabIndex = 1;
this.sfdatagridDokspezifisch.Text = "sfDataGrid1";
this.sfdatagridDokspezifisch.Visible = false;
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);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 526);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Verwendete Werte";
//
// sfdatagridUsed
//
this.sfdatagridUsed.AccessibleName = "Table";
this.sfdatagridUsed.ContextMenuStrip = this.contextMenuUsed;
this.sfdatagridUsed.Location = new System.Drawing.Point(6, 263);
this.sfdatagridUsed.Location = new System.Drawing.Point(3, 542);
this.sfdatagridUsed.Name = "sfdatagridUsed";
this.sfdatagridUsed.Size = new System.Drawing.Size(367, 166);
this.sfdatagridUsed.TabIndex = 2;
@@ -138,72 +206,72 @@
this.platzhalterLöschenToolStripMenuItem.Size = new System.Drawing.Size(257, 22);
this.platzhalterLöschenToolStripMenuItem.Text = "Platzhalter löschen";
//
// sfdatagridDokspezifisch
// label4
//
this.sfdatagridDokspezifisch.AccessibleName = "Table";
this.sfdatagridDokspezifisch.ContextMenuStrip = this.contextMenuIDV;
this.sfdatagridDokspezifisch.Location = new System.Drawing.Point(6, 135);
this.sfdatagridDokspezifisch.Name = "sfdatagridDokspezifisch";
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);
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(149, 16);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Suche:";
//
// contextMenuIDV
// txtfilter
//
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);
this.txtfilter.Location = new System.Drawing.Point(196, 13);
this.txtfilter.Name = "txtfilter";
this.txtfilter.Size = new System.Drawing.Size(150, 20);
this.txtfilter.TabIndex = 7;
this.txtfilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtfilter_KeyDown);
//
// platzhalterImDokumentEinfügenToolStripMenuItem1
// tscomboboxbp
//
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);
this.tscomboboxbp.Name = "tscomboboxbp";
this.tscomboboxbp.Size = new System.Drawing.Size(121, 25);
//
// sfdatagridstandard
// groupBox2
//
this.sfdatagridstandard.AccessibleName = "Table";
this.sfdatagridstandard.ContextMenuStrip = this.contextMenuStandard;
this.sfdatagridstandard.Location = new System.Drawing.Point(6, 32);
this.sfdatagridstandard.Name = "sfdatagridstandard";
this.sfdatagridstandard.Size = new System.Drawing.Size(367, 84);
this.sfdatagridstandard.TabIndex = 0;
this.sfdatagridstandard.Text = "sfDataGrid1";
this.sfdatagridstandard.CellClick += new Syncfusion.WinForms.DataGrid.Events.CellClickEventHandler(this.sfdatagridstandard_CellClick);
this.groupBox2.Controls.Add(this.sfdatagridstandard);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.txtfilter);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.sfdatagridUsed);
this.groupBox2.Controls.Add(this.sfdatagridDokspezifisch);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Left;
this.groupBox2.Location = new System.Drawing.Point(2, 27);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(387, 718);
this.groupBox2.TabIndex = 9;
this.groupBox2.TabStop = false;
//
// contextMenuStandard
// toolStripButton3
//
this.contextMenuStandard.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.platzhalterImDokumentEinfügenToolStripMenuItem});
this.contextMenuStandard.Name = "contextMenuStandard";
this.contextMenuStandard.Size = new System.Drawing.Size(256, 26);
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton3.Image = global::OnDoc.Properties.Resources.Preview_Now_24x24_32;
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
this.toolStripButton3.Text = "toolStripButton3";
this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
//
// platzhalterImDokumentEinfügenToolStripMenuItem
// docPreview1
//
this.platzhalterImDokumentEinfügenToolStripMenuItem.Name = "platzhalterImDokumentEinfügenToolStripMenuItem";
this.platzhalterImDokumentEinfügenToolStripMenuItem.Size = new System.Drawing.Size(255, 22);
this.platzhalterImDokumentEinfügenToolStripMenuItem.Text = "Platzhalter im Dokument einfügen";
this.platzhalterImDokumentEinfügenToolStripMenuItem.Click += new System.EventHandler(this.platzhalterImDokumentEinfügenToolStripMenuItem_Click);
//
// toolStripButton1
//
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);
this.docPreview1.Dock = System.Windows.Forms.DockStyle.Fill;
this.docPreview1.Location = new System.Drawing.Point(389, 27);
this.docPreview1.Name = "docPreview1";
this.docPreview1.Size = new System.Drawing.Size(0, 718);
this.docPreview1.TabIndex = 8;
this.docPreview1.Visible = false;
this.docPreview1.ZoomPercentage = 0;
//
// SerienbriefBearbeitung
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(386, 478);
this.Controls.Add(this.groupBox1);
this.ClientSize = new System.Drawing.Size(379, 747);
this.Controls.Add(this.docPreview1);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.toolStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SerienbriefBearbeitung";
@@ -213,14 +281,14 @@
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);
((System.ComponentModel.ISupportInitialize)(this.sfdatagridDokspezifisch)).EndInit();
this.contextMenuIDV.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.sfdatagridUsed)).EndInit();
this.contextMenuUsed.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -229,7 +297,6 @@
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.GroupBox groupBox1;
private Syncfusion.WinForms.DataGrid.SfDataGrid sfdatagridUsed;
private Syncfusion.WinForms.DataGrid.SfDataGrid sfdatagridDokspezifisch;
private Syncfusion.WinForms.DataGrid.SfDataGrid sfdatagridstandard;
@@ -244,5 +311,12 @@
private System.Windows.Forms.ToolStripMenuItem cursorImDokumentPositionierenToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem platzhalterLöschenToolStripMenuItem;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtfilter;
private System.Windows.Forms.ToolStripComboBox tscomboboxbp;
private UIControls.DocPreview docPreview1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ToolStripButton toolStripButton3;
}
}

View File

@@ -9,6 +9,8 @@ using System.Security.RightsManagement;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BroadcastListener.Classes;
using System.Xml;
using Model;
using OnDoc.Helper;
using OnDoc.Klassen;
@@ -20,6 +22,9 @@ using Syncfusion.WinForms.DataGrid.Interactivity;
using Windows.Devices.HumanInterfaceDevice;
using Windows.Media.Ocr;
using Windows.UI.Xaml.Controls;
using BroadcastListener.Classes;
using BroadcastListener.Interfaces;
using static BroadcastListener.Classes.Factory;
namespace OnDoc.DocMgmt
{
@@ -48,6 +53,10 @@ namespace OnDoc.DocMgmt
this.sb = sb;
}
public void Update_Preview(string document)
{
this.docPreview1.Show_Doc(document);
}
private DataTable get_idvwerte()
{
int i;
@@ -97,6 +106,14 @@ namespace OnDoc.DocMgmt
}
return dt;
}
private void format_standardgrid()
{
sfdatagridstandard.RowHeight = 17;
sfdatagridstandard.Columns[0].Width = sfdatagridstandard.Width * 0.1;
sfdatagridstandard.Columns[1].Width = sfdatagridstandard.Width * 0.85;
}
private void SerienbriefBearbeitung_Load(object sender, EventArgs e)
{
StdFelder = get_vorlagenfelder(sb.dokumenttypnr, 0);
@@ -107,8 +124,12 @@ namespace OnDoc.DocMgmt
dr[1] = dr[1].ToString().Replace(System.Environment.NewLine, " ");
}
StdFelder.AcceptChanges();
sfdatagridstandard.RowHeight = 17;
sfdatagridstandard.DataSource = StdFelder;
foreach (System.Data.DataRow dr in sb.dsempfaenger.Tables[0].Rows)
{
tscomboboxbp.Items.Add(dr[0].ToString() + " " + dr[1].ToString());
}
format_standardgrid();
IDVFelder = get_idvwerte();
@@ -159,6 +180,7 @@ namespace OnDoc.DocMgmt
private void get_usedfelder(ref System.Data.DataTable list)
{
list = get_vorlagenfelder(sb.dokumenttypnr, 1);
if (sb.dsempfaenger.Tables["UsedFelder"].Rows.Count>0) list = sb.dsempfaenger.Tables["UsedFelder"].Copy();
int i;
string s;
bool dodelete = false;
@@ -190,7 +212,12 @@ namespace OnDoc.DocMgmt
{
try
{
if (row["Beginntextmarke"].ToString() == "TMSB_0")
{
string A = "";
}
s = word.ActiveDocument.Bookmarks[row["beginntextmarke"].ToString()].Name.ToString();
}
catch
{
@@ -357,10 +384,14 @@ namespace OnDoc.DocMgmt
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();
try
{
var selectedItem = e.DataRow;
var dataRow = (e.DataRow.RowData as DataRowView).Row;
regelnr = Convert.ToInt32(dataRow[0].ToString());
regelbez = dataRow[1].ToString();
}
catch { }
}
private void sfdatagridDokspezifisch_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
@@ -382,7 +413,59 @@ namespace OnDoc.DocMgmt
}
sb.dsempfaenger.Tables["UsedFelder"].AcceptChanges();
Broadcaster().Broadcast("BtnSBVorschauSave", new SenderInfo("Speichern", "Speichern",""));
this.Close();
}
private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
{
}
private void txtfilter_KeyDown(object sender, KeyEventArgs e)
{
DataView dv = new DataView(StdFelder);
try
{
dv.RowFilter = "Bezeichnung like '%" + txtfilter.Text.ToString() + "%'";
}
catch { dv.RowFilter = "Bezeichnung like '%'"; }
sfdatagridstandard.DataSource = null;
sfdatagridstandard.DataSource = dv;
format_standardgrid();
}
private void toolStripButton2_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();
string FileName = word.ActiveDocument.FullName;
word.ActiveDocument.Save();
word.ActiveDocument.SaveAs2(word.ActiveDocument.FullName + ".tmp");
word.ActiveDocument.Close();
word.Documents.Open(FileName);
this.docPreview1.Visible = true;
this.Width = groupBox2.Width * 3;
Broadcaster().Broadcast("BtnSBVorschau", new SenderInfo("Serienbriefbearbeitung", tscomboboxbp.Text, FileName));
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
docPreview1.Visible = false;
this.Width = groupBox2.Width + 10;
return;
}
}
}

View File

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