From eaf8945687820babd346e6b39cd28849a214071b Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Tue, 24 Mar 2026 13:41:36 +0100 Subject: [PATCH 1/2] vermerke --- Aviso/Aviso.vbproj | 13 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 375 ++++-- Aviso/frmAddSendungsvermerkShort.vb | 526 ++++---- ...frmSendungsDokumentanforderung.Designer.vb | 440 ++++++ Aviso/frmSendungsDokumentanforderung.resx | 61 + Aviso/frmSendungsDokumentanforderung.vb | 1198 +++++++++++++++++ 7 files changed, 2232 insertions(+), 385 deletions(-) create mode 100644 Aviso/frmSendungsDokumentanforderung.Designer.vb create mode 100644 Aviso/frmSendungsDokumentanforderung.resx create mode 100644 Aviso/frmSendungsDokumentanforderung.vb diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 05ab612..0a46de0 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -1,4 +1,4 @@ - + @@ -755,6 +755,12 @@ Form + + frmSendungsDokumentanforderung.vb + + + Form + frmAnkunftAendern.vb @@ -1419,6 +1425,9 @@ frmAddSendungsvermerkShort.vb + + frmSendungsDokumentanforderung.vb + frmAnkunftAendern.vb @@ -2124,4 +2133,4 @@ --> - \ No newline at end of file + diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index ae9a434..e8298a3 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmAddSendungsvermerkShort.Designer.vb b/Aviso/frmAddSendungsvermerkShort.Designer.vb index ee37b78..3dfc1f0 100644 --- a/Aviso/frmAddSendungsvermerkShort.Designer.vb +++ b/Aviso/frmAddSendungsvermerkShort.Designer.vb @@ -27,16 +27,30 @@ Partial Class frmAddSendungsvermerkShort Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.pnlMain = New System.Windows.Forms.Panel() Me.pnlSendungsVermker = New System.Windows.Forms.Panel() + Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.pnlDocumentEditor = New System.Windows.Forms.Panel() + Me.flpDocumentTabs = New System.Windows.Forms.FlowLayoutPanel() + Me.lblDocumentEditorTitle = New System.Windows.Forms.Label() + Me.lblDocumentEditorName = New System.Windows.Forms.Label() + Me.txtDocumentEditorName = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorAnhangsart = New System.Windows.Forms.Label() + Me.cmbDocumentEditorAnhangsart = New System.Windows.Forms.ComboBox() + Me.lblDocumentEditorInfo = New System.Windows.Forms.Label() + Me.txtDocumentEditorInfo = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorStatus = New System.Windows.Forms.Label() + Me.flpDokumenteFehlenMain = New System.Windows.Forms.FlowLayoutPanel() + Me.lblSonstigeVermerke = New System.Windows.Forms.Label() + Me.flpAngefordert = New System.Windows.Forms.FlowLayoutPanel() Me.Label5 = New System.Windows.Forms.Label() Me.txtSonstigesDokumentFehlt = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.optFremd_ATB = New System.Windows.Forms.CheckBox() Me.optFremd_SendungAvisiert = New System.Windows.Forms.CheckBox() Me.lblErrSpedition = New System.Windows.Forms.Label() + Me.lblDragIndicator = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.lblErrGrund = New System.Windows.Forms.Label() Me.btnCLose = New System.Windows.Forms.Button() - Me.lblErrDokument = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.txtSpedition = New System.Windows.Forms.TextBox() Me.optSendungInVorbereitung = New System.Windows.Forms.CheckBox() @@ -56,24 +70,25 @@ Partial Class frmAddSendungsvermerkShort Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() - Me.pnlCustomerUploadSeparator = New System.Windows.Forms.Panel() Me.lblZustzlFreitext = New System.Windows.Forms.Label() Me.txtSendungSpedition = New System.Windows.Forms.TextBox() Me.cbxNichtLeserlich = New System.Windows.Forms.CheckBox() Me.btnOK = New System.Windows.Forms.Button() + Me.btnDokumtanforderung = New System.Windows.Forms.Button() Me.cbxSonstDok = New System.Windows.Forms.CheckBox() Me.Label9 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.Label13 = New System.Windows.Forms.Label() Me.txtFreierText = New System.Windows.Forms.TextBox() Me.Label20 = New System.Windows.Forms.Label() - Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.PictureBox4 = New System.Windows.Forms.PictureBox() + Me.lblErrDokument = New System.Windows.Forms.Label() Me.Panel4 = New System.Windows.Forms.Panel() Me.pnlMain.SuspendLayout() Me.pnlSendungsVermker.SuspendLayout() - CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.pnlDocumentEditor.SuspendLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' @@ -89,23 +104,28 @@ Partial Class frmAddSendungsvermerkShort Me.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlMain.Location = New System.Drawing.Point(0, 0) Me.pnlMain.Name = "pnlMain" - Me.pnlMain.Size = New System.Drawing.Size(474, 868) + Me.pnlMain.Size = New System.Drawing.Size(474, 790) Me.pnlMain.TabIndex = 0 ' 'pnlSendungsVermker ' Me.pnlSendungsVermker.BackColor = System.Drawing.Color.White Me.pnlSendungsVermker.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) + Me.pnlSendungsVermker.Controls.Add(Me.pnlDocumentEditor) + Me.pnlSendungsVermker.Controls.Add(Me.flpDokumenteFehlenMain) + Me.pnlSendungsVermker.Controls.Add(Me.lblSonstigeVermerke) + Me.pnlSendungsVermker.Controls.Add(Me.flpAngefordert) Me.pnlSendungsVermker.Controls.Add(Me.Label5) Me.pnlSendungsVermker.Controls.Add(Me.txtSonstigesDokumentFehlt) Me.pnlSendungsVermker.Controls.Add(Me.Label4) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_ATB) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_SendungAvisiert) Me.pnlSendungsVermker.Controls.Add(Me.lblErrSpedition) + Me.pnlSendungsVermker.Controls.Add(Me.lblDragIndicator) Me.pnlSendungsVermker.Controls.Add(Me.Label2) Me.pnlSendungsVermker.Controls.Add(Me.lblErrGrund) Me.pnlSendungsVermker.Controls.Add(Me.btnCLose) - Me.pnlSendungsVermker.Controls.Add(Me.lblErrDokument) Me.pnlSendungsVermker.Controls.Add(Me.Label1) Me.pnlSendungsVermker.Controls.Add(Me.txtSpedition) Me.pnlSendungsVermker.Controls.Add(Me.optSendungInVorbereitung) @@ -125,31 +145,177 @@ Partial Class frmAddSendungsvermerkShort Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadLanguage) Me.pnlSendungsVermker.Controls.Add(Me.txtCustomerUploadEmailText) Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadEmailText) - Me.pnlSendungsVermker.Controls.Add(Me.pnlCustomerUploadSeparator) Me.pnlSendungsVermker.Controls.Add(Me.lblZustzlFreitext) Me.pnlSendungsVermker.Controls.Add(Me.txtSendungSpedition) Me.pnlSendungsVermker.Controls.Add(Me.cbxNichtLeserlich) Me.pnlSendungsVermker.Controls.Add(Me.btnOK) + Me.pnlSendungsVermker.Controls.Add(Me.btnDokumtanforderung) Me.pnlSendungsVermker.Controls.Add(Me.cbxSonstDok) Me.pnlSendungsVermker.Controls.Add(Me.Label9) Me.pnlSendungsVermker.Controls.Add(Me.Label17) Me.pnlSendungsVermker.Controls.Add(Me.Label13) Me.pnlSendungsVermker.Controls.Add(Me.txtFreierText) Me.pnlSendungsVermker.Controls.Add(Me.Label20) - Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) Me.pnlSendungsVermker.Controls.Add(Me.PictureBox4) + Me.pnlSendungsVermker.Controls.Add(Me.lblErrDokument) Me.pnlSendungsVermker.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlSendungsVermker.Location = New System.Drawing.Point(0, 0) Me.pnlSendungsVermker.Name = "pnlSendungsVermker" - Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 868) + Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 750) Me.pnlSendungsVermker.TabIndex = 0 ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke + Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.PictureBox1.Location = New System.Drawing.Point(0, 391) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(474, 1) + Me.PictureBox1.TabIndex = 124 + Me.PictureBox1.TabStop = False + ' + 'pnlDocumentEditor + ' + Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke + Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 135) + Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.TabIndex = 123 + ' + 'flpDocumentTabs + ' + Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDocumentTabs.AutoScroll = True + Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) + Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) + Me.flpDocumentTabs.Name = "flpDocumentTabs" + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) + Me.flpDocumentTabs.TabIndex = 124 + Me.flpDocumentTabs.WrapContents = False + ' + 'lblDocumentEditorTitle + ' + Me.lblDocumentEditorTitle.AutoSize = True + Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) + Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" + Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) + Me.lblDocumentEditorTitle.TabIndex = 125 + Me.lblDocumentEditorTitle.Text = "Dokumentdetails" + ' + 'lblDocumentEditorName + ' + Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Name = "lblDocumentEditorName" + Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) + Me.lblDocumentEditorName.TabIndex = 126 + Me.lblDocumentEditorName.Text = "Dokumentname:" + ' + 'txtDocumentEditorName + ' + Me.txtDocumentEditorName.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.MaxLength = 120 + Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.TabIndex = 127 + ' + 'lblDocumentEditorAnhangsart + ' + Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" + Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) + Me.lblDocumentEditorAnhangsart.TabIndex = 128 + Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" + ' + 'cmbDocumentEditorAnhangsart + ' + Me.cmbDocumentEditorAnhangsart.BackColor = System.Drawing.Color.White + Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.TabIndex = 129 + ' + 'lblDocumentEditorInfo + ' + Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" + Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) + Me.lblDocumentEditorInfo.TabIndex = 130 + Me.lblDocumentEditorInfo.Text = "Dokument Info:" + ' + 'txtDocumentEditorInfo + ' + Me.txtDocumentEditorInfo.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.MaxLength = 500 + Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.TabIndex = 131 + Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." + ' + 'lblDocumentEditorStatus + ' + Me.lblDocumentEditorStatus.AutoSize = True + Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) + Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" + Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) + Me.lblDocumentEditorStatus.TabIndex = 119 + Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + ' + 'flpDokumenteFehlenMain + ' + Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent + Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 23) + Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) + Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.TabIndex = 120 + ' + 'lblSonstigeVermerke + ' + Me.lblSonstigeVermerke.AutoSize = True + Me.lblSonstigeVermerke.BackColor = System.Drawing.Color.White + Me.lblSonstigeVermerke.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold) + Me.lblSonstigeVermerke.Location = New System.Drawing.Point(5, 393) + Me.lblSonstigeVermerke.Name = "lblSonstigeVermerke" + Me.lblSonstigeVermerke.Size = New System.Drawing.Size(150, 17) + Me.lblSonstigeVermerke.TabIndex = 121 + Me.lblSonstigeVermerke.Text = "Sonstige Vermerke:" + ' + 'flpAngefordert + ' + Me.flpAngefordert.BackColor = System.Drawing.Color.White + Me.flpAngefordert.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpAngefordert.Location = New System.Drawing.Point(12, 414) + Me.flpAngefordert.Margin = New System.Windows.Forms.Padding(0) + Me.flpAngefordert.Name = "flpAngefordert" + Me.flpAngefordert.Size = New System.Drawing.Size(450, 131) + Me.flpAngefordert.TabIndex = 122 + ' 'Label5 ' Me.Label5.AutoSize = True - Me.Label5.BackColor = System.Drawing.Color.WhiteSmoke + Me.Label5.BackColor = System.Drawing.Color.Transparent Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(2, 642) + Me.Label5.Location = New System.Drawing.Point(6, 274) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 118 @@ -159,7 +325,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSonstigesDokumentFehlt.BackColor = System.Drawing.Color.White Me.txtSonstigesDokumentFehlt.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(96, 214) + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(94, 114) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) @@ -170,7 +336,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label4.AutoSize = True Me.Label4.BackColor = System.Drawing.Color.WhiteSmoke Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label4.Location = New System.Drawing.Point(11, 563) + Me.Label4.Location = New System.Drawing.Point(12, 625) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(125, 17) Me.Label4.TabIndex = 96 @@ -180,7 +346,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_ATB.AutoSize = True Me.optFremd_ATB.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_ATB.Location = New System.Drawing.Point(12, 610) + Me.optFremd_ATB.Location = New System.Drawing.Point(13, 660) Me.optFremd_ATB.Name = "optFremd_ATB" Me.optFremd_ATB.Size = New System.Drawing.Size(130, 17) Me.optFremd_ATB.TabIndex = 94 @@ -191,7 +357,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_SendungAvisiert.AutoSize = True Me.optFremd_SendungAvisiert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(12, 587) + Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 643) Me.optFremd_SendungAvisiert.Name = "optFremd_SendungAvisiert" Me.optFremd_SendungAvisiert.Size = New System.Drawing.Size(193, 17) Me.optFremd_SendungAvisiert.TabIndex = 93 @@ -203,19 +369,32 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrSpedition.AutoSize = True Me.lblErrSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrSpedition.ForeColor = System.Drawing.Color.Red - Me.lblErrSpedition.Location = New System.Drawing.Point(175, 468) + Me.lblErrSpedition.Location = New System.Drawing.Point(177, 551) Me.lblErrSpedition.Name = "lblErrSpedition" Me.lblErrSpedition.Size = New System.Drawing.Size(158, 13) Me.lblErrSpedition.TabIndex = 17 Me.lblErrSpedition.Text = "Bitte eine Spedition angegeben:" Me.lblErrSpedition.Visible = False ' + 'lblDragIndicator + ' + Me.lblDragIndicator.AutoSize = True + Me.lblDragIndicator.BackColor = System.Drawing.Color.Transparent + Me.lblDragIndicator.Cursor = System.Windows.Forms.Cursors.SizeAll + Me.lblDragIndicator.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDragIndicator.ForeColor = System.Drawing.Color.Gray + Me.lblDragIndicator.Location = New System.Drawing.Point(323, 3) + Me.lblDragIndicator.Name = "lblDragIndicator" + Me.lblDragIndicator.Size = New System.Drawing.Size(84, 15) + Me.lblDragIndicator.TabIndex = 132 + Me.lblDragIndicator.Text = "✥ Verschieben" + ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.BackColor = System.Drawing.Color.WhiteSmoke Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) - Me.Label2.Location = New System.Drawing.Point(175, 468) + Me.Label2.Location = New System.Drawing.Point(176, 562) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(57, 13) Me.Label2.TabIndex = 84 @@ -226,7 +405,7 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrGrund.AutoSize = True Me.lblErrGrund.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrGrund.ForeColor = System.Drawing.Color.Red - Me.lblErrGrund.Location = New System.Drawing.Point(147, 537) + Me.lblErrGrund.Location = New System.Drawing.Point(148, 614) Me.lblErrGrund.Name = "lblErrGrund" Me.lblErrGrund.Size = New System.Drawing.Size(149, 13) Me.lblErrGrund.TabIndex = 26 @@ -250,24 +429,12 @@ Partial Class frmAddSendungsvermerkShort Me.btnCLose.Text = "X" Me.btnCLose.UseVisualStyleBackColor = False ' - 'lblErrDokument - ' - Me.lblErrDokument.AutoSize = True - Me.lblErrDokument.BackColor = System.Drawing.Color.WhiteSmoke - Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(93, 233) - Me.lblErrDokument.Name = "lblErrDokument" - Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) - Me.lblErrDokument.TabIndex = 11 - Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" - Me.lblErrDokument.Visible = False - ' 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.BackColor = System.Drawing.Color.WhiteSmoke + Me.Label1.BackColor = System.Drawing.Color.Transparent Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label1.Location = New System.Drawing.Point(9, 9) + Me.Label1.Location = New System.Drawing.Point(9, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(156, 17) Me.Label1.TabIndex = 1 @@ -277,16 +444,16 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSpedition.Location = New System.Drawing.Point(177, 484) + Me.txtSpedition.Location = New System.Drawing.Point(178, 572) Me.txtSpedition.MaxLength = 50 Me.txtSpedition.Name = "txtSpedition" - Me.txtSpedition.Size = New System.Drawing.Size(125, 20) + Me.txtSpedition.Size = New System.Drawing.Size(126, 20) Me.txtSpedition.TabIndex = 20 ' 'optSendungInVorbereitung ' Me.optSendungInVorbereitung.AutoSize = True - Me.optSendungInVorbereitung.Location = New System.Drawing.Point(203, 3) + Me.optSendungInVorbereitung.Location = New System.Drawing.Point(174, 3) Me.optSendungInVorbereitung.Name = "optSendungInVorbereitung" Me.optSendungInVorbereitung.Size = New System.Drawing.Size(143, 17) Me.optSendungInVorbereitung.TabIndex = 13 @@ -298,7 +465,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optSpeditionWeitergeleitet.AutoSize = True Me.optSpeditionWeitergeleitet.BackColor = System.Drawing.Color.WhiteSmoke - Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(12, 486) + Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 572) Me.optSpeditionWeitergeleitet.Name = "optSpeditionWeitergeleitet" Me.optSpeditionWeitergeleitet.Size = New System.Drawing.Size(163, 17) Me.optSpeditionWeitergeleitet.TabIndex = 19 @@ -309,7 +476,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFreierText.AutoSize = True Me.optFreierText.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFreierText.Location = New System.Drawing.Point(12, 513) + Me.optFreierText.Location = New System.Drawing.Point(13, 589) Me.optFreierText.Name = "optFreierText" Me.optFreierText.Size = New System.Drawing.Size(105, 17) Me.optFreierText.TabIndex = 27 @@ -320,7 +487,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optATAangefordert.AutoSize = True Me.optATAangefordert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optATAangefordert.Location = New System.Drawing.Point(164, 610) + Me.optATAangefordert.Location = New System.Drawing.Point(165, 660) Me.optATAangefordert.Name = "optATAangefordert" Me.optATAangefordert.Size = New System.Drawing.Size(208, 17) Me.optATAangefordert.TabIndex = 15 @@ -331,7 +498,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.Label3.AutoSize = True Me.Label3.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label3.Location = New System.Drawing.Point(308, 487) + Me.Label3.Location = New System.Drawing.Point(309, 573) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(57, 13) Me.Label3.TabIndex = 22 @@ -341,7 +508,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.lblErr240Zeichen.AutoSize = True Me.lblErr240Zeichen.ForeColor = System.Drawing.Color.Red - Me.lblErr240Zeichen.Location = New System.Drawing.Point(212, 785) + Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 689) Me.lblErr240Zeichen.Name = "lblErr240Zeichen" Me.lblErr240Zeichen.Size = New System.Drawing.Size(95, 13) Me.lblErr240Zeichen.TabIndex = 32 @@ -353,12 +520,12 @@ Partial Class frmAddSendungsvermerkShort Me.txtDetail.AcceptsReturn = True Me.txtDetail.BackColor = System.Drawing.Color.White Me.txtDetail.ForeColor = System.Drawing.SystemColors.InfoText - Me.txtDetail.Location = New System.Drawing.Point(5, 801) + Me.txtDetail.Location = New System.Drawing.Point(17, 705) Me.txtDetail.MaxLength = 240 Me.txtDetail.Multiline = True Me.txtDetail.Name = "txtDetail" Me.txtDetail.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtDetail.Size = New System.Drawing.Size(302, 54) + Me.txtDetail.Size = New System.Drawing.Size(303, 41) Me.txtDetail.TabIndex = 33 Me.txtDetail.TabStop = False Me.txtDetail.WordWrap = False @@ -366,7 +533,7 @@ Partial Class frmAddSendungsvermerkShort 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 668) + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(342, 297) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) Me.btnCustomerUploadLink.TabIndex = 108 @@ -376,7 +543,7 @@ Partial Class frmAddSendungsvermerkShort 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 694) + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(342, 322) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) Me.btnCustomerUploadEmail.TabIndex = 109 @@ -387,7 +554,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtCustomerUploadEmail.BackColor = System.Drawing.Color.White Me.txtCustomerUploadEmail.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(80, 696) + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 324) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) @@ -396,7 +563,7 @@ Partial Class frmAddSendungsvermerkShort 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(2, 699) + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 327) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 110 @@ -405,7 +572,7 @@ Partial Class frmAddSendungsvermerkShort 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(176, 672) + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 301) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 111 @@ -413,7 +580,7 @@ Partial Class frmAddSendungsvermerkShort ' 'nudCustomerUploadValidityHours ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(260, 670) + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 299) Me.nudCustomerUploadValidityHours.Maximum = New Decimal(New Integer() {168, 0, 0, 0}) Me.nudCustomerUploadValidityHours.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) Me.nudCustomerUploadValidityHours.Name = "nudCustomerUploadValidityHours" @@ -426,7 +593,7 @@ Partial Class frmAddSendungsvermerkShort Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbCustomerUploadLanguage.FormattingEnabled = True Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) - Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(80, 670) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 298) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) Me.cmbCustomerUploadLanguage.TabIndex = 116 @@ -434,7 +601,7 @@ Partial Class frmAddSendungsvermerkShort 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(2, 673) + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 301) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 117 @@ -444,36 +611,28 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtCustomerUploadEmailText.BackColor = System.Drawing.Color.White Me.txtCustomerUploadEmailText.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(80, 718) + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 350) Me.txtCustomerUploadEmailText.MaxLength = 500 Me.txtCustomerUploadEmailText.Multiline = True Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 54) + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 34) Me.txtCustomerUploadEmailText.TabIndex = 113 Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." ' 'lblCustomerUploadEmailText ' Me.lblCustomerUploadEmailText.AutoSize = True - Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(2, 721) + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 349) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 114 Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" ' - 'pnlCustomerUploadSeparator - ' - Me.pnlCustomerUploadSeparator.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.pnlCustomerUploadSeparator.Location = New System.Drawing.Point(-8, 779) - Me.pnlCustomerUploadSeparator.Name = "pnlCustomerUploadSeparator" - Me.pnlCustomerUploadSeparator.Size = New System.Drawing.Size(474, 1) - Me.pnlCustomerUploadSeparator.TabIndex = 115 - ' 'lblZustzlFreitext ' Me.lblZustzlFreitext.AutoSize = True - Me.lblZustzlFreitext.Location = New System.Drawing.Point(2, 785) + Me.lblZustzlFreitext.Location = New System.Drawing.Point(14, 688) Me.lblZustzlFreitext.Name = "lblZustzlFreitext" Me.lblZustzlFreitext.Size = New System.Drawing.Size(142, 13) Me.lblZustzlFreitext.TabIndex = 31 @@ -483,18 +642,18 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSendungSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSendungSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSendungSpedition.Location = New System.Drawing.Point(144, 484) + Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 591) Me.txtSendungSpedition.MaxLength = 50 Me.txtSendungSpedition.Name = "txtSendungSpedition" - Me.txtSendungSpedition.Size = New System.Drawing.Size(25, 20) + Me.txtSendungSpedition.Size = New System.Drawing.Size(26, 20) Me.txtSendungSpedition.TabIndex = 18 Me.txtSendungSpedition.Visible = False ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(310, 216) + Me.cbxNichtLeserlich.BackColor = System.Drawing.Color.Transparent + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 116) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 8 @@ -504,18 +663,28 @@ Partial Class frmAddSendungsvermerkShort 'btnOK ' Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnOK.Location = New System.Drawing.Point(313, 801) + Me.btnOK.Location = New System.Drawing.Point(325, 705) Me.btnOK.Name = "btnOK" - Me.btnOK.Size = New System.Drawing.Size(124, 54) + Me.btnOK.Size = New System.Drawing.Size(125, 41) Me.btnOK.TabIndex = 34 Me.btnOK.Text = "Hinzufügen" Me.btnOK.UseVisualStyleBackColor = True ' + 'btnDokumtanforderung + ' + Me.btnDokumtanforderung.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnDokumtanforderung.Location = New System.Drawing.Point(323, 22) + Me.btnDokumtanforderung.Name = "btnDokumtanforderung" + Me.btnDokumtanforderung.Size = New System.Drawing.Size(140, 23) + Me.btnDokumtanforderung.TabIndex = 133 + Me.btnDokumtanforderung.Text = "Dokumtanforderung" + Me.btnDokumtanforderung.UseVisualStyleBackColor = True + ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxSonstDok.Location = New System.Drawing.Point(14, 216) + Me.cbxSonstDok.BackColor = System.Drawing.Color.Transparent + Me.cbxSonstDok.Location = New System.Drawing.Point(12, 116) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 9 @@ -527,7 +696,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label9.AutoSize = True Me.Label9.BackColor = System.Drawing.Color.WhiteSmoke Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) - Me.Label9.Location = New System.Drawing.Point(354, 537) + Me.Label9.Location = New System.Drawing.Point(355, 614) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(90, 13) Me.Label9.TabIndex = 30 @@ -538,7 +707,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label17.AutoSize = True Me.Label17.BackColor = System.Drawing.Color.WhiteSmoke Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Italic) - Me.Label17.Location = New System.Drawing.Point(144, 537) + Me.Label17.Location = New System.Drawing.Point(145, 614) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(182, 13) Me.Label17.TabIndex = 29 @@ -549,7 +718,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label13.AutoSize = True Me.Label13.BackColor = System.Drawing.Color.WhiteSmoke Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label13.Location = New System.Drawing.Point(9, 459) + Me.Label13.Location = New System.Drawing.Point(10, 553) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(84, 17) Me.Label13.TabIndex = 16 @@ -559,41 +728,45 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtFreierText.BackColor = System.Drawing.Color.WhiteSmoke Me.txtFreierText.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtFreierText.Location = New System.Drawing.Point(122, 511) + Me.txtFreierText.Location = New System.Drawing.Point(123, 587) Me.txtFreierText.MaxLength = 80 Me.txtFreierText.Name = "txtFreierText" - Me.txtFreierText.Size = New System.Drawing.Size(322, 23) + Me.txtFreierText.Size = New System.Drawing.Size(323, 23) Me.txtFreierText.TabIndex = 28 ' 'Label20 ' Me.Label20.AutoSize = True Me.Label20.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label20.Location = New System.Drawing.Point(267, 487) + Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.Label20.Location = New System.Drawing.Point(216, 276) Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(0, 13) + Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 21 - ' - 'PictureBox1 - ' - Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke - Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox1.Location = New System.Drawing.Point(-1, -1) - Me.PictureBox1.Name = "PictureBox1" - Me.PictureBox1.Size = New System.Drawing.Size(474, 250) - Me.PictureBox1.TabIndex = 83 - Me.PictureBox1.TabStop = False + Me.Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." ' 'PictureBox4 ' Me.PictureBox4.BackColor = System.Drawing.Color.WhiteSmoke Me.PictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox4.Location = New System.Drawing.Point(-1, 450) + Me.PictureBox4.Location = New System.Drawing.Point(-1, 547) Me.PictureBox4.Name = "PictureBox4" - Me.PictureBox4.Size = New System.Drawing.Size(481, 189) + Me.PictureBox4.Size = New System.Drawing.Size(474, 139) Me.PictureBox4.TabIndex = 78 Me.PictureBox4.TabStop = False ' + 'lblErrDokument + ' + Me.lblErrDokument.AutoSize = True + Me.lblErrDokument.BackColor = System.Drawing.Color.WhiteSmoke + Me.lblErrDokument.ForeColor = System.Drawing.Color.Red + Me.lblErrDokument.Location = New System.Drawing.Point(96, 136) + Me.lblErrDokument.Name = "lblErrDokument" + Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) + Me.lblErrDokument.TabIndex = 11 + Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" + Me.lblErrDokument.Visible = False + ' 'Panel4 ' Me.Panel4.BackColor = System.Drawing.Color.White @@ -608,7 +781,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 868) + Me.ClientSize = New System.Drawing.Size(474, 750) Me.Controls.Add(Me.pnlMain) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) @@ -620,8 +793,10 @@ Partial Class frmAddSendungsvermerkShort Me.pnlMain.ResumeLayout(False) Me.pnlSendungsVermker.ResumeLayout(False) Me.pnlSendungsVermker.PerformLayout() - CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.pnlDocumentEditor.ResumeLayout(False) + Me.pnlDocumentEditor.PerformLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) @@ -640,6 +815,7 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents txtSendungSpedition As System.Windows.Forms.TextBox Friend WithEvents cbxNichtLeserlich As System.Windows.Forms.CheckBox Friend WithEvents btnOK As System.Windows.Forms.Button + Friend WithEvents btnDokumtanforderung As System.Windows.Forms.Button Friend WithEvents cbxSonstDok As System.Windows.Forms.CheckBox Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents lblErrSpedition As System.Windows.Forms.Label @@ -649,11 +825,12 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents txtFreierText As System.Windows.Forms.TextBox Friend WithEvents txtSpedition As System.Windows.Forms.TextBox Friend WithEvents Label20 As System.Windows.Forms.Label + Friend WithEvents lblDocumentEditorStatus As System.Windows.Forms.Label Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents optSendungInVorbereitung As System.Windows.Forms.CheckBox - Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents lblErrDokument As System.Windows.Forms.Label + Friend WithEvents lblDragIndicator As System.Windows.Forms.Label Friend WithEvents btnCLose As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label4 As Label @@ -670,6 +847,18 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents lblCustomerUploadLanguage As Label Friend WithEvents txtCustomerUploadEmailText As TextBox Friend WithEvents lblCustomerUploadEmailText As Label - Friend WithEvents pnlCustomerUploadSeparator As Panel Friend WithEvents Label5 As Label + Friend WithEvents flpDokumenteFehlenMain As FlowLayoutPanel + Friend WithEvents lblSonstigeVermerke As Label + Friend WithEvents flpAngefordert As FlowLayoutPanel + Friend WithEvents pnlDocumentEditor As Panel + Friend WithEvents flpDocumentTabs As FlowLayoutPanel + Friend WithEvents lblDocumentEditorTitle As Label + Friend WithEvents lblDocumentEditorName As Label + Friend WithEvents txtDocumentEditorName As TextBox + Friend WithEvents lblDocumentEditorAnhangsart As Label + Friend WithEvents cmbDocumentEditorAnhangsart As ComboBox + Friend WithEvents lblDocumentEditorInfo As Label + Friend WithEvents txtDocumentEditorInfo As TextBox + Friend WithEvents PictureBox1 As PictureBox End Class diff --git a/Aviso/frmAddSendungsvermerkShort.vb b/Aviso/frmAddSendungsvermerkShort.vb index 6a0dfea..2dc1600 100644 --- a/Aviso/frmAddSendungsvermerkShort.vb +++ b/Aviso/frmAddSendungsvermerkShort.vb @@ -25,18 +25,10 @@ Public Class frmAddSendungsvermerkShort Private ReadOnly _bereichByCodeId As New Dictionary(Of Integer, Integer) Private _selectedDocumentCodeId As Integer = 0 Private _isLoadingDocumentEditor As Boolean = False - Private pnlDocumentEditor As Panel - Private lblDocumentEditorTitle As Label - Private lblDocumentEditorName As Label - Private txtDocumentEditorName As TextBox - Private lblDocumentEditorAnhangsart As Label - Private cmbDocumentEditorAnhangsart As ComboBox - Private lblDocumentEditorInfo As Label - Private txtDocumentEditorInfo As TextBox - Private lblDocumentEditorStatus As Label Private Const DefaultDocumentBaseText As String = "Bitte das Dokument hochladen." Private Const BereichDokumentMain As Integer = 1 Private Const BereichAngefordert As Integer = 2 + Private _dokumentanforderungState As New frmSendungsDokumentanforderung.DokumentanforderungState() Dim Neuanlage As Boolean = False Dim hStatus As Integer @@ -87,16 +79,17 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub frmEintragVermerk_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) - 'cboDokumente.Items.Clear() - ' cboDokumente.Items.Add(New MyListItem("nachgefordert", CStr(0))) - 'cboDokumente.Items.Add(New MyListItem("erhalten", CStr(1))) - 'cboDokumente.SelectedIndex = 0 - - Me.CenterToParent() - If My.Computer.Screen.WorkingArea.Height < Me.Height Then - Me.Height = My.Computer.Screen.WorkingArea.Height + Dim pt As Point = Cursor.Position + Dim screenBounds As Rectangle = Screen.FromPoint(pt).WorkingArea + If pt.X + Me.Width > screenBounds.Right Then + pt.X = screenBounds.Right - Me.Width End If + If pt.Y + Me.Height > screenBounds.Bottom Then + pt.Y = screenBounds.Bottom - Me.Height + End If + Me.Location = pt + + VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) If cmbCustomerUploadLanguage IsNot Nothing Then If cmbCustomerUploadLanguage.SelectedIndex < 0 Then @@ -109,6 +102,8 @@ Public Class frmAddSendungsvermerkShort End If End If + InitializeDocumentEditor() + For Each c In Me.Controls If c.GetType.Name.ToString = "RadioButton" Then AddHandler DirectCast(c, RadioButton).CheckedChanged, AddressOf selectionChanged @@ -123,6 +118,8 @@ Public Class frmAddSendungsvermerkShort End If SetupDynamicAnforderungCheckboxes() + _dokumentanforderungState = BuildDokumentanforderungState() + SetDokumentbereichVisible(False) hStatus = myAviso.Status If hStatus = cGlobal.Status_Vorbereitet Or hStatus = cGlobal.Status_Vorgeschrieben Or hStatus = cGlobal.Status_Erfasst Then @@ -156,6 +153,33 @@ Public Class frmAddSendungsvermerkShort End Sub + Private Sub InitializeDocumentEditor() + If txtDocumentEditorName IsNot Nothing Then + RemoveHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + End If + + If txtDocumentEditorInfo IsNot Nothing Then + RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + End If + + EnsureAnhangsartenOptionsLoaded() + + If cmbDocumentEditorAnhangsart IsNot Nothing Then + RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + cmbDocumentEditorAnhangsart.BeginUpdate() + cmbDocumentEditorAnhangsart.Items.Clear() + For Each optionItem In _anhangsartenOptions + cmbDocumentEditorAnhangsart.Items.Add(optionItem) + Next + cmbDocumentEditorAnhangsart.EndUpdate() + AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + End If + + ClearDocumentEditor() + End Sub + Private Sub SetupDynamicAnforderungCheckboxes() _anforderungCheckboxes.Clear() _anhangsartIdByCheckbox.Clear() @@ -185,44 +209,8 @@ Public Class frmAddSendungsvermerkShort End If EnsureAnhangsartenOptionsLoaded() - Dim docsLeft = Label1.Left + 3 - Dim docsTop = Label1.Bottom + 6 - Dim docsWidth = PictureBox1.Width - (docsLeft * 2) - Dim docsMainHeight = Math.Max(10, cbxSonstDok.Top - docsTop - 6) - Dim docsMainPanel = CreateAnforderungFlowPanel("flpDokumenteFehlenMain", docsLeft, docsTop, docsWidth, docsMainHeight, Color.WhiteSmoke) - docsMainPanel.FlowDirection = FlowDirection.LeftToRight - docsMainPanel.WrapContents = True - - Dim docsExtraFound = pnlSendungsVermker.Controls.Find("flpDokumenteFehlenExtra", True) - If docsExtraFound IsNot Nothing AndAlso docsExtraFound.Length > 0 Then - Dim docsExtraPanel = TryCast(docsExtraFound(0), FlowLayoutPanel) - If docsExtraPanel IsNot Nothing Then - docsExtraPanel.Visible = False - docsExtraPanel.Controls.Clear() - End If - End If - - PositionDocumentEditorAndUpload() - - Dim lblSonstigeVermerke As Label = TryCast(pnlSendungsVermker.Controls.Find("lblSonstigeVermerke", True).FirstOrDefault(), Label) - If lblSonstigeVermerke Is Nothing Then - lblSonstigeVermerke = New Label() - lblSonstigeVermerke.Name = "lblSonstigeVermerke" - lblSonstigeVermerke.Text = "Sonstige Vermerke:" - lblSonstigeVermerke.Font = New Font("Microsoft Sans Serif", 10.0!, FontStyle.Bold) - lblSonstigeVermerke.AutoSize = True - lblSonstigeVermerke.BackColor = Color.White - pnlSendungsVermker.Controls.Add(lblSonstigeVermerke) - End If - lblSonstigeVermerke.Left = docsLeft - lblSonstigeVermerke.Top = PictureBox1.Bottom + 8 - lblSonstigeVermerke.BringToFront() - - Dim anforderungLeft = docsLeft - Dim anforderungTop = lblSonstigeVermerke.Bottom + 6 - Dim anforderungWidth = pnlSendungsVermker.Width - (anforderungLeft * 2) - Dim anforderungHeight = 198 - Dim anforderungPanel = CreateAnforderungFlowPanel("flpAngefordert", anforderungLeft, anforderungTop, anforderungWidth, anforderungHeight, Color.White) + flpDokumenteFehlenMain.Controls.Clear() + flpAngefordert.Controls.Clear() For Each row As DataRow In dt.Rows Dim id As Integer @@ -245,7 +233,7 @@ Public Class frmAddSendungsvermerkShort Dim cb As New CheckBox() cb.Text = frontendBezeichnung cb.Tag = id - cb.Margin = New Padding(0, 0, 8, 2) + cb.Margin = New Padding(0, 0, 4, 0) AddHandler cb.CheckedChanged, AddressOf DynamicAnforderungCheckboxChanged If bezeichnung.ToLowerInvariant().Contains("nicht leserlich") Then @@ -274,256 +262,46 @@ Public Class frmAddSendungsvermerkShort _bereichByCodeId(id) = bereich If bereich = BereichDokumentMain Then - cb.BackColor = Color.WhiteSmoke + cb.BackColor = Color.Transparent cb.UseVisualStyleBackColor = False - ConfigureAnforderungCheckbox(cb, docsMainPanel) - docsMainPanel.Controls.Add(cb) + ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) + flpDokumenteFehlenMain.Controls.Add(cb) Else - ConfigureAnforderungCheckbox(cb, anforderungPanel) - anforderungPanel.Controls.Add(cb) + ConfigureAnforderungCheckbox(cb, flpAngefordert) + flpAngefordert.Controls.Add(cb) End If _anforderungCheckboxes.Add(cb) Next - ArrangeSections(docsMainPanel, anforderungPanel) cbxSonstDok.BringToFront() txtSonstigesDokumentFehlt.BringToFront() cbxNichtLeserlich.BringToFront() lblErrDokument.BringToFront() - End Sub - Private Function CreateAnforderungFlowPanel(name As String, left As Integer, top As Integer, width As Integer, height As Integer, backColor As Color) As FlowLayoutPanel - Dim found = pnlSendungsVermker.Controls.Find(name, True) - If found IsNot Nothing AndAlso found.Length > 0 Then - Dim existing = TryCast(found(0), FlowLayoutPanel) - If existing IsNot Nothing Then - existing.Left = left - existing.Top = top - existing.Width = width - existing.Height = height - existing.BackColor = backColor - existing.FlowDirection = FlowDirection.TopDown - existing.WrapContents = True - existing.AutoScroll = True - existing.Controls.Clear() - existing.BringToFront() - Return existing - End If - End If - - Dim flp As New FlowLayoutPanel() - flp.Name = name - flp.Left = left - flp.Top = top - flp.Width = width - flp.Height = height - flp.FlowDirection = FlowDirection.TopDown - flp.WrapContents = True - flp.AutoScroll = True - flp.BackColor = backColor - flp.Padding = New Padding(0) - flp.Margin = New Padding(0) - pnlSendungsVermker.Controls.Add(flp) - flp.BringToFront() - Return flp - End Function - Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) If cb Is Nothing OrElse container Is Nothing Then Return cb.AutoSize = False - cb.Height = 20 + cb.Height = 18 Dim cols As Integer = 2 Dim colGap As Integer = 14 Dim minCbWidth As Integer = 120 If String.Equals(container.Name, "flpDokumenteFehlenMain", StringComparison.OrdinalIgnoreCase) Then cols = 3 - colGap = 8 - minCbWidth = 150 + colGap = 2 + minCbWidth = 80 + ElseIf String.Equals(container.Name, "flpAngefordert", StringComparison.OrdinalIgnoreCase) Then + cols = 2 + colGap = 14 + minCbWidth = 180 End If - Dim usableWidth = Math.Max(120, container.Width - 12) + + Dim usableWidth = Math.Max(120, container.Width - 20) Dim cbWidth = CInt(Math.Floor((usableWidth - ((cols - 1) * colGap)) / cols)) - cb.Width = Math.Max(minCbWidth, cbWidth) - End Sub - - Private Sub PositionDocumentEditorAndUpload() - EnsureDocumentEditorControls() - - Dim topSectionBottom = Math.Max(cbxSonstDok.Bottom, lblErrDokument.Bottom) - - pnlDocumentEditor.Left = 8 - pnlDocumentEditor.Top = topSectionBottom + 12 - pnlDocumentEditor.Width = pnlSendungsVermker.Width - 16 - pnlDocumentEditor.Height = 152 - pnlDocumentEditor.BackColor = Color.WhiteSmoke - pnlDocumentEditor.BringToFront() - - Label5.Top = pnlDocumentEditor.Bottom + 8 - Label5.BackColor = Color.WhiteSmoke - Label5.BringToFront() - - Label20.Left = Label5.Right + 10 - Label20.Top = Label5.Top + 2 - Label20.BackColor = Color.WhiteSmoke - Label20.AutoSize = True - Label20.ForeColor = Color.FromArgb(0, 102, 153) - Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." - Label20.BringToFront() - - lblCustomerUploadLanguage.Top = Label5.Bottom + 10 - lblCustomerUploadLanguage.BackColor = Color.WhiteSmoke - lblCustomerUploadLanguage.BringToFront() - cmbCustomerUploadLanguage.Top = lblCustomerUploadLanguage.Top - 3 - cmbCustomerUploadLanguage.BringToFront() - - lblCustomerUploadValidityHours.Top = lblCustomerUploadLanguage.Top - lblCustomerUploadValidityHours.BackColor = Color.WhiteSmoke - lblCustomerUploadValidityHours.BringToFront() - nudCustomerUploadValidityHours.Top = lblCustomerUploadLanguage.Top - 2 - nudCustomerUploadValidityHours.BringToFront() - - btnCustomerUploadLink.Top = lblCustomerUploadLanguage.Top - 4 - btnCustomerUploadLink.BringToFront() - - lblCustomerUploadEmail.Top = lblCustomerUploadLanguage.Top + 26 - lblCustomerUploadEmail.BackColor = Color.WhiteSmoke - lblCustomerUploadEmail.BringToFront() - txtCustomerUploadEmail.Top = lblCustomerUploadEmail.Top - 3 - txtCustomerUploadEmail.BringToFront() - - btnCustomerUploadEmail.Top = txtCustomerUploadEmail.Top - 2 - btnCustomerUploadEmail.BringToFront() - - lblCustomerUploadEmailText.Top = lblCustomerUploadEmail.Top + 22 - lblCustomerUploadEmailText.BackColor = Color.WhiteSmoke - lblCustomerUploadEmailText.BringToFront() - txtCustomerUploadEmailText.Top = lblCustomerUploadEmailText.Top - 3 - txtCustomerUploadEmailText.BringToFront() - - pnlCustomerUploadSeparator.Visible = False - - PictureBox1.Height = txtCustomerUploadEmailText.Bottom + 12 - End Sub - - Private Sub ArrangeSections(docsMainPanel As FlowLayoutPanel, anforderungPanel As FlowLayoutPanel) - If docsMainPanel Is Nothing OrElse anforderungPanel Is Nothing Then Return - - Label13.Top = anforderungPanel.Bottom + 14 - PictureBox4.Top = Label13.Top - 10 - - optSpeditionWeitergeleitet.Top = Label13.Bottom + 10 - txtSpedition.Top = optSpeditionWeitergeleitet.Top - 2 - Label2.Top = optSpeditionWeitergeleitet.Top - 18 - Label3.Top = optSpeditionWeitergeleitet.Top + 1 - lblErrSpedition.Top = Label2.Top - - optFreierText.Top = optSpeditionWeitergeleitet.Bottom + 9 - txtFreierText.Top = optFreierText.Top - 2 - Label17.Top = txtFreierText.Bottom + 4 - Label9.Top = Label17.Top - lblErrGrund.Top = Label17.Top - - Label4.Top = Label17.Bottom + 14 - optFremd_SendungAvisiert.Top = Label4.Bottom + 7 - optFremd_ATB.Top = optFremd_SendungAvisiert.Bottom + 6 - optATAangefordert.Top = optFremd_ATB.Top - - PictureBox4.Height = (optFremd_ATB.Bottom + 12) - PictureBox4.Top - - lblZustzlFreitext.Top = PictureBox4.Bottom + 8 - txtDetail.Top = lblZustzlFreitext.Bottom + 4 - btnOK.Top = txtDetail.Top - lblErr240Zeichen.Top = txtDetail.Top - 16 - - Dim contentBottom = Math.Max(btnOK.Bottom, txtDetail.Bottom) + 12 - pnlSendungsVermker.Height = contentBottom - pnlMain.Height = contentBottom - Me.ClientSize = New Size(Me.ClientSize.Width, contentBottom) - End Sub - - Private flpDocumentTabs As FlowLayoutPanel - - Private Sub EnsureDocumentEditorControls() - If pnlDocumentEditor IsNot Nothing Then Return - - pnlDocumentEditor = New Panel() - pnlDocumentEditor.BackColor = Color.WhiteSmoke - pnlDocumentEditor.BorderStyle = BorderStyle.FixedSingle - pnlSendungsVermker.Controls.Add(pnlDocumentEditor) - - flpDocumentTabs = New FlowLayoutPanel() - flpDocumentTabs.Location = New Point(0, 0) - flpDocumentTabs.Width = pnlDocumentEditor.Width - flpDocumentTabs.Height = 50 - flpDocumentTabs.BackColor = Color.FromArgb(220, 220, 220) - flpDocumentTabs.WrapContents = False - flpDocumentTabs.AutoScroll = True - flpDocumentTabs.Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right - pnlDocumentEditor.Controls.Add(flpDocumentTabs) - - lblDocumentEditorTitle = New Label() - lblDocumentEditorTitle.AutoSize = True - lblDocumentEditorTitle.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Bold, GraphicsUnit.Point, CType(0, Byte)) - lblDocumentEditorTitle.Location = New Point(8, 58) - lblDocumentEditorTitle.Text = "Dokumentdetails" - pnlDocumentEditor.Controls.Add(lblDocumentEditorTitle) - - lblDocumentEditorName = New Label() - lblDocumentEditorName.AutoSize = True - lblDocumentEditorName.Location = New Point(8, 80) - lblDocumentEditorName.Text = "Dokumentname:" - pnlDocumentEditor.Controls.Add(lblDocumentEditorName) - - txtDocumentEditorName = New TextBox() - txtDocumentEditorName.BackColor = Color.White - txtDocumentEditorName.Location = New Point(110, 77) - txtDocumentEditorName.MaxLength = 120 - txtDocumentEditorName.Size = New Size(128, 20) - AddHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged - pnlDocumentEditor.Controls.Add(txtDocumentEditorName) - - lblDocumentEditorAnhangsart = New Label() - lblDocumentEditorAnhangsart.AutoSize = True - lblDocumentEditorAnhangsart.Location = New Point(248, 80) - lblDocumentEditorAnhangsart.Text = "Anhangsart:" - pnlDocumentEditor.Controls.Add(lblDocumentEditorAnhangsart) - - cmbDocumentEditorAnhangsart = New ComboBox() - cmbDocumentEditorAnhangsart.BackColor = Color.White - cmbDocumentEditorAnhangsart.DropDownStyle = ComboBoxStyle.DropDownList - cmbDocumentEditorAnhangsart.Location = New Point(320, 77) - cmbDocumentEditorAnhangsart.Size = New Size(124, 21) - EnsureAnhangsartenOptionsLoaded() - For Each o In _anhangsartenOptions - cmbDocumentEditorAnhangsart.Items.Add(o) - Next - AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged - pnlDocumentEditor.Controls.Add(cmbDocumentEditorAnhangsart) - - lblDocumentEditorInfo = New Label() - lblDocumentEditorInfo.AutoSize = True - lblDocumentEditorInfo.Location = New Point(8, 104) - lblDocumentEditorInfo.Text = "Dokument Info:" - pnlDocumentEditor.Controls.Add(lblDocumentEditorInfo) - - txtDocumentEditorInfo = New TextBox() - txtDocumentEditorInfo.BackColor = Color.White - txtDocumentEditorInfo.Location = New Point(110, 101) - txtDocumentEditorInfo.MaxLength = 500 - txtDocumentEditorInfo.Size = New Size(334, 20) - txtDocumentEditorInfo.Text = DefaultDocumentBaseText - AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged - pnlDocumentEditor.Controls.Add(txtDocumentEditorInfo) - - lblDocumentEditorStatus = New Label() - lblDocumentEditorStatus.AutoSize = True - lblDocumentEditorStatus.ForeColor = Color.FromArgb(0, 102, 153) - lblDocumentEditorStatus.Location = New Point(8, 128) - lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." - pnlDocumentEditor.Controls.Add(lblDocumentEditorStatus) + cb.Width = Math.Max(minCbWidth, Math.Min(cbWidth, 220)) End Sub Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) @@ -845,8 +623,6 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub LoadDocumentEditorForCheckbox(cb As CheckBox) - EnsureDocumentEditorControls() - Dim codeId As Integer = 0 If Not TryGetCheckboxCodeId(cb, codeId) Then _selectedDocumentCodeId = 0 @@ -986,6 +762,145 @@ Public Class frmAddSendungsvermerkShort End If End Sub + Private Sub SetDokumentbereichVisible(visible As Boolean) + flpDokumenteFehlenMain.Visible = visible + pnlDocumentEditor.Visible = visible + Label5.Visible = visible + txtSonstigesDokumentFehlt.Visible = visible + btnCustomerUploadLink.Visible = visible + btnCustomerUploadEmail.Visible = visible + txtCustomerUploadEmail.Visible = visible + lblCustomerUploadEmail.Visible = visible + lblCustomerUploadValidityHours.Visible = visible + nudCustomerUploadValidityHours.Visible = visible + cmbCustomerUploadLanguage.Visible = visible + lblCustomerUploadLanguage.Visible = visible + txtCustomerUploadEmailText.Visible = visible + lblCustomerUploadEmailText.Visible = visible + Label20.Visible = visible + cbxNichtLeserlich.Visible = visible + cbxSonstDok.Visible = visible + lblErrDokument.Visible = False + If PictureBox1 IsNot Nothing Then + PictureBox1.Visible = visible + End If + End Sub + + Private Function BuildDokumentanforderungState() As frmSendungsDokumentanforderung.DokumentanforderungState + Dim result As New frmSendungsDokumentanforderung.DokumentanforderungState() + result.SelectedCodeIds = New List(Of Integer) + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb IsNot Nothing AndAlso cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then + If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then + result.SelectedCodeIds.Add(codeId) + End If + End If + Next + result.SelectedAnhangsartIdByCodeId = New Dictionary(Of Integer, Integer)(_selectedAnhangsartIdByCodeId) + result.DocumentCustomNameByCodeId = New Dictionary(Of Integer, String)(_documentCustomNameByCodeId) + result.DocumentBaseTextByCodeId = New Dictionary(Of Integer, String)(_documentBaseTextByCodeId) + result.SonstDokChecked = cbxSonstDok.Checked + result.SonstigesDokumentName = If(txtSonstigesDokumentFehlt.Text, "").Trim() + result.NichtLeserlichChecked = cbxNichtLeserlich.Checked + result.CustomerUploadEmail = If(txtCustomerUploadEmail.Text, "").Trim() + result.CustomerUploadLanguage = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) + result.CustomerUploadEmailText = If(txtCustomerUploadEmailText.Text, "").Trim() + result.CustomerUploadValidityHours = CInt(nudCustomerUploadValidityHours.Value) + Return result + End Function + + Private Function InsertNurDokumentVermerk() As Boolean + Dim dokumentVermerkGesetzt As Boolean = False + + For Each cb In _anforderungCheckboxes + If cb Is Nothing OrElse Not cb.Checked Then Continue For + Dim codeId As Integer = 0 + If Not Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then Continue For + If Not _bereichByCodeId.ContainsKey(codeId) OrElse _bereichByCodeId(codeId) <> BereichDokumentMain Then Continue For + + Dim text = "" + If _backendBezeichnungByCodeId.ContainsKey(codeId) Then + text = If(_backendBezeichnungByCodeId(codeId), "").Trim() + End If + If text = "" Then text = cb.Text.Trim() + + Dim sendText = txtSendung.Text.Trim() + If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then + text &= " bei Sendung '" & sendText & "'" + End If + + If text <> "" Then + insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) + dokumentVermerkGesetzt = True + End If + Next + + If cbxSonstDok.Checked Then + If txtSonstigesDokumentFehlt.Text.Trim = "" Then + lblErrDokument.Visible = True + txtSonstigesDokumentFehlt.Focus() + Return False + End If + insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument '" & txtSonstigesDokumentFehlt.Text.Trim & "' fehlt - angefordert.", 25) + dokumentVermerkGesetzt = True + End If + + If cbxNichtLeserlich.Checked Then + insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument(e) nachgefordert, da nicht leserlich.", 42) + dokumentVermerkGesetzt = True + End If + + If Not dokumentVermerkGesetzt Then + lblErrDokument.Visible = True + Return False + End If + + Return True + End Function + + Private Sub ApplyDokumentanforderungState(state As frmSendungsDokumentanforderung.DokumentanforderungState) + If state Is Nothing Then Return + _selectedAnhangsartIdByCodeId.Clear() + _documentCustomNameByCodeId.Clear() + _documentBaseTextByCodeId.Clear() + For Each kvp In state.SelectedAnhangsartIdByCodeId + _selectedAnhangsartIdByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentCustomNameByCodeId + _documentCustomNameByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentBaseTextByCodeId + _documentBaseTextByCodeId(kvp.Key) = kvp.Value + Next + + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb Is Nothing Then Continue For + If Not Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then Continue For + If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then + cb.Checked = state.SelectedCodeIds.Contains(codeId) + End If + Next + + cbxSonstDok.Checked = state.SonstDokChecked + txtSonstigesDokumentFehlt.Text = If(state.SonstigesDokumentName, "") + cbxNichtLeserlich.Checked = state.NichtLeserlichChecked + txtCustomerUploadEmail.Text = If(state.CustomerUploadEmail, "") + txtCustomerUploadEmailText.Text = If(state.CustomerUploadEmailText, "") + + Dim targetValidity = Math.Max(CInt(nudCustomerUploadValidityHours.Minimum), Math.Min(CInt(nudCustomerUploadValidityHours.Maximum), state.CustomerUploadValidityHours)) + nudCustomerUploadValidityHours.Value = targetValidity + + Dim language = If(state.CustomerUploadLanguage, "").Trim() + Dim languageIdx = cmbCustomerUploadLanguage.Items.IndexOf(language) + If languageIdx >= 0 Then + cmbCustomerUploadLanguage.SelectedIndex = languageIdx + End If + + SyncTabs() + End Sub + ' Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click ' Me.Close() ' End Sub @@ -1193,18 +1108,53 @@ Public Class frmAddSendungsvermerkShort Private Sub frmAddSendungsvermerk_Shown(sender As Object, e As EventArgs) Handles Me.Shown - Dim p = Cursor.Position - If (p.X + Me.Width) > My.Computer.Screen.WorkingArea.Width Then p.X = My.Computer.Screen.WorkingArea.Width - Me.Width - If (p.Y + Me.Height) > My.Computer.Screen.WorkingArea.Height Then p.Y = My.Computer.Screen.WorkingArea.Height - Me.Height - Me.Location = p '.Me.PointToClient(System.Cursor.Position) txtSendung.SelectionLength = 0 txtFreierText.Focus() End Sub + ' --- Dragging Logic --- + Private drag As Boolean + Private mouseX As Integer + Private mouseY As Integer + + Private Sub Form_MouseDown(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseDown + If e.Button = MouseButtons.Left Then + drag = True + mouseX = Cursor.Position.X - Me.Left + mouseY = Cursor.Position.Y - Me.Top + End If + End Sub + + Private Sub Form_MouseMove(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseMove + If drag Then + Me.Top = Cursor.Position.Y - mouseY + Me.Left = Cursor.Position.X - mouseX + End If + End Sub + + Private Sub Form_MouseUp(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseUp + drag = False + End Sub + ' ---------------------- + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnCLose.Click Me.Close() End Sub + Private Sub btnDokumtanforderung_Click(sender As Object, e As EventArgs) Handles btnDokumtanforderung.Click + _dokumentanforderungState = BuildDokumentanforderungState() + Using frm As New frmSendungsDokumentanforderung(AvisoID, SendungID, _dokumentanforderungState) + If frm.ShowDialog(Me) = DialogResult.OK Then + _dokumentanforderungState = frm.BuildState() + ApplyDokumentanforderungState(_dokumentanforderungState) + If InsertNurDokumentVermerk() Then + frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) + Me.Close() + End If + End If + End Using + End Sub + Private Sub Button2_Click(sender As Object, e As EventArgs) If insertVermerke() Then VERAG_PROG_ALLGEMEIN.cAvisoBenachrichtigungen.INSERT_BENACHRICHTIGUNG(myAviso.AvisoID, SendungID, 1, "T", 13, , 1) diff --git a/Aviso/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb new file mode 100644 index 0000000..38a1cd2 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -0,0 +1,440 @@ + +Partial Class frmSendungsDokumentanforderung + Inherits System.Windows.Forms.Form + + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + Private components As System.ComponentModel.IContainer + + + Private Sub InitializeComponent() + Me.flpDokumenteFehlenMain = New System.Windows.Forms.FlowLayoutPanel() + Me.cbxSonstDok = New System.Windows.Forms.CheckBox() + Me.txtSonstigesDokumentFehlt = New System.Windows.Forms.TextBox() + Me.cbxNichtLeserlich = New System.Windows.Forms.CheckBox() + Me.lblErrDokument = New System.Windows.Forms.Label() + Me.pnlDocumentEditor = New System.Windows.Forms.Panel() + Me.flpDocumentTabs = New System.Windows.Forms.FlowLayoutPanel() + Me.lblDocumentEditorTitle = New System.Windows.Forms.Label() + Me.lblDocumentEditorName = New System.Windows.Forms.Label() + Me.txtDocumentEditorName = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorAnhangsart = New System.Windows.Forms.Label() + Me.cmbDocumentEditorAnhangsart = New System.Windows.Forms.ComboBox() + Me.lblDocumentEditorInfo = New System.Windows.Forms.Label() + Me.txtDocumentEditorInfo = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorStatus = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.Label20 = New System.Windows.Forms.Label() + Me.btnCustomerUploadLink = New System.Windows.Forms.Button() + Me.btnCustomerUploadEmail = New System.Windows.Forms.Button() + Me.txtCustomerUploadEmail = New System.Windows.Forms.TextBox() + Me.lblCustomerUploadEmail = New System.Windows.Forms.Label() + Me.lblCustomerUploadValidityHours = New System.Windows.Forms.Label() + Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() + Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() + Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() + Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() + Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() + Me.btnVermerkSetzen = New System.Windows.Forms.Button() + Me.lblTitel = New System.Windows.Forms.Label() + Me.lblKontaktEmails = New System.Windows.Forms.Label() + Me.dgvKontaktEmails = New System.Windows.Forms.DataGridView() + Me.pnlDocumentEditor.SuspendLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dgvKontaktEmails, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'flpDokumenteFehlenMain + ' + Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent + Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 34) + Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) + Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.TabIndex = 0 + ' + 'cbxSonstDok + ' + Me.cbxSonstDok.AutoSize = True + Me.cbxSonstDok.Location = New System.Drawing.Point(12, 126) + Me.cbxSonstDok.Name = "cbxSonstDok" + Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) + Me.cbxSonstDok.TabIndex = 1 + Me.cbxSonstDok.Text = "Dok. Name:" + Me.cbxSonstDok.UseVisualStyleBackColor = True + ' + 'txtSonstigesDokumentFehlt + ' + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(95, 124) + Me.txtSonstigesDokumentFehlt.MaxLength = 80 + Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) + Me.txtSonstigesDokumentFehlt.TabIndex = 2 + ' + 'cbxNichtLeserlich + ' + Me.cbxNichtLeserlich.AutoSize = True + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 126) + Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" + Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) + Me.cbxNichtLeserlich.TabIndex = 3 + Me.cbxNichtLeserlich.Text = "nicht leserlich" + Me.cbxNichtLeserlich.UseVisualStyleBackColor = True + ' + 'lblErrDokument + ' + Me.lblErrDokument.AutoSize = True + Me.lblErrDokument.ForeColor = System.Drawing.Color.Red + Me.lblErrDokument.Location = New System.Drawing.Point(96, 146) + Me.lblErrDokument.Name = "lblErrDokument" + Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) + Me.lblErrDokument.TabIndex = 4 + Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" + Me.lblErrDokument.Visible = False + ' + 'pnlDocumentEditor + ' + Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke + Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 159) + Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.TabIndex = 5 + ' + 'flpDocumentTabs + ' + Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDocumentTabs.AutoScroll = True + Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) + Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) + Me.flpDocumentTabs.Name = "flpDocumentTabs" + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) + Me.flpDocumentTabs.TabIndex = 0 + Me.flpDocumentTabs.WrapContents = False + ' + 'lblDocumentEditorTitle + ' + Me.lblDocumentEditorTitle.AutoSize = True + Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) + Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" + Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) + Me.lblDocumentEditorTitle.TabIndex = 1 + Me.lblDocumentEditorTitle.Text = "Dokumentdetails" + ' + 'lblDocumentEditorName + ' + Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Name = "lblDocumentEditorName" + Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) + Me.lblDocumentEditorName.TabIndex = 2 + Me.lblDocumentEditorName.Text = "Dokumentname:" + ' + 'txtDocumentEditorName + ' + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.MaxLength = 120 + Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.TabIndex = 3 + ' + 'lblDocumentEditorAnhangsart + ' + Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" + Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) + Me.lblDocumentEditorAnhangsart.TabIndex = 4 + Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" + ' + 'cmbDocumentEditorAnhangsart + ' + Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.TabIndex = 5 + ' + 'lblDocumentEditorInfo + ' + Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" + Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) + Me.lblDocumentEditorInfo.TabIndex = 6 + Me.lblDocumentEditorInfo.Text = "Dokument Info:" + ' + 'txtDocumentEditorInfo + ' + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.MaxLength = 500 + Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.TabIndex = 7 + Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." + ' + 'lblDocumentEditorStatus + ' + Me.lblDocumentEditorStatus.AutoSize = True + Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) + Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" + Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) + Me.lblDocumentEditorStatus.TabIndex = 8 + Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label5.Location = New System.Drawing.Point(6, 298) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(202, 17) + Me.Label5.TabIndex = 6 + Me.Label5.Text = "Kundenportal Upload-Link:" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.Label20.Location = New System.Drawing.Point(216, 300) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(207, 13) + Me.Label20.TabIndex = 7 + Me.Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + ' + 'btnCustomerUploadLink + ' + Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 321) + Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadLink.TabIndex = 11 + Me.btnCustomerUploadLink.Text = "Link kopieren" + Me.btnCustomerUploadLink.UseVisualStyleBackColor = True + ' + 'btnCustomerUploadEmail + ' + Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 346) + Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadEmail.TabIndex = 13 + Me.btnCustomerUploadEmail.Text = "E-Mail senden" + Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True + ' + 'txtCustomerUploadEmail + ' + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 348) + Me.txtCustomerUploadEmail.MaxLength = 255 + Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) + Me.txtCustomerUploadEmail.TabIndex = 12 + ' + 'lblCustomerUploadEmail + ' + Me.lblCustomerUploadEmail.AutoSize = True + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 351) + Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" + Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) + Me.lblCustomerUploadEmail.TabIndex = 10 + Me.lblCustomerUploadEmail.Text = "E-Mail an:" + ' + 'lblCustomerUploadValidityHours + ' + Me.lblCustomerUploadValidityHours.AutoSize = True + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 325) + Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" + Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) + Me.lblCustomerUploadValidityHours.TabIndex = 9 + Me.lblCustomerUploadValidityHours.Text = "Gültigkeit(h):" + ' + 'nudCustomerUploadValidityHours + ' + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 323) + Me.nudCustomerUploadValidityHours.Maximum = New Decimal(New Integer() {168, 0, 0, 0}) + Me.nudCustomerUploadValidityHours.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.nudCustomerUploadValidityHours.Name = "nudCustomerUploadValidityHours" + Me.nudCustomerUploadValidityHours.Size = New System.Drawing.Size(74, 20) + Me.nudCustomerUploadValidityHours.TabIndex = 10 + Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) + ' + 'cmbCustomerUploadLanguage + ' + Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbCustomerUploadLanguage.FormattingEnabled = True + Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 322) + Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) + Me.cmbCustomerUploadLanguage.TabIndex = 9 + ' + 'lblCustomerUploadLanguage + ' + Me.lblCustomerUploadLanguage.AutoSize = True + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 325) + Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" + Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) + Me.lblCustomerUploadLanguage.TabIndex = 8 + Me.lblCustomerUploadLanguage.Text = "Mail Sprache:" + ' + 'txtCustomerUploadEmailText + ' + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 374) + Me.txtCustomerUploadEmailText.MaxLength = 500 + Me.txtCustomerUploadEmailText.Multiline = True + Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" + Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 44) + Me.txtCustomerUploadEmailText.TabIndex = 14 + Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + ' + 'lblCustomerUploadEmailText + ' + Me.lblCustomerUploadEmailText.AutoSize = True + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 377) + Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" + Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) + Me.lblCustomerUploadEmailText.TabIndex = 15 + Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" + ' + 'lblKontaktEmails + ' + Me.lblKontaktEmails.AutoSize = True + Me.lblKontaktEmails.Location = New System.Drawing.Point(6, 427) + Me.lblKontaktEmails.Name = "lblKontaktEmails" + Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) + Me.lblKontaktEmails.TabIndex = 17 + Me.lblKontaktEmails.Text = "Hinterlegte E-Mail-Adressen (Doppelklick = Übernehmen):" + ' + 'dgvKontaktEmails + ' + Me.dgvKontaktEmails.AllowUserToAddRows = False + Me.dgvKontaktEmails.AllowUserToDeleteRows = False + Me.dgvKontaktEmails.AllowUserToResizeRows = False + Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White + Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 445) + Me.dgvKontaktEmails.MultiSelect = False + Me.dgvKontaktEmails.Name = "dgvKontaktEmails" + Me.dgvKontaktEmails.ReadOnly = True + Me.dgvKontaktEmails.RowHeadersVisible = False + Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgvKontaktEmails.Size = New System.Drawing.Size(455, 84) + Me.dgvKontaktEmails.TabIndex = 18 + ' + 'btnVermerkSetzen + ' + Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnVermerkSetzen.Location = New System.Drawing.Point(340, 535) + Me.btnVermerkSetzen.Name = "btnVermerkSetzen" + Me.btnVermerkSetzen.Size = New System.Drawing.Size(124, 30) + Me.btnVermerkSetzen.TabIndex = 16 + Me.btnVermerkSetzen.Text = "Vermerk setzen" + Me.btnVermerkSetzen.UseVisualStyleBackColor = True + ' + 'lblTitel + ' + Me.lblTitel.AutoSize = True + Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblTitel.Location = New System.Drawing.Point(9, 9) + Me.lblTitel.Name = "lblTitel" + Me.lblTitel.Size = New System.Drawing.Size(156, 17) + Me.lblTitel.TabIndex = 18 + Me.lblTitel.Text = "Dokument(e) fehlen:" + ' + 'frmSendungsDokumentanforderung + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(474, 576) + Me.Controls.Add(Me.dgvKontaktEmails) + Me.Controls.Add(Me.lblKontaktEmails) + Me.Controls.Add(Me.lblTitel) + Me.Controls.Add(Me.btnVermerkSetzen) + Me.Controls.Add(Me.lblCustomerUploadEmailText) + Me.Controls.Add(Me.txtCustomerUploadEmailText) + Me.Controls.Add(Me.lblCustomerUploadLanguage) + Me.Controls.Add(Me.cmbCustomerUploadLanguage) + Me.Controls.Add(Me.nudCustomerUploadValidityHours) + Me.Controls.Add(Me.lblCustomerUploadValidityHours) + Me.Controls.Add(Me.lblCustomerUploadEmail) + Me.Controls.Add(Me.txtCustomerUploadEmail) + Me.Controls.Add(Me.btnCustomerUploadEmail) + Me.Controls.Add(Me.btnCustomerUploadLink) + Me.Controls.Add(Me.Label20) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.pnlDocumentEditor) + Me.Controls.Add(Me.lblErrDokument) + Me.Controls.Add(Me.cbxNichtLeserlich) + Me.Controls.Add(Me.txtSonstigesDokumentFehlt) + Me.Controls.Add(Me.cbxSonstDok) + Me.Controls.Add(Me.flpDokumenteFehlenMain) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmSendungsDokumentanforderung" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Dokumentanforderung" + Me.pnlDocumentEditor.ResumeLayout(False) + Me.pnlDocumentEditor.PerformLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dgvKontaktEmails, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents flpDokumenteFehlenMain As FlowLayoutPanel + Friend WithEvents cbxSonstDok As CheckBox + Friend WithEvents txtSonstigesDokumentFehlt As TextBox + Friend WithEvents cbxNichtLeserlich As CheckBox + Friend WithEvents lblErrDokument As Label + Friend WithEvents pnlDocumentEditor As Panel + Friend WithEvents flpDocumentTabs As FlowLayoutPanel + Friend WithEvents lblDocumentEditorTitle As Label + Friend WithEvents lblDocumentEditorName As Label + Friend WithEvents txtDocumentEditorName As TextBox + Friend WithEvents lblDocumentEditorAnhangsart As Label + Friend WithEvents cmbDocumentEditorAnhangsart As ComboBox + Friend WithEvents lblDocumentEditorInfo As Label + Friend WithEvents txtDocumentEditorInfo As TextBox + Friend WithEvents lblDocumentEditorStatus As Label + Friend WithEvents Label5 As Label + Friend WithEvents Label20 As Label + Friend WithEvents btnCustomerUploadLink As Button + Friend WithEvents btnCustomerUploadEmail As Button + Friend WithEvents txtCustomerUploadEmail As TextBox + Friend WithEvents lblCustomerUploadEmail As Label + Friend WithEvents lblCustomerUploadValidityHours As Label + Friend WithEvents nudCustomerUploadValidityHours As NumericUpDown + Friend WithEvents cmbCustomerUploadLanguage As ComboBox + Friend WithEvents lblCustomerUploadLanguage As Label + Friend WithEvents txtCustomerUploadEmailText As TextBox + Friend WithEvents lblCustomerUploadEmailText As Label + Friend WithEvents btnVermerkSetzen As Button + Friend WithEvents lblTitel As Label + Friend WithEvents lblKontaktEmails As Label + Friend WithEvents dgvKontaktEmails As DataGridView +End Class diff --git a/Aviso/frmSendungsDokumentanforderung.resx b/Aviso/frmSendungsDokumentanforderung.resx new file mode 100644 index 0000000..459ff73 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.resx @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb new file mode 100644 index 0000000..0288998 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -0,0 +1,1198 @@ +Imports System.Configuration +Imports System.IO +Imports System.Net +Imports System.Net.Mail +Imports System.Text +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports VERAG_PROG_ALLGEMEIN + +Public Class frmSendungsDokumentanforderung + Private ReadOnly AvisoDAL As New cAvisoDAL + Public Property AvisoID As Integer + Public Property SendungID As Integer + + Private ReadOnly _anforderungCheckboxes As New List(Of CheckBox) + Private ReadOnly _anhangsartIdByCheckbox As New Dictionary(Of CheckBox, Integer) + Private ReadOnly _backendBezeichnungByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _selectedAnhangsartIdByCodeId As New Dictionary(Of Integer, Integer) + Private ReadOnly _documentCustomNameByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _documentBaseTextByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _anhangsartenOptions As New List(Of AnhangsartOption) + Private ReadOnly _bereichByCodeId As New Dictionary(Of Integer, Integer) + + Private _selectedDocumentCodeId As Integer + Private _isLoadingDocumentEditor As Boolean + + Private Const DefaultDocumentBaseText As String = "Bitte das Dokument hochladen." + Private Const BereichDokumentMain As Integer = 1 + + Private Shared _customerPortalJwtToken As String = "" + Private Shared _customerPortalJwtExpUtc As DateTime = DateTime.MinValue + Private Shared _customerPortalAnhangsartenMap As Dictionary(Of String, Integer) = Nothing + Private Shared _customerPortalAnhangsartenFetchedUtc As DateTime = DateTime.MinValue + Private Shared _customerPortalCustomFilenameAnhangsartId As Integer = -1 + Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) + + Public Sub New(avisoId As Integer, sendungId As Integer, state As DokumentanforderungState) + InitializeComponent() + AvisoID = avisoId + SendungID = sendungId + Icon = cMeineFunktionenAVISO.GetProgrammIcon + _stateToApply = If(state, New DokumentanforderungState()) + End Sub + + Private ReadOnly _stateToApply As DokumentanforderungState + + Private Sub frmSendungsDokumentanforderung_Load(sender As Object, e As EventArgs) Handles MyBase.Load + VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) + If cmbCustomerUploadLanguage.SelectedIndex < 0 Then + Dim idx = cmbCustomerUploadLanguage.Items.IndexOf("de") + If idx >= 0 Then + cmbCustomerUploadLanguage.SelectedIndex = idx + ElseIf cmbCustomerUploadLanguage.Items.Count > 0 Then + cmbCustomerUploadLanguage.SelectedIndex = 0 + End If + End If + + InitializeDocumentEditor() + SetupDynamicAnforderungCheckboxes() + ApplyStateToUi(_stateToApply) + InitializeKontaktEmailGrid() + LoadKontaktEmails() + End Sub + + Private Sub InitializeKontaktEmailGrid() + If dgvKontaktEmails.Columns.Count > 0 Then Return + dgvKontaktEmails.AutoGenerateColumns = False + + Dim colRolle As New DataGridViewTextBoxColumn() + colRolle.Name = "colRolle" + colRolle.HeaderText = "Rolle" + colRolle.DataPropertyName = "Rolle" + colRolle.Width = 100 + dgvKontaktEmails.Columns.Add(colRolle) + + Dim colArt As New DataGridViewTextBoxColumn() + colArt.Name = "colArt" + colArt.HeaderText = "Art" + colArt.DataPropertyName = "Art" + colArt.Width = 130 + dgvKontaktEmails.Columns.Add(colArt) + + Dim colEmail As New DataGridViewTextBoxColumn() + colEmail.Name = "colEmail" + colEmail.HeaderText = "E-Mail" + colEmail.DataPropertyName = "Email" + colEmail.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + dgvKontaktEmails.Columns.Add(colEmail) + End Sub + + Private Sub LoadKontaktEmails() + _kontaktEmailRows.Clear() + dgvKontaktEmails.Rows.Clear() + + Dim dedupe As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase) + + Dim fraechterKdNr As Integer = 0 + Dim auftraggeberKdNr As Integer = 0 + Dim avisiererKdNr As Integer = 0 + Dim empfaengerKdNr As Integer = 0 + Dim absenderKdNr As Integer = 0 + Dim frachtfuehrerKdNr As Integer = 0 + + Try + If SendungID > 0 Then + Dim dtSnd = AvisoDAL.loadDataTableBySQL("SELECT tblSnd_AvisiererKdNr, tblSnd_AuftraggeberKdNr, tblSnd_EmpfaengerKdNr, tblSnd_AbsenderKdNr, tblSnd_FrachtfuehrerKdNr FROM tblSendungen WHERE tblSnd_SendungID = " & SendungID) + If dtSnd IsNot Nothing AndAlso dtSnd.Rows.Count > 0 Then + Dim r = dtSnd.Rows(0) + avisiererKdNr = ToIntSafe(r("tblSnd_AvisiererKdNr")) + auftraggeberKdNr = ToIntSafe(r("tblSnd_AuftraggeberKdNr")) + empfaengerKdNr = ToIntSafe(r("tblSnd_EmpfaengerKdNr")) + absenderKdNr = ToIntSafe(r("tblSnd_AbsenderKdNr")) + frachtfuehrerKdNr = ToIntSafe(r("tblSnd_FrachtfuehrerKdNr")) + End If + End If + + If AvisoID > 0 Then + Dim dtAviso = AvisoDAL.loadDataTableBySQL("SELECT Frächter_KdNr, Auftraggeber_KdNr FROM tblAviso WHERE AvisoID = " & AvisoID) + If dtAviso IsNot Nothing AndAlso dtAviso.Rows.Count > 0 Then + Dim r = dtAviso.Rows(0) + fraechterKdNr = ToIntSafe(r("Frächter_KdNr")) + If auftraggeberKdNr = 0 Then + auftraggeberKdNr = ToIntSafe(r("Auftraggeber_KdNr")) + End If + End If + End If + Catch + End Try + + AddKontaktEmailsByKunde("Frächter", fraechterKdNr, dedupe) + AddKontaktEmailsByKunde("Avisierer", avisiererKdNr, dedupe) + AddKontaktEmailsByKunde("Auftraggeber", auftraggeberKdNr, dedupe) + AddKontaktEmailsByKunde("Empfänger", empfaengerKdNr, dedupe) + AddKontaktEmailsByKunde("Absender", absenderKdNr, dedupe) + AddKontaktEmailsByKunde("Frachtführer", frachtfuehrerKdNr, dedupe) + + For Each row In _kontaktEmailRows + dgvKontaktEmails.Rows.Add(row.Rolle, row.Art, row.Email) + Next + If If(txtCustomerUploadEmail.Text, "").Trim() = "" AndAlso dgvKontaktEmails.Rows.Count > 0 Then + txtCustomerUploadEmail.Text = If(dgvKontaktEmails.Rows(0).Cells("colEmail").Value, "").ToString().Trim() + End If + End Sub + + Private Sub AddKontaktEmailsByKunde(rolle As String, kundenNr As Integer, dedupe As HashSet(Of String)) + If kundenNr <= 0 Then Return + + ' 1. E-Mails aus Kundenstammdaten laden (direkt von Datenbank) + Try + Dim sql As String = "SELECT E_Mail, E_Mail2 FROM Adressen WHERE AdressenNr = " & kundenNr + Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) + Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) + Using reader = cmd.ExecuteReader() + If reader.Read() Then + Dim email1 = If(reader("E_Mail") Is DBNull.Value, "", reader("E_Mail").ToString().Trim()) + Dim email2 = If(reader("E_Mail2") Is DBNull.Value, "", reader("E_Mail2").ToString().Trim()) + + If email1 <> "" Then + For Each splitEmail In email1.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key1 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key1) Then + dedupe.Add(key1) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + + If email2 <> "" Then + For Each splitEmail In email2.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key2 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key2) Then + dedupe.Add(key2) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + End If + End Using + End Using + End Using + Catch + End Try + + ' 2. E-Mails aus E-Mail-Benachrichtigungen (Sendungsdetails) laden (direkt von Datenbank) + Try + Dim sql As String = "SELECT eb_ebartId, eb_EMail, eb_cc, eb_bcc FROM tblEmailBenachrichtigung WHERE eb_KundenNr = " & kundenNr + Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) + Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) + Using reader = cmd.ExecuteReader() + While reader.Read() + Dim artId = If(reader("eb_ebartId") Is DBNull.Value, 0, Convert.ToInt32(reader("eb_ebartId"))) + Dim email = If(reader("eb_EMail") Is DBNull.Value, "", reader("eb_EMail").ToString().Trim()) + Dim isCc = If(reader("eb_cc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_cc"))) + Dim isBcc = If(reader("eb_bcc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_bcc"))) + + If email = "" Then Continue While + + Dim empfaengerArt = If(isBcc, "BCC", If(isCc, "CC", "AN")) + Dim artText = ResolveMailArtLabel(artId) & " / " & empfaengerArt + + For Each splitEmail In email.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key = rolle & "|" & kundenNr.ToString() & "|" & artText & "|" & em.ToLowerInvariant() + If Not dedupe.Contains(key) Then + dedupe.Add(key) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = artText, .Email = em}) + End If + Next + End While + End Using + End Using + End Using + Catch + End Try + End Sub + + Private Function ResolveMailArtLabel(artId As Integer) As String + Select Case artId + Case 1 + Return "Ankunft" + Case 2 + Return "Freigabe" + Case 3 + Return "Ankunft Export" + Case 4 + Return "Freigabe Export" + Case 5 + Return "Status" + Case Else + Return "Unbekannt" + End Select + End Function + + Private Function ToIntSafe(value As Object) As Integer + Try + If value Is Nothing Then Return 0 + Dim tmp As Integer = 0 + If Integer.TryParse(value.ToString(), tmp) Then Return tmp + Catch + End Try + Return 0 + End Function + + Private Sub dgvKontaktEmails_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvKontaktEmails.CellDoubleClick + If e.RowIndex < 0 OrElse e.RowIndex >= dgvKontaktEmails.Rows.Count Then Return + Dim emailObj = dgvKontaktEmails.Rows(e.RowIndex).Cells("colEmail").Value + Dim email = If(emailObj, "").ToString().Trim() + If email = "" Then Return + txtCustomerUploadEmail.Text = email + End Sub + + Private Sub InitializeDocumentEditor() + RemoveHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + + EnsureAnhangsartenOptionsLoaded() + + RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + cmbDocumentEditorAnhangsart.BeginUpdate() + cmbDocumentEditorAnhangsart.Items.Clear() + For Each optionItem In _anhangsartenOptions + cmbDocumentEditorAnhangsart.Items.Add(optionItem) + Next + cmbDocumentEditorAnhangsart.EndUpdate() + AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + + ClearDocumentEditor() + End Sub + + Private Sub SetupDynamicAnforderungCheckboxes() + _anforderungCheckboxes.Clear() + _anhangsartIdByCheckbox.Clear() + _backendBezeichnungByCodeId.Clear() + _selectedAnhangsartIdByCodeId.Clear() + _documentCustomNameByCodeId.Clear() + _documentBaseTextByCodeId.Clear() + _bereichByCodeId.Clear() + _selectedDocumentCodeId = 0 + + Dim dt As DataTable = Nothing + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Return + End Try + End Try + + If dt Is Nothing OrElse dt.Rows.Count = 0 Then Return + EnsureAnhangsartenOptionsLoaded() + flpDokumenteFehlenMain.Controls.Clear() + + For Each row As DataRow In dt.Rows + Dim id As Integer + Try + id = CInt(row("VermerkCodeId")) + Catch + Continue For + End Try + + Dim bezeichnung = If(IsDBNull(row("Bezeichnung")), "", CStr(row("Bezeichnung"))).Trim() + If bezeichnung = "" Then Continue For + _backendBezeichnungByCodeId(id) = bezeichnung + + Dim frontendBezeichnung = bezeichnung + If dt.Columns.Contains("FrontendBezeichnung") Then + frontendBezeichnung = If(IsDBNull(row("FrontendBezeichnung")), "", CStr(row("FrontendBezeichnung"))).Trim() + If frontendBezeichnung = "" Then frontendBezeichnung = bezeichnung + End If + + If bezeichnung.ToLowerInvariant().Contains("nicht leserlich") Then Continue For + + Dim bereich As Integer = 0 + Try + If Not IsDBNull(row("AnforderungBereich")) Then bereich = CInt(row("AnforderungBereich")) + Catch + End Try + _bereichByCodeId(id) = bereich + If bereich <> BereichDokumentMain Then Continue For + + Dim cb As New CheckBox() + cb.Text = frontendBezeichnung + cb.Tag = id + cb.Margin = New Padding(0, 0, 4, 0) + cb.BackColor = Color.Transparent + cb.UseVisualStyleBackColor = False + ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) + AddHandler cb.CheckedChanged, AddressOf DynamicAnforderungCheckboxChanged + flpDokumenteFehlenMain.Controls.Add(cb) + + Dim anhangsartId As Integer = 0 + Try + If Not IsDBNull(row("AvisoAnhangsartId")) Then anhangsartId = CInt(row("AvisoAnhangsartId")) + Catch + End Try + _anhangsartIdByCheckbox(cb) = anhangsartId + If Not _documentCustomNameByCodeId.ContainsKey(id) Then + _documentCustomNameByCodeId(id) = GetAnhangsartDisplayTextById(anhangsartId) + End If + + _anforderungCheckboxes.Add(cb) + Next + End Sub + + Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) + cb.AutoSize = False + cb.Height = 18 + Dim usableWidth = Math.Max(120, container.Width - 20) + Dim cbWidth = CInt(Math.Floor((usableWidth - 4) / 3)) + cb.Width = Math.Max(80, Math.Min(cbWidth, 220)) + End Sub + + Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) + If _isLoadingDocumentEditor OrElse _selectedDocumentCodeId <= 0 Then Return + _documentCustomNameByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorName.Text, "").Trim() + _documentBaseTextByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorInfo.Text, "").Trim() + + Dim tab = TryCast(flpDocumentTabs.Controls("tab_" & _selectedDocumentCodeId), Panel) + If tab Is Nothing Then Return + Dim lblText = TryCast(tab.Controls("lblText"), Label) + Dim lblClose = TryCast(tab.Controls("lblClose"), Label) + If lblText Is Nothing OrElse lblClose Is Nothing Then Return + lblText.Text = _documentCustomNameByCodeId(_selectedDocumentCodeId) + If lblText.Text = "" Then lblText.Text = "Unbenannt" + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + tab.Width = lblClose.Right + 5 + End Sub + + Private Sub DocumentEditorAnhangsartChanged(sender As Object, e As EventArgs) + If _isLoadingDocumentEditor OrElse _selectedDocumentCodeId <= 0 Then Return + Dim selected = TryCast(cmbDocumentEditorAnhangsart.SelectedItem, AnhangsartOption) + If selected Is Nothing Then Return + _selectedAnhangsartIdByCodeId(_selectedDocumentCodeId) = selected.Id + End Sub + + Private Sub EnsureAnhangsartenOptionsLoaded() + If _anhangsartenOptions.Count > 0 Then Return + Dim dt As DataTable = Nothing + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [aa_id],[aa_bezeichnung],[aa_name] FROM [tblAvisoAnhangsarten] WHERE [aa_aktiv]=1 ORDER BY [aa_sort],[aa_bezeichnung]") + Catch + Return + End Try + If dt Is Nothing Then Return + + For Each row As DataRow In dt.Rows + Dim id As Integer = 0 + Try + id = CInt(row("aa_id")) + Catch + Continue For + End Try + If id <= 0 Then Continue For + + Dim alreadyAdded As Boolean = False + For Each existing In _anhangsartenOptions + If existing.Id = id Then + alreadyAdded = True + Exit For + End If + Next + If alreadyAdded Then Continue For + + Dim text = If(IsDBNull(row("aa_bezeichnung")), "", CStr(row("aa_bezeichnung"))).Trim() + If text = "" Then text = If(IsDBNull(row("aa_name")), "", CStr(row("aa_name"))).Trim() + If text = "" Then text = "#" & id.ToString() + _anhangsartenOptions.Add(New AnhangsartOption(id, text)) + Next + End Sub + + Private Sub SelectAnhangsartInEditor(anhangsartId As Integer) + cmbDocumentEditorAnhangsart.SelectedIndex = -1 + If anhangsartId <= 0 Then Return + For i = 0 To cmbDocumentEditorAnhangsart.Items.Count - 1 + Dim optionItem = TryCast(cmbDocumentEditorAnhangsart.Items(i), AnhangsartOption) + If optionItem IsNot Nothing AndAlso optionItem.Id = anhangsartId Then + cmbDocumentEditorAnhangsart.SelectedIndex = i + Exit For + End If + Next + End Sub + + Private Function GetAnhangsartDisplayTextById(anhangsartId As Integer) As String + If anhangsartId <= 0 Then Return "" + EnsureAnhangsartenOptionsLoaded() + For Each optionItem In _anhangsartenOptions + If optionItem.Id = anhangsartId Then Return If(optionItem.Text, "").Trim() + Next + Return "" + End Function + + Private Function TryGetCheckboxCodeId(cb As CheckBox, ByRef codeId As Integer) As Boolean + codeId = 0 + If cb Is Nothing OrElse cb.Tag Is Nothing Then Return False + Return Integer.TryParse(cb.Tag.ToString(), codeId) AndAlso codeId > 0 + End Function + + Private Sub ClearDocumentEditor() + _selectedDocumentCodeId = 0 + _isLoadingDocumentEditor = True + txtDocumentEditorName.Text = "" + txtDocumentEditorInfo.Text = "" + cmbDocumentEditorAnhangsart.SelectedIndex = -1 + _isLoadingDocumentEditor = False + lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + End Sub + + Private Sub SelectDocument(codeId As Integer) + _selectedDocumentCodeId = codeId + If codeId <= 0 Then + ClearDocumentEditor() + SyncTabs() + Return + End If + + Dim targetCb As CheckBox = Nothing + For Each cb In _anforderungCheckboxes + If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then + targetCb = cb + Exit For + End If + Next + If targetCb Is Nothing Then Return + + Dim anhangsartId = GetEffectiveAnhangsartId(targetCb) + Dim customName = "" + If _documentCustomNameByCodeId.ContainsKey(codeId) Then + customName = If(_documentCustomNameByCodeId(codeId), "").Trim() + Else + customName = GetAnhangsartDisplayTextById(anhangsartId) + _documentCustomNameByCodeId(codeId) = customName + End If + Dim baseText = GetDocumentBaseTextByCodeId(codeId) + + _isLoadingDocumentEditor = True + txtDocumentEditorName.Text = customName + txtDocumentEditorInfo.Text = baseText + SelectAnhangsartInEditor(anhangsartId) + _isLoadingDocumentEditor = False + + If anhangsartId > 0 Then _selectedAnhangsartIdByCodeId(codeId) = anhangsartId + lblDocumentEditorStatus.ForeColor = Color.FromArgb(0, 102, 153) + lblDocumentEditorStatus.Text = "Ausgewählt: " & If(targetCb.Text, "").Trim() + SyncTabs() + End Sub + + Private Function CreateTab(codeId As Integer, text As String) As Panel + Dim pnl As New Panel() + pnl.Name = "tab_" & codeId + pnl.Tag = codeId + pnl.Height = 28 + pnl.BackColor = Color.White + pnl.BorderStyle = BorderStyle.FixedSingle + pnl.Margin = New Padding(2, 4, 2, 0) + pnl.Cursor = Cursors.Hand + + Dim lblText As New Label() + lblText.Name = "lblText" + lblText.Text = If(text = "", "Unbenannt", text) + lblText.AutoSize = True + lblText.Location = New Point(5, 5) + lblText.Tag = codeId + lblText.Cursor = Cursors.Hand + AddHandler lblText.Click, AddressOf Tab_Click + pnl.Controls.Add(lblText) + + Dim lblClose As New Label() + lblClose.Name = "lblClose" + lblClose.Text = "X" + lblClose.AutoSize = True + lblClose.ForeColor = Color.Red + lblClose.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Bold) + lblClose.Cursor = Cursors.Hand + lblClose.Tag = codeId + AddHandler lblClose.Click, AddressOf TabClose_Click + pnl.Controls.Add(lblClose) + + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + pnl.Width = lblClose.Right + 5 + + AddHandler pnl.Click, AddressOf Tab_Click + Return pnl + End Function + + Private Sub SyncTabs() + flpDocumentTabs.SuspendLayout() + Dim requiredCodeIds As New List(Of Integer) + For Each cb In _anforderungCheckboxes + If cb.Checked Then + Dim codeId As Integer = 0 + If Integer.TryParse(cb.Tag.ToString(), codeId) Then requiredCodeIds.Add(codeId) + End If + Next + + Dim i = flpDocumentTabs.Controls.Count - 1 + While i >= 0 + Dim pnl = TryCast(flpDocumentTabs.Controls(i), Panel) + If pnl IsNot Nothing Then + Dim codeId = CInt(pnl.Tag) + If Not requiredCodeIds.Contains(codeId) Then + flpDocumentTabs.Controls.RemoveAt(i) + pnl.Dispose() + End If + End If + i -= 1 + End While + + For Each codeId In requiredCodeIds + Dim existingTab = TryCast(flpDocumentTabs.Controls("tab_" & codeId), Panel) + Dim text = If(_documentCustomNameByCodeId.ContainsKey(codeId), _documentCustomNameByCodeId(codeId), "") + If existingTab Is Nothing Then + existingTab = CreateTab(codeId, text) + flpDocumentTabs.Controls.Add(existingTab) + Else + Dim lblText = TryCast(existingTab.Controls("lblText"), Label) + Dim lblClose = TryCast(existingTab.Controls("lblClose"), Label) + If lblText IsNot Nothing AndAlso lblClose IsNot Nothing Then + lblText.Text = If(text = "", "Unbenannt", text) + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + existingTab.Width = lblClose.Right + 5 + End If + End If + + If codeId = _selectedDocumentCodeId Then + existingTab.BackColor = Color.White + existingTab.BorderStyle = BorderStyle.FixedSingle + existingTab.Height = 28 + existingTab.Margin = New Padding(2, 2, 2, 0) + Else + existingTab.BackColor = Color.LightGray + existingTab.BorderStyle = BorderStyle.None + existingTab.Height = 25 + existingTab.Margin = New Padding(2, 5, 2, 0) + End If + Next + + flpDocumentTabs.ResumeLayout() + If _selectedDocumentCodeId > 0 AndAlso Not requiredCodeIds.Contains(_selectedDocumentCodeId) Then + If requiredCodeIds.Count > 0 Then + SelectDocument(requiredCodeIds(0)) + Else + ClearDocumentEditor() + End If + ElseIf _selectedDocumentCodeId = 0 AndAlso requiredCodeIds.Count > 0 Then + SelectDocument(requiredCodeIds(0)) + End If + End Sub + + Private Sub Tab_Click(sender As Object, e As EventArgs) + Dim ctrl = TryCast(sender, Control) + If ctrl Is Nothing OrElse ctrl.Tag Is Nothing Then Return + Dim codeId As Integer = 0 + If Integer.TryParse(ctrl.Tag.ToString(), codeId) Then SelectDocument(codeId) + End Sub + + Private Sub TabClose_Click(sender As Object, e As EventArgs) + Dim ctrl = TryCast(sender, Control) + If ctrl Is Nothing OrElse ctrl.Tag Is Nothing Then Return + Dim codeId As Integer = 0 + If Not Integer.TryParse(ctrl.Tag.ToString(), codeId) Then Return + For Each cb In _anforderungCheckboxes + If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then + cb.Checked = False + Exit For + End If + Next + End Sub + + Private Function GetEffectiveDocumentName(cb As CheckBox) As String + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) AndAlso _documentCustomNameByCodeId.ContainsKey(codeId) Then + Return If(_documentCustomNameByCodeId(codeId), "").Trim() + End If + Return "" + End Function + + Private Function GetDocumentBaseText(cb As CheckBox) As String + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) Then Return GetDocumentBaseTextByCodeId(codeId) + Return DefaultDocumentBaseText + End Function + + Private Function GetDocumentBaseTextByCodeId(codeId As Integer) As String + If codeId > 0 AndAlso _documentBaseTextByCodeId.ContainsKey(codeId) Then + Dim configuredBaseText = If(_documentBaseTextByCodeId(codeId), "").Trim() + If configuredBaseText <> "" Then Return configuredBaseText + End If + Return DefaultDocumentBaseText + End Function + + Private Function GetEffectiveAnhangsartId(cb As CheckBox) As Integer + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) Then + If _selectedAnhangsartIdByCodeId.ContainsKey(codeId) AndAlso _selectedAnhangsartIdByCodeId(codeId) > 0 Then + Return _selectedAnhangsartIdByCodeId(codeId) + End If + End If + Dim defaultId As Integer = 0 + If _anhangsartIdByCheckbox.TryGetValue(cb, defaultId) Then Return defaultId + Return 0 + End Function + + Private Function BuildUploadCustomText(baseText As String) As String + Dim effectiveBaseText = If(baseText, "").Trim() + If effectiveBaseText = "" Then effectiveBaseText = DefaultDocumentBaseText + Return effectiveBaseText + End Function + + Private Function ValidateDocumentSelectionPayload(documentName As String, baseText As String, anhangsartId As Integer, ByRef validationError As String) As Boolean + validationError = "" + If anhangsartId <= 0 Then validationError = "ANHANGSART_ID_FEHLT" : Return False + documentName = If(documentName, "").Trim() + If documentName = "" Then validationError = "DOKUMENTNAME_FEHLT" : Return False + If documentName.Length > 120 Then validationError = "DOKUMENTNAME_ZU_LANG" : Return False + If If(baseText, "").Trim().Length > 500 Then validationError = "BASETEXT_ZU_LANG" : Return False + Return True + End Function + + Private Sub DynamicAnforderungCheckboxChanged(sender As Object, e As EventArgs) + Dim cb = TryCast(sender, CheckBox) + If cb Is Nothing Then Return + If cb.Checked Then + Dim codeId As Integer = 0 + If Integer.TryParse(cb.Tag.ToString(), codeId) Then SelectDocument(codeId) + Else + SyncTabs() + End If + End Sub + + Private Function HasPrimaryDokumentSelection() As Boolean + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb IsNot Nothing AndAlso cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then + If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then + Return True + End If + End If + Next + Return False + End Function + + Private Sub SonstChanged(sender As Object, e As EventArgs) Handles txtSonstigesDokumentFehlt.TextChanged + cbxSonstDok.Checked = (sender.text <> "") + End Sub + + Private Sub btnVermerkSetzen_Click(sender As Object, e As EventArgs) Handles btnVermerkSetzen.Click + lblErrDokument.Visible = False + If Not HasPrimaryDokumentSelection() AndAlso Not cbxSonstDok.Checked AndAlso Not cbxNichtLeserlich.Checked Then + lblErrDokument.Visible = True + Exit Sub + End If + If cbxSonstDok.Checked AndAlso txtSonstigesDokumentFehlt.Text.Trim = "" Then + lblErrDokument.Visible = True + txtSonstigesDokumentFehlt.Focus() + Exit Sub + End If + DialogResult = DialogResult.OK + Close() + End Sub + + Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click + Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) + Dim config = GetCustomerPortalApiConfig() + If config Is Nothing Then Exit Sub + + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then + MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) + Exit Sub + End If + + Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing + Dim anhangsartenErr = "" + If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then + MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) + Exit Sub + End If + + Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) + If requirements Is Nothing Then Exit Sub + If requirements.Count = 0 Then + MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) + Label20.ForeColor = Color.Red + Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." + Exit Sub + End If + Label20.ForeColor = Color.FromArgb(0, 102, 153) + Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + + Cursor = Cursors.WaitCursor + Try + Dim linkUrl = "" + Dim errorCode = "" + If Not TryCreateCustomerUploadLinkMultiWithoutEmail(config, requirements, validityHours, linkUrl, errorCode) Then + MsgBox("Fehler beim Erzeugen des Upload-Links: " & errorCode, vbExclamation) + Exit Sub + End If + If linkUrl <> "" Then + Clipboard.SetText(linkUrl) + MsgBox("Upload-Link wurde in die Zwischenablage kopiert.", vbInformation) + Else + MsgBox("Upload-Link konnte nicht aus der Antwort gelesen werden.", vbExclamation) + End If + Finally + Cursor = Cursors.Default + End Try + End Sub + + Private Sub btnCustomerUploadEmail_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadEmail.Click + Dim recipient = If(txtCustomerUploadEmail.Text, "").Trim() + If recipient = "" Then MsgBox("Bitte eine E-Mail-Adresse eingeben.", vbInformation) : txtCustomerUploadEmail.Focus() : Exit Sub + Try + Dim addr As New MailAddress(recipient) + recipient = addr.Address + Catch + MsgBox("E-Mail-Adresse ist ungültig.", vbInformation) + txtCustomerUploadEmail.Focus() + Exit Sub + End Try + + Dim emailText = If(txtCustomerUploadEmailText.Text, "").Trim() + If emailText = "" Then MsgBox("Bitte den Text eintragen.", vbInformation) : txtCustomerUploadEmailText.Focus() : Exit Sub + + Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) + Dim language = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) + language = language.ToLowerInvariant() + If language <> "de" AndAlso language <> "en" AndAlso language <> "tr" AndAlso language <> "sr" AndAlso language <> "bg" Then language = "de" + + Dim config = GetCustomerPortalApiConfig() + If config Is Nothing Then Exit Sub + + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) : Exit Sub + + Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing + Dim anhangsartenErr = "" + If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) : Exit Sub + + Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) + If requirements Is Nothing Then Exit Sub + If requirements.Count = 0 Then + MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) + Label20.ForeColor = Color.Red + Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." + Exit Sub + End If + Label20.ForeColor = Color.FromArgb(0, 102, 153) + Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + + Cursor = Cursors.WaitCursor + Try + Dim linkUrl = "" + Dim errorCode = "" + If Not TryRequestCustomerUploadLinkMultiWithEmail(config, requirements, recipient, emailText, language, validityHours, linkUrl, errorCode) Then + MsgBox("Fehler beim Versand der E-Mail: " & errorCode, vbExclamation) + Exit Sub + End If + If linkUrl <> "" Then Clipboard.SetText(linkUrl) + MsgBox("E-Mail wurde ausgelöst.", vbInformation) + Finally + Cursor = Cursors.Default + End Try + End Sub + + Public Function BuildState() As DokumentanforderungState + Dim result As New DokumentanforderungState() + result.SelectedCodeIds = New List(Of Integer) + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then result.SelectedCodeIds.Add(codeId) + Next + result.SelectedAnhangsartIdByCodeId = New Dictionary(Of Integer, Integer)(_selectedAnhangsartIdByCodeId) + result.DocumentCustomNameByCodeId = New Dictionary(Of Integer, String)(_documentCustomNameByCodeId) + result.DocumentBaseTextByCodeId = New Dictionary(Of Integer, String)(_documentBaseTextByCodeId) + result.SonstDokChecked = cbxSonstDok.Checked + result.SonstigesDokumentName = If(txtSonstigesDokumentFehlt.Text, "").Trim() + result.NichtLeserlichChecked = cbxNichtLeserlich.Checked + result.CustomerUploadEmail = If(txtCustomerUploadEmail.Text, "").Trim() + result.CustomerUploadLanguage = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) + result.CustomerUploadEmailText = If(txtCustomerUploadEmailText.Text, "").Trim() + result.CustomerUploadValidityHours = CInt(nudCustomerUploadValidityHours.Value) + Return result + End Function + + Private Sub ApplyStateToUi(state As DokumentanforderungState) + If state Is Nothing Then Return + _selectedAnhangsartIdByCodeId.Clear() + _documentCustomNameByCodeId.Clear() + _documentBaseTextByCodeId.Clear() + For Each kvp In state.SelectedAnhangsartIdByCodeId + _selectedAnhangsartIdByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentCustomNameByCodeId + _documentCustomNameByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentBaseTextByCodeId + _documentBaseTextByCodeId(kvp.Key) = kvp.Value + Next + + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + cb.Checked = Integer.TryParse(If(cb.Tag, "").ToString(), codeId) AndAlso state.SelectedCodeIds.Contains(codeId) + Next + + cbxSonstDok.Checked = state.SonstDokChecked + txtSonstigesDokumentFehlt.Text = If(state.SonstigesDokumentName, "") + cbxNichtLeserlich.Checked = state.NichtLeserlichChecked + txtCustomerUploadEmail.Text = If(state.CustomerUploadEmail, "") + txtCustomerUploadEmailText.Text = If(state.CustomerUploadEmailText, "Bitte laden Sie die angeforderten Dokumente über den Link hoch.") + nudCustomerUploadValidityHours.Value = Math.Max(nudCustomerUploadValidityHours.Minimum, Math.Min(nudCustomerUploadValidityHours.Maximum, state.CustomerUploadValidityHours)) + + Dim language = If(state.CustomerUploadLanguage, "").Trim().ToLowerInvariant() + Dim idx = cmbCustomerUploadLanguage.Items.IndexOf(language) + If idx >= 0 Then cmbCustomerUploadLanguage.SelectedIndex = idx + SyncTabs() + End Sub + + Private Class CustomerPortalApiConfig + Public Property BaseUrl As String + Public Property Username As String + Public Property Password As String + End Class + + Private Function GetCustomerPortalApiConfig() As CustomerPortalApiConfig + Dim baseUrl = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_BASEURL"), "").Trim() + If baseUrl = "" Then baseUrl = If(ConfigurationManager.AppSettings("CustomerPortalApiBaseUrl"), "").Trim() + If baseUrl = "" Then baseUrl = "https://login.server.verag.ag" + Dim username = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_USERNAME"), "").Trim() + If username = "" Then username = If(ConfigurationManager.AppSettings("CustomerPortalApiUsername"), "").Trim() + Dim password = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_PASSWORD"), "").Trim() + If password = "" Then password = If(ConfigurationManager.AppSettings("CustomerPortalApiPassword"), "").Trim() + If username = "" OrElse password = "" Then + MsgBox("CustomerPortalApiUsername/CustomerPortalApiPassword fehlt in App.config (oder ENV: AVISO_CUSTOMERPORTAL_API_USERNAME / AVISO_CUSTOMERPORTAL_API_PASSWORD).", vbExclamation) + Return Nothing + End If + Return New CustomerPortalApiConfig With {.BaseUrl = baseUrl, .Username = username, .Password = password} + End Function + + Private Function TryGetCustomerPortalJwtToken(ByVal config As CustomerPortalApiConfig, ByRef jwtToken As String, ByRef errorCode As String) As Boolean + jwtToken = "" + errorCode = "" + If _customerPortalJwtToken <> "" Then + If _customerPortalJwtExpUtc = DateTime.MinValue OrElse DateTime.UtcNow < _customerPortalJwtExpUtc.AddMinutes(-1) Then + jwtToken = _customerPortalJwtToken + Return True + End If + End If + + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/auth/login" + Dim payload As New Dictionary(Of String, Object) From {{"username", config.Username}, {"password", config.Password}} + Dim jsonBody = JsonConvert.SerializeObject(payload) + Try + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "POST" + request.ContentType = "application/json" + request.Accept = "application/json" + request.Timeout = 15000 + Using requestStream = request.GetRequestStream() + Using writer As New StreamWriter(requestStream, Encoding.UTF8) + writer.Write(jsonBody) + End Using + End Using + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = reader.ReadToEnd() + Dim jobj = JObject.Parse(respText) + Dim token = (If(jobj("token"), New JValue(""))).ToString().Trim() + If token = "" Then errorCode = "TOKEN_MISSING" : Return False + _customerPortalJwtToken = token + _customerPortalJwtExpUtc = ExtractJwtExpUtcOrMin(token) + jwtToken = token + Return True + End Using + End Using + Catch ex As WebException + errorCode = ReadWebExceptionMessage(ex) + Return False + Catch ex As Exception + errorCode = ex.Message + Return False + End Try + End Function + + Private Function ExtractJwtExpUtcOrMin(ByVal jwt As String) As DateTime + Try + Dim parts = If(jwt, "").Split("."c) + If parts.Length < 2 Then Return DateTime.MinValue + Dim payloadJson = Encoding.UTF8.GetString(Base64UrlDecode(parts(1))) + Dim jobj = JObject.Parse(payloadJson) + Dim expToken = jobj("exp") + If expToken Is Nothing Then Return DateTime.MinValue + Dim expSeconds As Long + If Long.TryParse(expToken.ToString(), expSeconds) Then Return DateTimeOffset.FromUnixTimeSeconds(expSeconds).UtcDateTime + Catch + End Try + Return DateTime.MinValue + End Function + + Private Function Base64UrlDecode(ByVal input As String) As Byte() + Dim s = If(input, "").Replace("-"c, "+"c).Replace("_"c, "/"c) + Select Case (s.Length Mod 4) + Case 2 + s &= "==" + Case 3 + s &= "=" + End Select + Return Convert.FromBase64String(s) + End Function + + Private Function BuildCustomerUploadRequirements(ByVal anhangsartenMap As Dictionary(Of String, Integer)) As List(Of Object) + Dim requirements As New List(Of Object) + Dim missing As New List(Of String) + + For Each cb In _anforderungCheckboxes + If cb Is Nothing OrElse Not cb.Checked Then Continue For + Dim documentType = GetEffectiveDocumentName(cb) + If documentType = "" Then Continue For + Dim baseText = GetDocumentBaseText(cb) + Dim validationError = "" + Dim anhangsartId = GetEffectiveAnhangsartId(cb) + If anhangsartId <= 0 Then missing.Add(documentType) : Continue For + If Not ValidateDocumentSelectionPayload(documentType, baseText, anhangsartId, validationError) Then + MsgBox("Ungültige Eingabe für Dokument '" & documentType & "': " & validationError, vbInformation) + Return Nothing + End If + AddCustomerUploadRequirementByAnhangsartId(requirements, documentType, anhangsartId, BuildUploadCustomText(baseText)) + Next + + If cbxSonstDok.Checked Then + Dim custom = If(txtSonstigesDokumentFehlt.Text, "").Trim() + If custom = "" Then + MsgBox("Bitte den Dokumentnamen eintragen.", vbInformation) + txtSonstigesDokumentFehlt.Focus() + Return Nothing + End If + AddCustomerUploadRequirement(requirements, missing, anhangsartenMap, True, custom, {"SONSTIGES", "DOKUMENT"}, "Bitte " & custom & " hochladen.", True) + End If + + If missing.Count > 0 Then + MsgBox("Anhangsarten nicht gefunden: " & String.Join(", ", missing), vbExclamation) + Return Nothing + End If + Return requirements + End Function + + Private Sub AddCustomerUploadRequirementByAnhangsartId(ByVal requirements As List(Of Object), ByVal documentType As String, ByVal anhangsartId As Integer, ByVal customText As String) + If requirements Is Nothing OrElse anhangsartId <= 0 Then Exit Sub + requirements.Add(New Dictionary(Of String, Object) From {{"documentType", documentType}, {"anhangsartId", anhangsartId}, {"customText", customText}}) + End Sub + + Private Sub AddCustomerUploadRequirement(ByVal requirements As List(Of Object), ByVal missing As List(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer), ByVal isSelected As Boolean, ByVal documentType As String, ByVal anhangsartenCandidates As String(), ByVal customText As String, ByVal allowCustomFilename As Boolean) + If Not isSelected Then Exit Sub + Dim anhangsartId = ResolveAnhangsartId(anhangsartenCandidates, anhangsartenMap) + If anhangsartId <= 0 AndAlso allowCustomFilename AndAlso _customerPortalCustomFilenameAnhangsartId > 0 Then anhangsartId = _customerPortalCustomFilenameAnhangsartId + If anhangsartId <= 0 Then missing.Add(documentType) : Exit Sub + requirements.Add(New Dictionary(Of String, Object) From {{"documentType", documentType}, {"anhangsartId", anhangsartId}, {"customText", customText}}) + End Sub + + Private Function ResolveAnhangsartId(ByVal candidates As IEnumerable(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer)) As Integer + If candidates Is Nothing OrElse anhangsartenMap Is Nothing Then Return -1 + For Each c In candidates + Dim key = If(c, "").Trim() + If key = "" Then Continue For + Dim id As Integer + If anhangsartenMap.TryGetValue(key.ToUpperInvariant(), id) Then Return id + Next + Return -1 + End Function + + Private Function TryGetCustomerPortalAnhangsartenMap(ByVal config As CustomerPortalApiConfig, ByVal jwtToken As String, ByRef anhangsartenMap As Dictionary(Of String, Integer), ByRef errorCode As String) As Boolean + anhangsartenMap = Nothing + errorCode = "" + If _customerPortalAnhangsartenMap IsNot Nothing AndAlso _customerPortalAnhangsartenFetchedUtc <> DateTime.MinValue Then + If DateTime.UtcNow < _customerPortalAnhangsartenFetchedUtc.AddMinutes(30) Then + anhangsartenMap = _customerPortalAnhangsartenMap + Return True + End If + End If + + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/AvisoUpload/anhangsarten/all" + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "GET" + request.Accept = "application/json" + request.Timeout = 15000 + request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken + Try + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = If(reader.ReadToEnd(), "").Trim() + Dim map As New Dictionary(Of String, Integer)(StringComparer.OrdinalIgnoreCase) + Dim customFilenameId As Integer = -1 + If respText.StartsWith("[") Then + Dim arr = JArray.Parse(respText) + For Each t In arr + Dim id = 0 + If t("id") IsNot Nothing AndAlso Integer.TryParse(t("id").ToString(), id) Then + Dim name = (If(t("name"), New JValue(""))).ToString().Trim() + Dim bez = (If(t("bezeichnung"), New JValue(""))).ToString().Trim() + If name <> "" Then map(name.ToUpperInvariant()) = id + If bez <> "" Then map(bez.ToUpperInvariant()) = id + If id = 24 Then customFilenameId = 24 + End If + Next + ElseIf respText.StartsWith("{") Then + Dim jobj = JObject.Parse(respText) + errorCode = (If(jobj("message"), If(jobj("code"), New JValue("ANHANGSARTEN_LOAD_FAILED")))).ToString() + Return False + Else + errorCode = "ANHANGSARTEN_INVALID_RESPONSE" + Return False + End If + If map.Count = 0 Then errorCode = "ANHANGSARTEN_EMPTY" : Return False + _customerPortalCustomFilenameAnhangsartId = customFilenameId + _customerPortalAnhangsartenMap = map + _customerPortalAnhangsartenFetchedUtc = DateTime.UtcNow + anhangsartenMap = map + Return True + End Using + End Using + Catch ex As WebException + errorCode = ReadWebExceptionMessage(ex) + Return False + Catch ex As Exception + errorCode = ex.Message + Return False + End Try + End Function + + Private Function TryCreateCustomerUploadLinkMultiWithoutEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + linkUrl = "" + errorCode = "" + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/create-upload-link-multi" + Dim payload As New Dictionary(Of String, Object) From {{"avisoId", AvisoID}, {"validityHours", validityHours}, {"requirements", requirements}} + If SendungID > 0 Then payload("sendungsId") = SendungID + Dim jsonBody = JsonConvert.SerializeObject(payload) + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then errorCode = authErr : Return False + Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) + End Function + + Private Function TryRequestCustomerUploadLinkMultiWithEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal recipientEmail As String, ByVal emailText As String, ByVal language As String, ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + linkUrl = "" + errorCode = "" + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/request-upload-link-multi" + If language Is Nothing OrElse language.Trim() = "" Then language = "de" + Dim payload As New Dictionary(Of String, Object) From {{"avisoId", AvisoID}, {"emailText", emailText}, {"language", language}, {"validityHours", validityHours}, {"requirements", requirements}} + If SendungID > 0 Then payload("sendungsId") = SendungID + payload("recipientEmail") = recipientEmail + Dim jsonBody = JsonConvert.SerializeObject(payload) + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then errorCode = authErr : Return False + Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) + End Function + + Private Function TryPostCustomerPortalJson(ByVal url As String, ByVal jwtToken As String, ByVal jsonBody As String, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "POST" + request.ContentType = "application/json" + request.Accept = "application/json" + request.Timeout = 15000 + request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken + Using requestStream = request.GetRequestStream() + Using writer As New StreamWriter(requestStream, Encoding.UTF8) + writer.Write(jsonBody) + End Using + End Using + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = reader.ReadToEnd() + Dim jobj = JObject.Parse(respText) + Dim result = (If(jobj("result"), New JValue(""))).ToString() + If String.Equals(result, "pass", StringComparison.OrdinalIgnoreCase) Then + Dim link = (If(jobj.SelectToken("data.linkUrl"), New JValue(""))).ToString() + If link = "" Then link = (If(jobj.SelectToken("linkUrl"), New JValue(""))).ToString() + linkUrl = link + Return True + End If + errorCode = (If(jobj("message"), New JValue("UNKNOWN_ERROR"))).ToString() + Return False + End Using + End Using + End Function + + Private Function ReadWebExceptionMessage(ByVal ex As WebException) As String + Dim body = "" + Try + If ex.Response IsNot Nothing Then + Using respStream = ex.Response.GetResponseStream() + If respStream IsNot Nothing Then + Using reader As New StreamReader(respStream, Encoding.UTF8) + body = reader.ReadToEnd() + End Using + End If + End Using + End If + Catch + End Try + If body <> "" Then + Try + Dim jobj = JObject.Parse(body) + Return (If(jobj("message"), New JValue(ex.Message))).ToString() + Catch + Return ex.Message + End Try + End If + Return ex.Message + End Function + + Private Class AnhangsartOption + Public ReadOnly Id As Integer + Public ReadOnly Text As String + Public Sub New(id As Integer, text As String) + Me.Id = id + Me.Text = If(text, "").Trim() + End Sub + Public Overrides Function ToString() As String + Return Text + End Function + End Class + + Private Class KontaktEmailRow + Public Property Rolle As String + Public Property Art As String + Public Property Email As String + End Class + + Public Class DokumentanforderungState + Public Property SelectedCodeIds As New List(Of Integer) + Public Property SelectedAnhangsartIdByCodeId As New Dictionary(Of Integer, Integer) + Public Property DocumentCustomNameByCodeId As New Dictionary(Of Integer, String) + Public Property DocumentBaseTextByCodeId As New Dictionary(Of Integer, String) + Public Property SonstDokChecked As Boolean + Public Property SonstigesDokumentName As String + Public Property NichtLeserlichChecked As Boolean + Public Property CustomerUploadEmail As String + Public Property CustomerUploadLanguage As String = "de" + Public Property CustomerUploadEmailText As String = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + Public Property CustomerUploadValidityHours As Integer = 168 + End Class +End Class From 9637994b118a568e86d84c0e930292f630eadf3d Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 26 Mar 2026 09:30:57 +0100 Subject: [PATCH 2/2] vermerke --- Aviso/Aviso.vbproj | 3 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 436 +----- Aviso/frmAddSendungsvermerkShort.vb | 1406 +----------------- Aviso/frmSendungsDokumentanforderung.vb | 267 ++-- 5 files changed, 252 insertions(+), 1864 deletions(-) diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 0a46de0..53df2d3 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -1536,6 +1536,7 @@ frmLogin.vb + Designer frmAuswahl_Aviso.vb @@ -2133,4 +2134,4 @@ --> - + \ No newline at end of file diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index e8298a3..5d87ae2 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmAddSendungsvermerkShort.Designer.vb b/Aviso/frmAddSendungsvermerkShort.Designer.vb index 3dfc1f0..9e37c70 100644 --- a/Aviso/frmAddSendungsvermerkShort.Designer.vb +++ b/Aviso/frmAddSendungsvermerkShort.Designer.vb @@ -27,22 +27,7 @@ Partial Class frmAddSendungsvermerkShort Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.pnlMain = New System.Windows.Forms.Panel() Me.pnlSendungsVermker = New System.Windows.Forms.Panel() - Me.PictureBox1 = New System.Windows.Forms.PictureBox() - Me.pnlDocumentEditor = New System.Windows.Forms.Panel() - Me.flpDocumentTabs = New System.Windows.Forms.FlowLayoutPanel() - Me.lblDocumentEditorTitle = New System.Windows.Forms.Label() - Me.lblDocumentEditorName = New System.Windows.Forms.Label() - Me.txtDocumentEditorName = New System.Windows.Forms.TextBox() - Me.lblDocumentEditorAnhangsart = New System.Windows.Forms.Label() - Me.cmbDocumentEditorAnhangsart = New System.Windows.Forms.ComboBox() - Me.lblDocumentEditorInfo = New System.Windows.Forms.Label() - Me.txtDocumentEditorInfo = New System.Windows.Forms.TextBox() - Me.lblDocumentEditorStatus = New System.Windows.Forms.Label() - Me.flpDokumenteFehlenMain = New System.Windows.Forms.FlowLayoutPanel() - Me.lblSonstigeVermerke = New System.Windows.Forms.Label() Me.flpAngefordert = New System.Windows.Forms.FlowLayoutPanel() - Me.Label5 = New System.Windows.Forms.Label() - Me.txtSonstigesDokumentFehlt = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.optFremd_ATB = New System.Windows.Forms.CheckBox() Me.optFremd_SendungAvisiert = New System.Windows.Forms.CheckBox() @@ -60,35 +45,18 @@ Partial Class frmAddSendungsvermerkShort Me.Label3 = New System.Windows.Forms.Label() Me.lblErr240Zeichen = New System.Windows.Forms.Label() Me.txtDetail = New System.Windows.Forms.TextBox() - Me.btnCustomerUploadLink = New System.Windows.Forms.Button() - Me.btnCustomerUploadEmail = New System.Windows.Forms.Button() - Me.txtCustomerUploadEmail = New System.Windows.Forms.TextBox() - Me.lblCustomerUploadEmail = New System.Windows.Forms.Label() - Me.lblCustomerUploadValidityHours = New System.Windows.Forms.Label() - Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() - Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() - Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() - Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() - Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() Me.lblZustzlFreitext = New System.Windows.Forms.Label() Me.txtSendungSpedition = New System.Windows.Forms.TextBox() - Me.cbxNichtLeserlich = New System.Windows.Forms.CheckBox() Me.btnOK = New System.Windows.Forms.Button() Me.btnDokumtanforderung = New System.Windows.Forms.Button() - Me.cbxSonstDok = New System.Windows.Forms.CheckBox() Me.Label9 = New System.Windows.Forms.Label() Me.Label17 = New System.Windows.Forms.Label() Me.Label13 = New System.Windows.Forms.Label() Me.txtFreierText = New System.Windows.Forms.TextBox() - Me.Label20 = New System.Windows.Forms.Label() Me.PictureBox4 = New System.Windows.Forms.PictureBox() - Me.lblErrDokument = New System.Windows.Forms.Label() Me.Panel4 = New System.Windows.Forms.Panel() Me.pnlMain.SuspendLayout() Me.pnlSendungsVermker.SuspendLayout() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.pnlDocumentEditor.SuspendLayout() - CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' @@ -104,20 +72,14 @@ Partial Class frmAddSendungsvermerkShort Me.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlMain.Location = New System.Drawing.Point(0, 0) Me.pnlMain.Name = "pnlMain" - Me.pnlMain.Size = New System.Drawing.Size(474, 790) + Me.pnlMain.Size = New System.Drawing.Size(474, 400) Me.pnlMain.TabIndex = 0 ' 'pnlSendungsVermker ' Me.pnlSendungsVermker.BackColor = System.Drawing.Color.White Me.pnlSendungsVermker.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) - Me.pnlSendungsVermker.Controls.Add(Me.pnlDocumentEditor) - Me.pnlSendungsVermker.Controls.Add(Me.flpDokumenteFehlenMain) - Me.pnlSendungsVermker.Controls.Add(Me.lblSonstigeVermerke) Me.pnlSendungsVermker.Controls.Add(Me.flpAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.Label5) - Me.pnlSendungsVermker.Controls.Add(Me.txtSonstigesDokumentFehlt) Me.pnlSendungsVermker.Controls.Add(Me.Label4) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_ATB) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_SendungAvisiert) @@ -135,208 +97,37 @@ Partial Class frmAddSendungsvermerkShort Me.pnlSendungsVermker.Controls.Add(Me.Label3) Me.pnlSendungsVermker.Controls.Add(Me.lblErr240Zeichen) Me.pnlSendungsVermker.Controls.Add(Me.txtDetail) - Me.pnlSendungsVermker.Controls.Add(Me.btnCustomerUploadLink) - Me.pnlSendungsVermker.Controls.Add(Me.btnCustomerUploadEmail) - Me.pnlSendungsVermker.Controls.Add(Me.txtCustomerUploadEmail) - Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadEmail) - Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadValidityHours) - Me.pnlSendungsVermker.Controls.Add(Me.nudCustomerUploadValidityHours) - Me.pnlSendungsVermker.Controls.Add(Me.cmbCustomerUploadLanguage) - Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadLanguage) - Me.pnlSendungsVermker.Controls.Add(Me.txtCustomerUploadEmailText) - Me.pnlSendungsVermker.Controls.Add(Me.lblCustomerUploadEmailText) Me.pnlSendungsVermker.Controls.Add(Me.lblZustzlFreitext) Me.pnlSendungsVermker.Controls.Add(Me.txtSendungSpedition) - Me.pnlSendungsVermker.Controls.Add(Me.cbxNichtLeserlich) Me.pnlSendungsVermker.Controls.Add(Me.btnOK) Me.pnlSendungsVermker.Controls.Add(Me.btnDokumtanforderung) - Me.pnlSendungsVermker.Controls.Add(Me.cbxSonstDok) Me.pnlSendungsVermker.Controls.Add(Me.Label9) Me.pnlSendungsVermker.Controls.Add(Me.Label17) Me.pnlSendungsVermker.Controls.Add(Me.Label13) Me.pnlSendungsVermker.Controls.Add(Me.txtFreierText) - Me.pnlSendungsVermker.Controls.Add(Me.Label20) Me.pnlSendungsVermker.Controls.Add(Me.PictureBox4) - Me.pnlSendungsVermker.Controls.Add(Me.lblErrDokument) Me.pnlSendungsVermker.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlSendungsVermker.Location = New System.Drawing.Point(0, 0) Me.pnlSendungsVermker.Name = "pnlSendungsVermker" - Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 750) + Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 400) Me.pnlSendungsVermker.TabIndex = 0 ' - 'PictureBox1 - ' - Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke - Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox1.Location = New System.Drawing.Point(0, 391) - Me.PictureBox1.Name = "PictureBox1" - Me.PictureBox1.Size = New System.Drawing.Size(474, 1) - Me.PictureBox1.TabIndex = 124 - Me.PictureBox1.TabStop = False - ' - 'pnlDocumentEditor - ' - Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke - Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) - Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) - Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) - Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) - Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) - Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) - Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) - Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) - Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) - Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 135) - Me.pnlDocumentEditor.Name = "pnlDocumentEditor" - Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) - Me.pnlDocumentEditor.TabIndex = 123 - ' - 'flpDocumentTabs - ' - Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.flpDocumentTabs.AutoScroll = True - Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) - Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) - Me.flpDocumentTabs.Name = "flpDocumentTabs" - Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) - Me.flpDocumentTabs.TabIndex = 124 - Me.flpDocumentTabs.WrapContents = False - ' - 'lblDocumentEditorTitle - ' - Me.lblDocumentEditorTitle.AutoSize = True - Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) - Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" - Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) - Me.lblDocumentEditorTitle.TabIndex = 125 - Me.lblDocumentEditorTitle.Text = "Dokumentdetails" - ' - 'lblDocumentEditorName - ' - Me.lblDocumentEditorName.AutoSize = True - Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) - Me.lblDocumentEditorName.Name = "lblDocumentEditorName" - Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) - Me.lblDocumentEditorName.TabIndex = 126 - Me.lblDocumentEditorName.Text = "Dokumentname:" - ' - 'txtDocumentEditorName - ' - Me.txtDocumentEditorName.BackColor = System.Drawing.Color.White - Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) - Me.txtDocumentEditorName.MaxLength = 120 - Me.txtDocumentEditorName.Name = "txtDocumentEditorName" - Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) - Me.txtDocumentEditorName.TabIndex = 127 - ' - 'lblDocumentEditorAnhangsart - ' - Me.lblDocumentEditorAnhangsart.AutoSize = True - Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) - Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" - Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) - Me.lblDocumentEditorAnhangsart.TabIndex = 128 - Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" - ' - 'cmbDocumentEditorAnhangsart - ' - Me.cmbDocumentEditorAnhangsart.BackColor = System.Drawing.Color.White - Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) - Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" - Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) - Me.cmbDocumentEditorAnhangsart.TabIndex = 129 - ' - 'lblDocumentEditorInfo - ' - Me.lblDocumentEditorInfo.AutoSize = True - Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) - Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" - Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) - Me.lblDocumentEditorInfo.TabIndex = 130 - Me.lblDocumentEditorInfo.Text = "Dokument Info:" - ' - 'txtDocumentEditorInfo - ' - Me.txtDocumentEditorInfo.BackColor = System.Drawing.Color.White - Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) - Me.txtDocumentEditorInfo.MaxLength = 500 - Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" - Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) - Me.txtDocumentEditorInfo.TabIndex = 131 - Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." - ' - 'lblDocumentEditorStatus - ' - Me.lblDocumentEditorStatus.AutoSize = True - Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) - Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" - Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) - Me.lblDocumentEditorStatus.TabIndex = 119 - Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." - ' - 'flpDokumenteFehlenMain - ' - Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent - Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 23) - Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) - Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" - Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) - Me.flpDokumenteFehlenMain.TabIndex = 120 - ' - 'lblSonstigeVermerke - ' - Me.lblSonstigeVermerke.AutoSize = True - Me.lblSonstigeVermerke.BackColor = System.Drawing.Color.White - Me.lblSonstigeVermerke.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold) - Me.lblSonstigeVermerke.Location = New System.Drawing.Point(5, 393) - Me.lblSonstigeVermerke.Name = "lblSonstigeVermerke" - Me.lblSonstigeVermerke.Size = New System.Drawing.Size(150, 17) - Me.lblSonstigeVermerke.TabIndex = 121 - Me.lblSonstigeVermerke.Text = "Sonstige Vermerke:" - ' 'flpAngefordert ' Me.flpAngefordert.BackColor = System.Drawing.Color.White Me.flpAngefordert.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpAngefordert.Location = New System.Drawing.Point(12, 414) + Me.flpAngefordert.Location = New System.Drawing.Point(12, 50) Me.flpAngefordert.Margin = New System.Windows.Forms.Padding(0) Me.flpAngefordert.Name = "flpAngefordert" Me.flpAngefordert.Size = New System.Drawing.Size(450, 131) Me.flpAngefordert.TabIndex = 122 ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.BackColor = System.Drawing.Color.Transparent - Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(6, 274) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(202, 17) - Me.Label5.TabIndex = 118 - Me.Label5.Text = "Kundenportal Upload-Link:" - ' - 'txtSonstigesDokumentFehlt - ' - Me.txtSonstigesDokumentFehlt.BackColor = System.Drawing.Color.White - Me.txtSonstigesDokumentFehlt.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(94, 114) - Me.txtSonstigesDokumentFehlt.MaxLength = 80 - Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) - Me.txtSonstigesDokumentFehlt.TabIndex = 10 - ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.BackColor = System.Drawing.Color.WhiteSmoke Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label4.Location = New System.Drawing.Point(12, 625) + Me.Label4.Location = New System.Drawing.Point(12, 268) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(125, 17) Me.Label4.TabIndex = 96 @@ -346,7 +137,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_ATB.AutoSize = True Me.optFremd_ATB.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_ATB.Location = New System.Drawing.Point(13, 660) + Me.optFremd_ATB.Location = New System.Drawing.Point(13, 303) Me.optFremd_ATB.Name = "optFremd_ATB" Me.optFremd_ATB.Size = New System.Drawing.Size(130, 17) Me.optFremd_ATB.TabIndex = 94 @@ -357,7 +148,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_SendungAvisiert.AutoSize = True Me.optFremd_SendungAvisiert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 643) + Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 286) Me.optFremd_SendungAvisiert.Name = "optFremd_SendungAvisiert" Me.optFremd_SendungAvisiert.Size = New System.Drawing.Size(193, 17) Me.optFremd_SendungAvisiert.TabIndex = 93 @@ -369,7 +160,7 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrSpedition.AutoSize = True Me.lblErrSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrSpedition.ForeColor = System.Drawing.Color.Red - Me.lblErrSpedition.Location = New System.Drawing.Point(177, 551) + Me.lblErrSpedition.Location = New System.Drawing.Point(177, 194) Me.lblErrSpedition.Name = "lblErrSpedition" Me.lblErrSpedition.Size = New System.Drawing.Size(158, 13) Me.lblErrSpedition.TabIndex = 17 @@ -394,7 +185,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label2.AutoSize = True Me.Label2.BackColor = System.Drawing.Color.WhiteSmoke Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) - Me.Label2.Location = New System.Drawing.Point(176, 562) + Me.Label2.Location = New System.Drawing.Point(176, 205) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(57, 13) Me.Label2.TabIndex = 84 @@ -405,7 +196,7 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrGrund.AutoSize = True Me.lblErrGrund.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrGrund.ForeColor = System.Drawing.Color.Red - Me.lblErrGrund.Location = New System.Drawing.Point(148, 614) + Me.lblErrGrund.Location = New System.Drawing.Point(148, 257) Me.lblErrGrund.Name = "lblErrGrund" Me.lblErrGrund.Size = New System.Drawing.Size(149, 13) Me.lblErrGrund.TabIndex = 26 @@ -444,7 +235,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSpedition.Location = New System.Drawing.Point(178, 572) + Me.txtSpedition.Location = New System.Drawing.Point(178, 215) Me.txtSpedition.MaxLength = 50 Me.txtSpedition.Name = "txtSpedition" Me.txtSpedition.Size = New System.Drawing.Size(126, 20) @@ -465,7 +256,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optSpeditionWeitergeleitet.AutoSize = True Me.optSpeditionWeitergeleitet.BackColor = System.Drawing.Color.WhiteSmoke - Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 572) + Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 215) Me.optSpeditionWeitergeleitet.Name = "optSpeditionWeitergeleitet" Me.optSpeditionWeitergeleitet.Size = New System.Drawing.Size(163, 17) Me.optSpeditionWeitergeleitet.TabIndex = 19 @@ -476,7 +267,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFreierText.AutoSize = True Me.optFreierText.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFreierText.Location = New System.Drawing.Point(13, 589) + Me.optFreierText.Location = New System.Drawing.Point(13, 232) Me.optFreierText.Name = "optFreierText" Me.optFreierText.Size = New System.Drawing.Size(105, 17) Me.optFreierText.TabIndex = 27 @@ -487,7 +278,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optATAangefordert.AutoSize = True Me.optATAangefordert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optATAangefordert.Location = New System.Drawing.Point(165, 660) + Me.optATAangefordert.Location = New System.Drawing.Point(165, 303) Me.optATAangefordert.Name = "optATAangefordert" Me.optATAangefordert.Size = New System.Drawing.Size(208, 17) Me.optATAangefordert.TabIndex = 15 @@ -498,7 +289,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.Label3.AutoSize = True Me.Label3.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label3.Location = New System.Drawing.Point(309, 573) + Me.Label3.Location = New System.Drawing.Point(309, 216) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(57, 13) Me.Label3.TabIndex = 22 @@ -508,7 +299,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.lblErr240Zeichen.AutoSize = True Me.lblErr240Zeichen.ForeColor = System.Drawing.Color.Red - Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 689) + Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 332) Me.lblErr240Zeichen.Name = "lblErr240Zeichen" Me.lblErr240Zeichen.Size = New System.Drawing.Size(95, 13) Me.lblErr240Zeichen.TabIndex = 32 @@ -520,7 +311,7 @@ Partial Class frmAddSendungsvermerkShort Me.txtDetail.AcceptsReturn = True Me.txtDetail.BackColor = System.Drawing.Color.White Me.txtDetail.ForeColor = System.Drawing.SystemColors.InfoText - Me.txtDetail.Location = New System.Drawing.Point(17, 705) + Me.txtDetail.Location = New System.Drawing.Point(17, 348) Me.txtDetail.MaxLength = 240 Me.txtDetail.Multiline = True Me.txtDetail.Name = "txtDetail" @@ -530,109 +321,10 @@ Partial Class frmAddSendungsvermerkShort Me.txtDetail.TabStop = False Me.txtDetail.WordWrap = False ' - 'btnCustomerUploadLink - ' - Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(342, 297) - Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" - Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) - Me.btnCustomerUploadLink.TabIndex = 108 - Me.btnCustomerUploadLink.Text = "Link kopieren" - Me.btnCustomerUploadLink.UseVisualStyleBackColor = True - ' - 'btnCustomerUploadEmail - ' - Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(342, 322) - Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" - Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) - Me.btnCustomerUploadEmail.TabIndex = 109 - Me.btnCustomerUploadEmail.Text = "E-Mail senden" - Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True - ' - 'txtCustomerUploadEmail - ' - Me.txtCustomerUploadEmail.BackColor = System.Drawing.Color.White - Me.txtCustomerUploadEmail.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 324) - Me.txtCustomerUploadEmail.MaxLength = 255 - Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" - Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) - Me.txtCustomerUploadEmail.TabIndex = 107 - ' - 'lblCustomerUploadEmail - ' - Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 327) - Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" - Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) - Me.lblCustomerUploadEmail.TabIndex = 110 - Me.lblCustomerUploadEmail.Text = "E-Mail an:" - ' - 'lblCustomerUploadValidityHours - ' - Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 301) - Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" - Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) - Me.lblCustomerUploadValidityHours.TabIndex = 111 - Me.lblCustomerUploadValidityHours.Text = "Gültigkeit(h):" - ' - 'nudCustomerUploadValidityHours - ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 299) - Me.nudCustomerUploadValidityHours.Maximum = New Decimal(New Integer() {168, 0, 0, 0}) - Me.nudCustomerUploadValidityHours.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) - Me.nudCustomerUploadValidityHours.Name = "nudCustomerUploadValidityHours" - Me.nudCustomerUploadValidityHours.Size = New System.Drawing.Size(74, 20) - Me.nudCustomerUploadValidityHours.TabIndex = 112 - Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) - ' - 'cmbCustomerUploadLanguage - ' - Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbCustomerUploadLanguage.FormattingEnabled = True - Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) - Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 298) - Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" - Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) - Me.cmbCustomerUploadLanguage.TabIndex = 116 - ' - 'lblCustomerUploadLanguage - ' - Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 301) - Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" - Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) - Me.lblCustomerUploadLanguage.TabIndex = 117 - Me.lblCustomerUploadLanguage.Text = "Mail Sprache:" - ' - 'txtCustomerUploadEmailText - ' - Me.txtCustomerUploadEmailText.BackColor = System.Drawing.Color.White - Me.txtCustomerUploadEmailText.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 350) - Me.txtCustomerUploadEmailText.MaxLength = 500 - Me.txtCustomerUploadEmailText.Multiline = True - Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" - Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 34) - Me.txtCustomerUploadEmailText.TabIndex = 113 - Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." - ' - 'lblCustomerUploadEmailText - ' - Me.lblCustomerUploadEmailText.AutoSize = True - Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 349) - Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" - Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) - Me.lblCustomerUploadEmailText.TabIndex = 114 - Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" - ' 'lblZustzlFreitext ' Me.lblZustzlFreitext.AutoSize = True - Me.lblZustzlFreitext.Location = New System.Drawing.Point(14, 688) + Me.lblZustzlFreitext.Location = New System.Drawing.Point(14, 331) Me.lblZustzlFreitext.Name = "lblZustzlFreitext" Me.lblZustzlFreitext.Size = New System.Drawing.Size(142, 13) Me.lblZustzlFreitext.TabIndex = 31 @@ -642,28 +334,17 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSendungSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSendungSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 591) + Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 234) Me.txtSendungSpedition.MaxLength = 50 Me.txtSendungSpedition.Name = "txtSendungSpedition" Me.txtSendungSpedition.Size = New System.Drawing.Size(26, 20) Me.txtSendungSpedition.TabIndex = 18 Me.txtSendungSpedition.Visible = False ' - 'cbxNichtLeserlich - ' - Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.BackColor = System.Drawing.Color.Transparent - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 116) - Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" - Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) - Me.cbxNichtLeserlich.TabIndex = 8 - Me.cbxNichtLeserlich.Text = "nicht leserlich" - Me.cbxNichtLeserlich.UseVisualStyleBackColor = False - ' 'btnOK ' Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnOK.Location = New System.Drawing.Point(325, 705) + Me.btnOK.Location = New System.Drawing.Point(325, 348) Me.btnOK.Name = "btnOK" Me.btnOK.Size = New System.Drawing.Size(125, 41) Me.btnOK.TabIndex = 34 @@ -680,23 +361,12 @@ Partial Class frmAddSendungsvermerkShort Me.btnDokumtanforderung.Text = "Dokumtanforderung" Me.btnDokumtanforderung.UseVisualStyleBackColor = True ' - 'cbxSonstDok - ' - Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.BackColor = System.Drawing.Color.Transparent - Me.cbxSonstDok.Location = New System.Drawing.Point(12, 116) - Me.cbxSonstDok.Name = "cbxSonstDok" - Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) - Me.cbxSonstDok.TabIndex = 9 - Me.cbxSonstDok.Text = "Dok. Name:" - Me.cbxSonstDok.UseVisualStyleBackColor = False - ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.BackColor = System.Drawing.Color.WhiteSmoke Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) - Me.Label9.Location = New System.Drawing.Point(355, 614) + Me.Label9.Location = New System.Drawing.Point(355, 257) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(90, 13) Me.Label9.TabIndex = 30 @@ -707,7 +377,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label17.AutoSize = True Me.Label17.BackColor = System.Drawing.Color.WhiteSmoke Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Italic) - Me.Label17.Location = New System.Drawing.Point(145, 614) + Me.Label17.Location = New System.Drawing.Point(145, 257) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(182, 13) Me.Label17.TabIndex = 29 @@ -718,7 +388,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label13.AutoSize = True Me.Label13.BackColor = System.Drawing.Color.WhiteSmoke Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label13.Location = New System.Drawing.Point(10, 553) + Me.Label13.Location = New System.Drawing.Point(10, 196) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(84, 17) Me.Label13.TabIndex = 16 @@ -728,45 +398,22 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtFreierText.BackColor = System.Drawing.Color.WhiteSmoke Me.txtFreierText.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtFreierText.Location = New System.Drawing.Point(123, 587) + Me.txtFreierText.Location = New System.Drawing.Point(123, 230) Me.txtFreierText.MaxLength = 80 Me.txtFreierText.Name = "txtFreierText" Me.txtFreierText.Size = New System.Drawing.Size(323, 23) Me.txtFreierText.TabIndex = 28 ' - 'Label20 - ' - Me.Label20.AutoSize = True - Me.Label20.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.Label20.Location = New System.Drawing.Point(216, 276) - Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(207, 13) - Me.Label20.TabIndex = 21 - Me.Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." - ' 'PictureBox4 ' Me.PictureBox4.BackColor = System.Drawing.Color.WhiteSmoke Me.PictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox4.Location = New System.Drawing.Point(-1, 547) + Me.PictureBox4.Location = New System.Drawing.Point(-1, 190) Me.PictureBox4.Name = "PictureBox4" Me.PictureBox4.Size = New System.Drawing.Size(474, 139) Me.PictureBox4.TabIndex = 78 Me.PictureBox4.TabStop = False ' - 'lblErrDokument - ' - Me.lblErrDokument.AutoSize = True - Me.lblErrDokument.BackColor = System.Drawing.Color.WhiteSmoke - Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(96, 136) - Me.lblErrDokument.Name = "lblErrDokument" - Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) - Me.lblErrDokument.TabIndex = 11 - Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" - Me.lblErrDokument.Visible = False - ' 'Panel4 ' Me.Panel4.BackColor = System.Drawing.Color.White @@ -781,7 +428,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 750) + Me.ClientSize = New System.Drawing.Size(474, 400) Me.Controls.Add(Me.pnlMain) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) @@ -793,10 +440,6 @@ Partial Class frmAddSendungsvermerkShort Me.pnlMain.ResumeLayout(False) Me.pnlSendungsVermker.ResumeLayout(False) Me.pnlSendungsVermker.PerformLayout() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() - Me.pnlDocumentEditor.ResumeLayout(False) - Me.pnlDocumentEditor.PerformLayout() - CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) @@ -805,7 +448,6 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents pnlMain As System.Windows.Forms.Panel Friend WithEvents Panel4 As System.Windows.Forms.Panel Friend WithEvents pnlSendungsVermker As System.Windows.Forms.Panel - Friend WithEvents txtSonstigesDokumentFehlt As System.Windows.Forms.TextBox Friend WithEvents optSpeditionWeitergeleitet As System.Windows.Forms.CheckBox Friend WithEvents optFreierText As System.Windows.Forms.CheckBox Friend WithEvents optATAangefordert As System.Windows.Forms.CheckBox @@ -813,10 +455,8 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents lblErr240Zeichen As System.Windows.Forms.Label Friend WithEvents lblZustzlFreitext As System.Windows.Forms.Label Friend WithEvents txtSendungSpedition As System.Windows.Forms.TextBox - Friend WithEvents cbxNichtLeserlich As System.Windows.Forms.CheckBox Friend WithEvents btnOK As System.Windows.Forms.Button Friend WithEvents btnDokumtanforderung As System.Windows.Forms.Button - Friend WithEvents cbxSonstDok As System.Windows.Forms.CheckBox Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents lblErrSpedition As System.Windows.Forms.Label Friend WithEvents lblErrGrund As System.Windows.Forms.Label @@ -824,12 +464,9 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents Label13 As System.Windows.Forms.Label Friend WithEvents txtFreierText As System.Windows.Forms.TextBox Friend WithEvents txtSpedition As System.Windows.Forms.TextBox - Friend WithEvents Label20 As System.Windows.Forms.Label - Friend WithEvents lblDocumentEditorStatus As System.Windows.Forms.Label Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents optSendungInVorbereitung As System.Windows.Forms.CheckBox - Friend WithEvents lblErrDokument As System.Windows.Forms.Label Friend WithEvents lblDragIndicator As System.Windows.Forms.Label Friend WithEvents btnCLose As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label @@ -837,28 +474,5 @@ Partial Class frmAddSendungsvermerkShort Friend WithEvents optFremd_ATB As CheckBox Friend WithEvents optFremd_SendungAvisiert As CheckBox Public WithEvents txtDetail As TextBox - Friend WithEvents btnCustomerUploadLink As Button - Friend WithEvents btnCustomerUploadEmail As Button - Friend WithEvents txtCustomerUploadEmail As TextBox - Friend WithEvents lblCustomerUploadEmail As Label - Friend WithEvents lblCustomerUploadValidityHours As Label - Friend WithEvents nudCustomerUploadValidityHours As NumericUpDown - Friend WithEvents cmbCustomerUploadLanguage As ComboBox - Friend WithEvents lblCustomerUploadLanguage As Label - Friend WithEvents txtCustomerUploadEmailText As TextBox - Friend WithEvents lblCustomerUploadEmailText As Label - Friend WithEvents Label5 As Label - Friend WithEvents flpDokumenteFehlenMain As FlowLayoutPanel - Friend WithEvents lblSonstigeVermerke As Label Friend WithEvents flpAngefordert As FlowLayoutPanel - Friend WithEvents pnlDocumentEditor As Panel - Friend WithEvents flpDocumentTabs As FlowLayoutPanel - Friend WithEvents lblDocumentEditorTitle As Label - Friend WithEvents lblDocumentEditorName As Label - Friend WithEvents txtDocumentEditorName As TextBox - Friend WithEvents lblDocumentEditorAnhangsart As Label - Friend WithEvents cmbDocumentEditorAnhangsart As ComboBox - Friend WithEvents lblDocumentEditorInfo As Label - Friend WithEvents txtDocumentEditorInfo As TextBox - Friend WithEvents PictureBox1 As PictureBox End Class diff --git a/Aviso/frmAddSendungsvermerkShort.vb b/Aviso/frmAddSendungsvermerkShort.vb index 2dc1600..fd6c042 100644 --- a/Aviso/frmAddSendungsvermerkShort.vb +++ b/Aviso/frmAddSendungsvermerkShort.vb @@ -1,4 +1,4 @@ - + Imports System.Configuration Imports System.IO Imports System.Net @@ -15,26 +15,15 @@ Public Class frmAddSendungsvermerkShort Dim myAviso As New cAviso Dim VermerkeDAL As New cVermerkeDAL Dim aktChanged As Boolean = False - Private ReadOnly _anforderungCheckboxes As New List(Of CheckBox) - Private ReadOnly _anhangsartIdByCheckbox As New Dictionary(Of CheckBox, Integer) - Private ReadOnly _backendBezeichnungByCodeId As New Dictionary(Of Integer, String) - Private ReadOnly _selectedAnhangsartIdByCodeId As New Dictionary(Of Integer, Integer) - Private ReadOnly _documentCustomNameByCodeId As New Dictionary(Of Integer, String) - Private ReadOnly _documentBaseTextByCodeId As New Dictionary(Of Integer, String) - Private ReadOnly _anhangsartenOptions As New List(Of AnhangsartOption) - Private ReadOnly _bereichByCodeId As New Dictionary(Of Integer, Integer) - Private _selectedDocumentCodeId As Integer = 0 - Private _isLoadingDocumentEditor As Boolean = False - Private Const DefaultDocumentBaseText As String = "Bitte das Dokument hochladen." - Private Const BereichDokumentMain As Integer = 1 - Private Const BereichAngefordert As Integer = 2 - Private _dokumentanforderungState As New frmSendungsDokumentanforderung.DokumentanforderungState() Dim Neuanlage As Boolean = False Dim hStatus As Integer Public SendungID As Integer = -1 Public AvisoID As Integer = -1 + Private _anforderungCheckboxes As New List(Of CheckBox) + Private _backendBezeichnungByCodeId As New Dictionary(Of Integer, String) + Private Const BereichAngefordert As Integer = 2 Dim txtSendung As New TextBox @@ -51,7 +40,7 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub frmEintragVermerk_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown - 'Escape händisch abfangen und auf Abbruch-Taste legen + 'Escape händisch abfangen und auf Abbruch-Taste legen If e.KeyCode = Keys.Escape Then ' btnAbbruch.PerformClick() Me.Close() @@ -91,19 +80,6 @@ Public Class frmAddSendungsvermerkShort VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) - If cmbCustomerUploadLanguage IsNot Nothing Then - If cmbCustomerUploadLanguage.SelectedIndex < 0 Then - Dim idx = cmbCustomerUploadLanguage.Items.IndexOf("de") - If idx >= 0 Then - cmbCustomerUploadLanguage.SelectedIndex = idx - ElseIf cmbCustomerUploadLanguage.Items.Count > 0 Then - cmbCustomerUploadLanguage.SelectedIndex = 0 - End If - End If - End If - - InitializeDocumentEditor() - For Each c In Me.Controls If c.GetType.Name.ToString = "RadioButton" Then AddHandler DirectCast(c, RadioButton).CheckedChanged, AddressOf selectionChanged @@ -117,10 +93,6 @@ Public Class frmAddSendungsvermerkShort txtSendung.Text = "KOMPLETT" End If - SetupDynamicAnforderungCheckboxes() - _dokumentanforderungState = BuildDokumentanforderungState() - SetDokumentbereichVisible(False) - hStatus = myAviso.Status If hStatus = cGlobal.Status_Vorbereitet Or hStatus = cGlobal.Status_Vorgeschrieben Or hStatus = cGlobal.Status_Erfasst Then optSendungInVorbereitung.Visible = True @@ -131,6 +103,9 @@ Public Class frmAddSendungsvermerkShort Else optSendungInVorbereitung.Visible = False End If + + SetupDynamicAnforderungCheckboxes() + 'bereits vorhandene Vermerke laden 'txtInfo.Text = VermerkeDAL.Vermerke_einlesen(myAviso.AvisoID) Me.Text = "AKT " & myAviso.LKW_Nr & "" @@ -153,52 +128,21 @@ Public Class frmAddSendungsvermerkShort End Sub - Private Sub InitializeDocumentEditor() - If txtDocumentEditorName IsNot Nothing Then - RemoveHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged - AddHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged - End If - If txtDocumentEditorInfo IsNot Nothing Then - RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged - AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged - End If - - EnsureAnhangsartenOptionsLoaded() - - If cmbDocumentEditorAnhangsart IsNot Nothing Then - RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged - cmbDocumentEditorAnhangsart.BeginUpdate() - cmbDocumentEditorAnhangsart.Items.Clear() - For Each optionItem In _anhangsartenOptions - cmbDocumentEditorAnhangsart.Items.Add(optionItem) - Next - cmbDocumentEditorAnhangsart.EndUpdate() - AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged - End If - - ClearDocumentEditor() - End Sub + ' Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click + ' Me.Close() + ' End Sub Private Sub SetupDynamicAnforderungCheckboxes() _anforderungCheckboxes.Clear() - _anhangsartIdByCheckbox.Clear() _backendBezeichnungByCodeId.Clear() - _selectedAnhangsartIdByCodeId.Clear() - _documentCustomNameByCodeId.Clear() - _documentBaseTextByCodeId.Clear() - _bereichByCodeId.Clear() - _selectedDocumentCodeId = 0 - If flpDocumentTabs IsNot Nothing Then - flpDocumentTabs.Controls.Clear() - End If Dim dt As DataTable = Nothing Try - dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Try - dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Return End Try @@ -207,9 +151,7 @@ Public Class frmAddSendungsvermerkShort If dt Is Nothing OrElse dt.Rows.Count = 0 Then Return End If - EnsureAnhangsartenOptionsLoaded() - flpDokumenteFehlenMain.Controls.Clear() flpAngefordert.Controls.Clear() For Each row As DataRow In dt.Rows @@ -230,28 +172,6 @@ Public Class frmAddSendungsvermerkShort If frontendBezeichnung = "" Then frontendBezeichnung = bezeichnung End If - Dim cb As New CheckBox() - cb.Text = frontendBezeichnung - cb.Tag = id - cb.Margin = New Padding(0, 0, 4, 0) - AddHandler cb.CheckedChanged, AddressOf DynamicAnforderungCheckboxChanged - - If bezeichnung.ToLowerInvariant().Contains("nicht leserlich") Then - Continue For - End If - - Dim anhangsartId As Integer = 0 - Try - If Not IsDBNull(row("AvisoAnhangsartId")) Then - anhangsartId = CInt(row("AvisoAnhangsartId")) - End If - Catch - End Try - _anhangsartIdByCheckbox(cb) = anhangsartId - If Not _documentCustomNameByCodeId.ContainsKey(id) Then - _documentCustomNameByCodeId(id) = GetAnhangsartDisplayTextById(anhangsartId) - End If - Dim bereich As Integer = BereichAngefordert Try If Not IsDBNull(row("AnforderungBereich")) Then @@ -259,25 +179,18 @@ Public Class frmAddSendungsvermerkShort End If Catch End Try - _bereichByCodeId(id) = bereich - If bereich = BereichDokumentMain Then - cb.BackColor = Color.Transparent - cb.UseVisualStyleBackColor = False - ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) - flpDokumenteFehlenMain.Controls.Add(cb) - Else + If bereich = BereichAngefordert Then + Dim cb As New CheckBox() + cb.Text = frontendBezeichnung + cb.Tag = id + cb.Margin = New Padding(0, 0, 4, 0) + ConfigureAnforderungCheckbox(cb, flpAngefordert) flpAngefordert.Controls.Add(cb) + _anforderungCheckboxes.Add(cb) End If - - _anforderungCheckboxes.Add(cb) Next - - cbxSonstDok.BringToFront() - txtSonstigesDokumentFehlt.BringToFront() - cbxNichtLeserlich.BringToFront() - lblErrDokument.BringToFront() End Sub Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) @@ -288,623 +201,13 @@ Public Class frmAddSendungsvermerkShort Dim cols As Integer = 2 Dim colGap As Integer = 14 - Dim minCbWidth As Integer = 120 - If String.Equals(container.Name, "flpDokumenteFehlenMain", StringComparison.OrdinalIgnoreCase) Then - cols = 3 - colGap = 2 - minCbWidth = 80 - ElseIf String.Equals(container.Name, "flpAngefordert", StringComparison.OrdinalIgnoreCase) Then - cols = 2 - colGap = 14 - minCbWidth = 180 - End If + Dim minCbWidth As Integer = 180 Dim usableWidth = Math.Max(120, container.Width - 20) Dim cbWidth = CInt(Math.Floor((usableWidth - ((cols - 1) * colGap)) / cols)) cb.Width = Math.Max(minCbWidth, Math.Min(cbWidth, 220)) End Sub - Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) - If _isLoadingDocumentEditor Then Return - If _selectedDocumentCodeId <= 0 Then Return - - _documentCustomNameByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorName.Text, "").Trim() - _documentBaseTextByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorInfo.Text, "").Trim() - - If flpDocumentTabs IsNot Nothing Then - Dim tab = TryCast(flpDocumentTabs.Controls("tab_" & _selectedDocumentCodeId), Panel) - If tab IsNot Nothing Then - Dim lblText = TryCast(tab.Controls("lblText"), Label) - Dim lblClose = TryCast(tab.Controls("lblClose"), Label) - If lblText IsNot Nothing AndAlso lblClose IsNot Nothing Then - lblText.Text = _documentCustomNameByCodeId(_selectedDocumentCodeId) - If lblText.Text = "" Then lblText.Text = "Unbenannt" - lblText.PerformLayout() - lblClose.Location = New Point(lblText.Right + 5, 5) - tab.Width = lblClose.Right + 5 - End If - End If - End If - End Sub - - Private Sub DocumentEditorAnhangsartChanged(sender As Object, e As EventArgs) - If _isLoadingDocumentEditor Then Return - If _selectedDocumentCodeId <= 0 Then Return - - Dim selected = TryCast(cmbDocumentEditorAnhangsart.SelectedItem, AnhangsartOption) - If selected Is Nothing Then Return - _selectedAnhangsartIdByCodeId(_selectedDocumentCodeId) = selected.Id - End Sub - - Private Sub EnsureAnhangsartenOptionsLoaded() - If _anhangsartenOptions.Count > 0 Then Return - - Dim dt As DataTable = Nothing - Try - dt = AvisoDAL.loadDataTableBySQL("SELECT [aa_id],[aa_bezeichnung],[aa_name] FROM [tblAvisoAnhangsarten] WHERE [aa_aktiv]=1 ORDER BY [aa_sort],[aa_bezeichnung]") - Catch - Return - End Try - - If dt Is Nothing Then Return - - For Each row As DataRow In dt.Rows - Dim id As Integer = 0 - Try - id = CInt(row("aa_id")) - Catch - Continue For - End Try - If id <= 0 Then Continue For - Dim alreadyAdded As Boolean = False - For Each existing In _anhangsartenOptions - If existing.Id = id Then - alreadyAdded = True - Exit For - End If - Next - If alreadyAdded Then Continue For - - Dim text = If(IsDBNull(row("aa_bezeichnung")), "", CStr(row("aa_bezeichnung"))).Trim() - If text = "" Then - text = If(IsDBNull(row("aa_name")), "", CStr(row("aa_name"))).Trim() - End If - If text = "" Then text = "#" & id.ToString() - - _anhangsartenOptions.Add(New AnhangsartOption(id, text)) - Next - End Sub - - Private Sub SelectAnhangsartInEditor(anhangsartId As Integer) - If cmbDocumentEditorAnhangsart Is Nothing Then Return - cmbDocumentEditorAnhangsart.SelectedIndex = -1 - If anhangsartId <= 0 Then Return - - For i = 0 To cmbDocumentEditorAnhangsart.Items.Count - 1 - Dim optionItem = TryCast(cmbDocumentEditorAnhangsart.Items(i), AnhangsartOption) - If optionItem Is Nothing Then Continue For - If optionItem.Id = anhangsartId Then - cmbDocumentEditorAnhangsart.SelectedIndex = i - Exit For - End If - Next - End Sub - - Private Function GetAnhangsartDisplayTextById(anhangsartId As Integer) As String - If anhangsartId <= 0 Then Return "" - EnsureAnhangsartenOptionsLoaded() - For Each optionItem In _anhangsartenOptions - If optionItem.Id = anhangsartId Then - Return If(optionItem.Text, "").Trim() - End If - Next - Return "" - End Function - - Private Function TryGetCheckboxCodeId(cb As CheckBox, ByRef codeId As Integer) As Boolean - codeId = 0 - If cb Is Nothing OrElse cb.Tag Is Nothing Then Return False - Return Integer.TryParse(cb.Tag.ToString(), codeId) AndAlso codeId > 0 - End Function - - Private Sub ClearDocumentEditor() - _selectedDocumentCodeId = 0 - _isLoadingDocumentEditor = True - txtDocumentEditorName.Text = "" - txtDocumentEditorInfo.Text = "" - If cmbDocumentEditorAnhangsart IsNot Nothing Then - cmbDocumentEditorAnhangsart.SelectedIndex = -1 - End If - _isLoadingDocumentEditor = False - If lblDocumentEditorStatus IsNot Nothing Then - lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." - End If - End Sub - - Private Sub SelectDocument(codeId As Integer) - _selectedDocumentCodeId = codeId - - If codeId <= 0 Then - ClearDocumentEditor() - SyncTabs() - Return - End If - - Dim targetCb As CheckBox = Nothing - For Each cb In _anforderungCheckboxes - If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then - targetCb = cb - Exit For - End If - Next - - If targetCb IsNot Nothing Then - Dim anhangsartId = GetEffectiveAnhangsartId(targetCb) - - Dim customName = "" - If _documentCustomNameByCodeId.ContainsKey(codeId) Then - customName = If(_documentCustomNameByCodeId(codeId), "").Trim() - Else - customName = GetAnhangsartDisplayTextById(anhangsartId) - _documentCustomNameByCodeId(codeId) = customName - End If - - Dim baseText = GetDocumentBaseTextByCodeId(codeId) - - _isLoadingDocumentEditor = True - txtDocumentEditorName.Text = customName - txtDocumentEditorInfo.Text = baseText - SelectAnhangsartInEditor(anhangsartId) - _isLoadingDocumentEditor = False - - If anhangsartId > 0 Then - _selectedAnhangsartIdByCodeId(codeId) = anhangsartId - End If - - lblDocumentEditorStatus.ForeColor = Color.FromArgb(0, 102, 153) - lblDocumentEditorStatus.Text = "Ausgewählt: " & If(targetCb.Text, "").Trim() - End If - - SyncTabs() - End Sub - - Private Function CreateTab(codeId As Integer, text As String) As Panel - Dim pnl As New Panel() - pnl.Name = "tab_" & codeId - pnl.Tag = codeId - pnl.Height = 28 - pnl.BackColor = Color.White - pnl.BorderStyle = BorderStyle.FixedSingle - pnl.Margin = New Padding(2, 4, 2, 0) - pnl.Cursor = Cursors.Hand - - Dim lblText As New Label() - lblText.Name = "lblText" - lblText.Text = If(text = "", "Unbenannt", text) - lblText.AutoSize = True - lblText.Location = New Point(5, 5) - lblText.Tag = codeId - lblText.Cursor = Cursors.Hand - AddHandler lblText.Click, AddressOf Tab_Click - pnl.Controls.Add(lblText) - - Dim lblClose As New Label() - lblClose.Name = "lblClose" - lblClose.Text = "X" - lblClose.AutoSize = True - lblClose.ForeColor = Color.Red - lblClose.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Bold) - lblClose.Cursor = Cursors.Hand - lblClose.Tag = codeId - AddHandler lblClose.Click, AddressOf TabClose_Click - pnl.Controls.Add(lblClose) - - lblText.PerformLayout() - lblClose.Location = New Point(lblText.Right + 5, 5) - pnl.Width = lblClose.Right + 5 - - AddHandler pnl.Click, AddressOf Tab_Click - - Return pnl - End Function - - Private Sub SyncTabs() - If flpDocumentTabs Is Nothing Then Return - - flpDocumentTabs.SuspendLayout() - - Dim requiredCodeIds As New List(Of Integer) - For Each cb In _anforderungCheckboxes - If cb.Checked Then - Dim codeId As Integer = 0 - If Integer.TryParse(cb.Tag.ToString(), codeId) Then - If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then - requiredCodeIds.Add(codeId) - End If - End If - End If - Next - - Dim i As Integer = flpDocumentTabs.Controls.Count - 1 - While i >= 0 - Dim pnl = TryCast(flpDocumentTabs.Controls(i), Panel) - If pnl IsNot Nothing Then - Dim codeId = CInt(pnl.Tag) - If Not requiredCodeIds.Contains(codeId) Then - flpDocumentTabs.Controls.RemoveAt(i) - pnl.Dispose() - End If - End If - i -= 1 - End While - - For Each codeId In requiredCodeIds - Dim existingTab = TryCast(flpDocumentTabs.Controls("tab_" & codeId), Panel) - Dim text = "" - If _documentCustomNameByCodeId.ContainsKey(codeId) Then - text = _documentCustomNameByCodeId(codeId) - End If - If text = "" Then - For Each cb In _anforderungCheckboxes - If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then - text = cb.Text - Exit For - End If - Next - End If - - If existingTab Is Nothing Then - existingTab = CreateTab(codeId, text) - flpDocumentTabs.Controls.Add(existingTab) - Else - Dim lblText = TryCast(existingTab.Controls("lblText"), Label) - Dim lblClose = TryCast(existingTab.Controls("lblClose"), Label) - If lblText IsNot Nothing AndAlso lblClose IsNot Nothing Then - lblText.Text = If(text = "", "Unbenannt", text) - lblText.PerformLayout() - lblClose.Location = New Point(lblText.Right + 5, 5) - existingTab.Width = lblClose.Right + 5 - End If - End If - - If codeId = _selectedDocumentCodeId Then - existingTab.BackColor = Color.White - existingTab.BorderStyle = BorderStyle.FixedSingle - existingTab.Height = 28 - existingTab.Margin = New Padding(2, 2, 2, 0) - Dim lblText = TryCast(existingTab.Controls("lblText"), Label) - If lblText IsNot Nothing Then lblText.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Bold) - Else - existingTab.BackColor = Color.LightGray - existingTab.BorderStyle = BorderStyle.None - existingTab.Height = 25 - existingTab.Margin = New Padding(2, 5, 2, 0) - Dim lblText = TryCast(existingTab.Controls("lblText"), Label) - If lblText IsNot Nothing Then lblText.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Regular) - End If - Next - - flpDocumentTabs.ResumeLayout() - - If _selectedDocumentCodeId > 0 AndAlso Not requiredCodeIds.Contains(_selectedDocumentCodeId) Then - If requiredCodeIds.Count > 0 Then - SelectDocument(requiredCodeIds(0)) - Else - ClearDocumentEditor() - End If - ElseIf _selectedDocumentCodeId = 0 AndAlso requiredCodeIds.Count > 0 Then - SelectDocument(requiredCodeIds(0)) - End If - End Sub - - Private Sub Tab_Click(sender As Object, e As EventArgs) - Dim ctrl = TryCast(sender, Control) - If ctrl IsNot Nothing AndAlso ctrl.Tag IsNot Nothing Then - Dim codeId As Integer = 0 - If Integer.TryParse(ctrl.Tag.ToString(), codeId) Then - SelectDocument(codeId) - End If - End If - End Sub - - Private Sub TabClose_Click(sender As Object, e As EventArgs) - Dim ctrl = TryCast(sender, Control) - If ctrl IsNot Nothing AndAlso ctrl.Tag IsNot Nothing Then - Dim codeId As Integer = 0 - If Integer.TryParse(ctrl.Tag.ToString(), codeId) Then - For Each cb In _anforderungCheckboxes - If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then - cb.Checked = False - Exit For - End If - Next - End If - End If - End Sub - - Private Sub LoadDocumentEditorForCheckbox(cb As CheckBox) - Dim codeId As Integer = 0 - If Not TryGetCheckboxCodeId(cb, codeId) Then - _selectedDocumentCodeId = 0 - Return - End If - - _selectedDocumentCodeId = codeId - Dim anhangsartId = GetEffectiveAnhangsartId(cb) - - Dim customName = "" - If _documentCustomNameByCodeId.ContainsKey(codeId) Then - customName = If(_documentCustomNameByCodeId(codeId), "").Trim() - Else - customName = GetAnhangsartDisplayTextById(anhangsartId) - _documentCustomNameByCodeId(codeId) = customName - End If - - Dim baseText = GetDocumentBaseTextByCodeId(codeId) - - _isLoadingDocumentEditor = True - txtDocumentEditorName.Text = customName - txtDocumentEditorInfo.Text = baseText - SelectAnhangsartInEditor(anhangsartId) - _isLoadingDocumentEditor = False - - If anhangsartId > 0 Then - _selectedAnhangsartIdByCodeId(codeId) = anhangsartId - End If - - lblDocumentEditorStatus.ForeColor = Color.FromArgb(0, 102, 153) - lblDocumentEditorStatus.Text = "Ausgewählt: " & If(cb.Text, "").Trim() - End Sub - - Private Function GetEffectiveDocumentName(cb As CheckBox) As String - If cb Is Nothing Then Return "" - Dim codeId As Integer = 0 - If TryGetCheckboxCodeId(cb, codeId) Then - If _documentCustomNameByCodeId.ContainsKey(codeId) Then - Dim customName = If(_documentCustomNameByCodeId(codeId), "").Trim() - Return customName - End If - End If - Return "" - End Function - - Private Function GetDocumentBaseText(cb As CheckBox) As String - If cb Is Nothing Then Return "" - Dim codeId As Integer = 0 - If TryGetCheckboxCodeId(cb, codeId) Then - Return GetDocumentBaseTextByCodeId(codeId) - End If - Return DefaultDocumentBaseText - End Function - - Private Function GetDocumentBaseTextByCodeId(codeId As Integer) As String - If codeId > 0 AndAlso _documentBaseTextByCodeId.ContainsKey(codeId) Then - Dim configuredBaseText = If(_documentBaseTextByCodeId(codeId), "").Trim() - If configuredBaseText <> "" Then Return configuredBaseText - End If - Return DefaultDocumentBaseText - End Function - - Private Function GetEffectiveAnhangsartId(cb As CheckBox) As Integer - If cb Is Nothing Then Return 0 - - Dim codeId As Integer = 0 - If TryGetCheckboxCodeId(cb, codeId) Then - If _selectedAnhangsartIdByCodeId.ContainsKey(codeId) Then - Dim selectedId = _selectedAnhangsartIdByCodeId(codeId) - If selectedId > 0 Then Return selectedId - End If - End If - - Dim defaultId As Integer = 0 - If _anhangsartIdByCheckbox.TryGetValue(cb, defaultId) Then - Return defaultId - End If - - Return 0 - End Function - - Private Function BuildUploadCustomText(baseText As String) As String - Dim effectiveBaseText = If(baseText, "").Trim() - If effectiveBaseText = "" Then effectiveBaseText = DefaultDocumentBaseText - Return effectiveBaseText - End Function - - Private Function ValidateDocumentSelectionPayload(documentName As String, baseText As String, anhangsartId As Integer, ByRef validationError As String) As Boolean - validationError = "" - If anhangsartId <= 0 Then - validationError = "ANHANGSART_ID_FEHLT" - Return False - End If - - documentName = If(documentName, "").Trim() - If documentName = "" Then - validationError = "DOKUMENTNAME_FEHLT" - Return False - End If - If documentName.Length > 120 Then - validationError = "DOKUMENTNAME_ZU_LANG" - Return False - End If - - If If(baseText, "").Trim().Length > 500 Then - validationError = "BASETEXT_ZU_LANG" - Return False - End If - - Return True - End Function - - Private Sub DynamicAnforderungCheckboxChanged(sender As Object, e As EventArgs) - Dim cb = TryCast(sender, CheckBox) - If cb Is Nothing Then Return - - Dim bereich As Integer = 0 - Dim codeId As Integer = 0 - If cb.Tag IsNot Nothing Then - If Integer.TryParse(cb.Tag.ToString(), codeId) Then - If _bereichByCodeId.ContainsKey(codeId) Then - bereich = _bereichByCodeId(codeId) - Else - bereich = BereichAngefordert - End If - End If - End If - - If bereich = BereichAngefordert Then - Return - End If - - If cb.Checked Then - SelectDocument(codeId) - Else - SyncTabs() - End If - End Sub - - Private Sub SetDokumentbereichVisible(visible As Boolean) - flpDokumenteFehlenMain.Visible = visible - pnlDocumentEditor.Visible = visible - Label5.Visible = visible - txtSonstigesDokumentFehlt.Visible = visible - btnCustomerUploadLink.Visible = visible - btnCustomerUploadEmail.Visible = visible - txtCustomerUploadEmail.Visible = visible - lblCustomerUploadEmail.Visible = visible - lblCustomerUploadValidityHours.Visible = visible - nudCustomerUploadValidityHours.Visible = visible - cmbCustomerUploadLanguage.Visible = visible - lblCustomerUploadLanguage.Visible = visible - txtCustomerUploadEmailText.Visible = visible - lblCustomerUploadEmailText.Visible = visible - Label20.Visible = visible - cbxNichtLeserlich.Visible = visible - cbxSonstDok.Visible = visible - lblErrDokument.Visible = False - If PictureBox1 IsNot Nothing Then - PictureBox1.Visible = visible - End If - End Sub - - Private Function BuildDokumentanforderungState() As frmSendungsDokumentanforderung.DokumentanforderungState - Dim result As New frmSendungsDokumentanforderung.DokumentanforderungState() - result.SelectedCodeIds = New List(Of Integer) - For Each cb In _anforderungCheckboxes - Dim codeId As Integer = 0 - If cb IsNot Nothing AndAlso cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then - If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then - result.SelectedCodeIds.Add(codeId) - End If - End If - Next - result.SelectedAnhangsartIdByCodeId = New Dictionary(Of Integer, Integer)(_selectedAnhangsartIdByCodeId) - result.DocumentCustomNameByCodeId = New Dictionary(Of Integer, String)(_documentCustomNameByCodeId) - result.DocumentBaseTextByCodeId = New Dictionary(Of Integer, String)(_documentBaseTextByCodeId) - result.SonstDokChecked = cbxSonstDok.Checked - result.SonstigesDokumentName = If(txtSonstigesDokumentFehlt.Text, "").Trim() - result.NichtLeserlichChecked = cbxNichtLeserlich.Checked - result.CustomerUploadEmail = If(txtCustomerUploadEmail.Text, "").Trim() - result.CustomerUploadLanguage = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) - result.CustomerUploadEmailText = If(txtCustomerUploadEmailText.Text, "").Trim() - result.CustomerUploadValidityHours = CInt(nudCustomerUploadValidityHours.Value) - Return result - End Function - - Private Function InsertNurDokumentVermerk() As Boolean - Dim dokumentVermerkGesetzt As Boolean = False - - For Each cb In _anforderungCheckboxes - If cb Is Nothing OrElse Not cb.Checked Then Continue For - Dim codeId As Integer = 0 - If Not Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then Continue For - If Not _bereichByCodeId.ContainsKey(codeId) OrElse _bereichByCodeId(codeId) <> BereichDokumentMain Then Continue For - - Dim text = "" - If _backendBezeichnungByCodeId.ContainsKey(codeId) Then - text = If(_backendBezeichnungByCodeId(codeId), "").Trim() - End If - If text = "" Then text = cb.Text.Trim() - - Dim sendText = txtSendung.Text.Trim() - If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then - text &= " bei Sendung '" & sendText & "'" - End If - - If text <> "" Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) - dokumentVermerkGesetzt = True - End If - Next - - If cbxSonstDok.Checked Then - If txtSonstigesDokumentFehlt.Text.Trim = "" Then - lblErrDokument.Visible = True - txtSonstigesDokumentFehlt.Focus() - Return False - End If - insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument '" & txtSonstigesDokumentFehlt.Text.Trim & "' fehlt - angefordert.", 25) - dokumentVermerkGesetzt = True - End If - - If cbxNichtLeserlich.Checked Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument(e) nachgefordert, da nicht leserlich.", 42) - dokumentVermerkGesetzt = True - End If - - If Not dokumentVermerkGesetzt Then - lblErrDokument.Visible = True - Return False - End If - - Return True - End Function - - Private Sub ApplyDokumentanforderungState(state As frmSendungsDokumentanforderung.DokumentanforderungState) - If state Is Nothing Then Return - _selectedAnhangsartIdByCodeId.Clear() - _documentCustomNameByCodeId.Clear() - _documentBaseTextByCodeId.Clear() - For Each kvp In state.SelectedAnhangsartIdByCodeId - _selectedAnhangsartIdByCodeId(kvp.Key) = kvp.Value - Next - For Each kvp In state.DocumentCustomNameByCodeId - _documentCustomNameByCodeId(kvp.Key) = kvp.Value - Next - For Each kvp In state.DocumentBaseTextByCodeId - _documentBaseTextByCodeId(kvp.Key) = kvp.Value - Next - - For Each cb In _anforderungCheckboxes - Dim codeId As Integer = 0 - If cb Is Nothing Then Continue For - If Not Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then Continue For - If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then - cb.Checked = state.SelectedCodeIds.Contains(codeId) - End If - Next - - cbxSonstDok.Checked = state.SonstDokChecked - txtSonstigesDokumentFehlt.Text = If(state.SonstigesDokumentName, "") - cbxNichtLeserlich.Checked = state.NichtLeserlichChecked - txtCustomerUploadEmail.Text = If(state.CustomerUploadEmail, "") - txtCustomerUploadEmailText.Text = If(state.CustomerUploadEmailText, "") - - Dim targetValidity = Math.Max(CInt(nudCustomerUploadValidityHours.Minimum), Math.Min(CInt(nudCustomerUploadValidityHours.Maximum), state.CustomerUploadValidityHours)) - nudCustomerUploadValidityHours.Value = targetValidity - - Dim language = If(state.CustomerUploadLanguage, "").Trim() - Dim languageIdx = cmbCustomerUploadLanguage.Items.IndexOf(language) - If languageIdx >= 0 Then - cmbCustomerUploadLanguage.SelectedIndex = languageIdx - End If - - SyncTabs() - End Sub - - ' Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click - ' Me.Close() - ' End Sub - Private Sub txtFeld_GotFocus(sender As Object, e As System.EventArgs) Handles txtFreierText.GotFocus, txtSpedition.GotFocus CType(sender, TextBox).SelectAll() End Sub @@ -931,8 +234,7 @@ Public Class frmAddSendungsvermerkShort End If End If - - 'Plausibilität prüfen + 'Plausibilität prüfen If optFreierText.Checked Then If txtFreierText.Text.Trim = "" Then showErr(lblErrGrund) @@ -943,42 +245,31 @@ Public Class frmAddSendungsvermerkShort End If For Each cb In _anforderungCheckboxes - If cb Is Nothing OrElse Not cb.Checked Then Continue For + If cb IsNot Nothing AndAlso cb.Checked Then + Dim codeId As Integer = 0 + If Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then + Dim text = "" + If _backendBezeichnungByCodeId.ContainsKey(codeId) Then + text = If(_backendBezeichnungByCodeId(codeId), "").Trim() + End If + If text = "" Then text = cb.Text.Trim() - Dim codeId As Integer - Try - codeId = CInt(cb.Tag) - Catch - Continue For - End Try + Dim sendText = txtSendung.Text.Trim() + If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then + text &= " bei Sendung '" & sendText & "'" + End If - Dim text = "" - If _backendBezeichnungByCodeId.ContainsKey(codeId) Then - text = If(_backendBezeichnungByCodeId(codeId), "").Trim() + If text <> "" Then + insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) + End If + End If End If - If text = "" Then text = cb.Text.Trim() - Dim sendText = txtSendung.Text.Trim() - If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then - text &= " bei Sendung '" & sendText & "'" - End If - - If text <> "" Then insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) Next If optFremd_ATB.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "ATB von Fremdeinsteller erhalten bei Sendung '" & txtSendung.Text.Trim & "' ", 72) If optFremd_SendungAvisiert.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Sendung '" & txtSendung.Text.Trim & "' an Fremdeinsteller avisiert", 73) ' If optSndUmmelden.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Sendung '" & txtSendung.Text.Trim & "' umgemeldet", 94) - If cbxSonstDok.Checked Then - If txtSonstigesDokumentFehlt.Text.Trim = "" Then - showErr(lblErrDokument) : txtSonstigesDokumentFehlt.Focus() : Return False - End If - insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument '" & txtSonstigesDokumentFehlt.Text.Trim & "' fehlt - angefordert.", 25) - End If - - If cbxNichtLeserlich.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Dokument(e) nachgefordert, da nicht leserlich.", 42) - - If optSpeditionWeitergeleitet.Checked = True Then If txtSpedition.Text.Trim = "" Then showErr(lblErrSpedition) @@ -1057,7 +348,6 @@ Public Class frmAddSendungsvermerkShort End Sub Sub showErr(l As Label) - lblErrDokument.Visible = False ' lblErrFach.Visible = False lblErrGrund.Visible = False ' lblErrSendungProbleme.Visible = False @@ -1081,12 +371,11 @@ Public Class frmAddSendungsvermerkShort ' optDokumente.Checked = True 'End Sub - Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) Handles cbxSonstDok.CheckedChanged, cbxNichtLeserlich.CheckedChanged + Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) ' optDokumente.Checked = True End Sub - Private Sub SonstChanged(sender As Object, e As EventArgs) Handles txtSonstigesDokumentFehlt.TextChanged + Private Sub SonstChanged(sender As Object, e As EventArgs) ' optDokumente.Checked = True - cbxSonstDok.Checked = (sender.text <> "") End Sub Private Sub txtSendungSpedition_TextChanged(sender As Object, e As EventArgs) Handles txtSendungSpedition.TextChanged, txtSpedition.TextChanged optSpeditionWeitergeleitet.Checked = True @@ -1111,8 +400,6 @@ Public Class frmAddSendungsvermerkShort txtSendung.SelectionLength = 0 txtFreierText.Focus() End Sub - - ' --- Dragging Logic --- Private drag As Boolean Private mouseX As Integer Private mouseY As Integer @@ -1142,15 +429,15 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub btnDokumtanforderung_Click(sender As Object, e As EventArgs) Handles btnDokumtanforderung.Click - _dokumentanforderungState = BuildDokumentanforderungState() - Using frm As New frmSendungsDokumentanforderung(AvisoID, SendungID, _dokumentanforderungState) + Dim resolvedAvisoId As Integer = AvisoID + If resolvedAvisoId <= 0 AndAlso myAviso IsNot Nothing AndAlso IsNumeric(myAviso.AvisoID) Then + resolvedAvisoId = CInt(myAviso.AvisoID) + End If + Dim resolvedSendungId As Integer = SendungID + Using frm As New frmSendungsDokumentanforderung(resolvedAvisoId, resolvedSendungId, Nothing) If frm.ShowDialog(Me) = DialogResult.OK Then - _dokumentanforderungState = frm.BuildState() - ApplyDokumentanforderungState(_dokumentanforderungState) - If InsertNurDokumentVermerk() Then - frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) - Me.Close() - End If + frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) + Me.Close() End If End Using End Sub @@ -1163,601 +450,4 @@ Public Class frmAddSendungsvermerkShort Me.Close() End If End Sub - - Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click - Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) - - Dim config = GetCustomerPortalApiConfig() - If config Is Nothing Then Exit Sub - - Dim jwtToken = "" - Dim authErr = "" - If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then - MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) - Exit Sub - End If - - Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing - Dim anhangsartenErr = "" - If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then - MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) - Exit Sub - End If - - Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) - If requirements Is Nothing Then - Exit Sub - End If - If requirements.Count = 0 Then - MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) - Label20.ForeColor = Color.Red - Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." - Exit Sub - End If - Label20.ForeColor = Color.FromArgb(0, 102, 153) - Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." - - Cursor = Cursors.WaitCursor - Try - Dim linkUrl = "" - Dim errorCode = "" - If Not TryCreateCustomerUploadLinkMultiWithoutEmail(config, requirements, validityHours, linkUrl, errorCode) Then - MsgBox("Fehler beim Erzeugen des Upload-Links: " & errorCode, vbExclamation) - Exit Sub - End If - - If linkUrl <> "" Then - Clipboard.SetText(linkUrl) - MsgBox("Upload-Link wurde in die Zwischenablage kopiert.", vbInformation) - Else - MsgBox("Upload-Link konnte nicht aus der Antwort gelesen werden.", vbExclamation) - End If - Finally - Cursor = Cursors.Default - End Try - End Sub - - Private Sub btnCustomerUploadEmail_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadEmail.Click - Dim recipient = If(txtCustomerUploadEmail.Text, "").Trim() - If recipient = "" Then - MsgBox("Bitte eine E-Mail-Adresse eingeben.", vbInformation) - txtCustomerUploadEmail.Focus() - Exit Sub - End If - - Try - Dim addr As New MailAddress(recipient) - recipient = addr.Address - Catch - MsgBox("E-Mail-Adresse ist ungültig.", vbInformation) - txtCustomerUploadEmail.Focus() - Exit Sub - End Try - - Dim emailText = If(txtCustomerUploadEmailText.Text, "").Trim() - If emailText = "" Then - MsgBox("Bitte den Text eintragen.", vbInformation) - txtCustomerUploadEmailText.Focus() - Exit Sub - End If - - Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) - - Dim language = "" - If cmbCustomerUploadLanguage IsNot Nothing Then - language = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), "") - If language = "" Then language = If(cmbCustomerUploadLanguage.Text, "").Trim() - End If - language = language.ToLowerInvariant() - If language <> "de" AndAlso language <> "en" AndAlso language <> "tr" AndAlso language <> "sr" AndAlso language <> "bg" Then - language = "de" - End If - - Dim config = GetCustomerPortalApiConfig() - If config Is Nothing Then Exit Sub - - Dim jwtToken = "" - Dim authErr = "" - If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then - MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) - Exit Sub - End If - - Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing - Dim anhangsartenErr = "" - If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then - MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) - Exit Sub - End If - - Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) - If requirements Is Nothing Then - Exit Sub - End If - If requirements.Count = 0 Then - MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) - Label20.ForeColor = Color.Red - Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." - Exit Sub - End If - Label20.ForeColor = Color.FromArgb(0, 102, 153) - Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." - - Cursor = Cursors.WaitCursor - Try - Dim linkUrl = "" - Dim errorCode = "" - If Not TryRequestCustomerUploadLinkMultiWithEmail(config, requirements, recipient, emailText, language, validityHours, linkUrl, errorCode) Then - MsgBox("Fehler beim Versand der E-Mail: " & errorCode, vbExclamation) - Exit Sub - End If - - If linkUrl <> "" Then - Clipboard.SetText(linkUrl) - End If - MsgBox("E-Mail wurde ausgelöst.", vbInformation) - Finally - Cursor = Cursors.Default - End Try - End Sub - - Private Class CustomerPortalApiConfig - Public Property BaseUrl As String - Public Property Username As String - Public Property Password As String - End Class - - Private Shared _customerPortalJwtToken As String = "" - Private Shared _customerPortalJwtExpUtc As DateTime = DateTime.MinValue - Private Shared _customerPortalAnhangsartenMap As Dictionary(Of String, Integer) = Nothing - Private Shared _customerPortalAnhangsartenFetchedUtc As DateTime = DateTime.MinValue - Private Shared _customerPortalCustomFilenameAnhangsartId As Integer = -1 - - Private Function GetCustomerPortalApiConfig() As CustomerPortalApiConfig - Dim baseUrl = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_BASEURL"), "").Trim() - If baseUrl = "" Then baseUrl = If(ConfigurationManager.AppSettings("CustomerPortalApiBaseUrl"), "").Trim() - If baseUrl = "" Then baseUrl = "https://login.server.verag.ag" - - Dim username = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_USERNAME"), "").Trim() - If username = "" Then username = If(ConfigurationManager.AppSettings("CustomerPortalApiUsername"), "").Trim() - - Dim password = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_PASSWORD"), "").Trim() - If password = "" Then password = If(ConfigurationManager.AppSettings("CustomerPortalApiPassword"), "").Trim() - - If username = "" OrElse password = "" Then - MsgBox("CustomerPortalApiUsername/CustomerPortalApiPassword fehlt in App.config (oder ENV: AVISO_CUSTOMERPORTAL_API_USERNAME / AVISO_CUSTOMERPORTAL_API_PASSWORD).", vbExclamation) - Return Nothing - End If - - Return New CustomerPortalApiConfig With {.BaseUrl = baseUrl, .Username = username, .Password = password} - End Function - - Private Function TryGetCustomerPortalJwtToken(ByVal config As CustomerPortalApiConfig, ByRef jwtToken As String, ByRef errorCode As String) As Boolean - jwtToken = "" - errorCode = "" - - If _customerPortalJwtToken <> "" Then - If _customerPortalJwtExpUtc = DateTime.MinValue Then - jwtToken = _customerPortalJwtToken - Return True - End If - - If DateTime.UtcNow < _customerPortalJwtExpUtc.AddMinutes(-1) Then - jwtToken = _customerPortalJwtToken - Return True - End If - End If - - Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/auth/login" - Dim payload As New Dictionary(Of String, Object) From { - {"username", config.Username}, - {"password", config.Password} - } - Dim jsonBody = JsonConvert.SerializeObject(payload) - - Try - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 - - Dim request = CType(WebRequest.Create(url), HttpWebRequest) - request.Method = "POST" - request.ContentType = "application/json" - request.Accept = "application/json" - request.Timeout = 15000 - - Using requestStream = request.GetRequestStream() - Using writer As New StreamWriter(requestStream, Encoding.UTF8) - writer.Write(jsonBody) - End Using - End Using - - Using response = CType(request.GetResponse(), HttpWebResponse) - Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) - Dim respText = reader.ReadToEnd() - Dim jobj = JObject.Parse(respText) - Dim token = (If(jobj("token"), New JValue(""))).ToString().Trim() - If token = "" Then - errorCode = "TOKEN_MISSING" - Return False - End If - - _customerPortalJwtToken = token - _customerPortalJwtExpUtc = ExtractJwtExpUtcOrMin(token) - - jwtToken = token - Return True - End Using - End Using - - Catch ex As WebException - Dim body = "" - Try - If ex.Response IsNot Nothing Then - Using respStream = ex.Response.GetResponseStream() - If respStream IsNot Nothing Then - Using reader As New StreamReader(respStream, Encoding.UTF8) - body = reader.ReadToEnd() - End Using - End If - End Using - End If - Catch - End Try - - If body <> "" Then - Try - Dim jobj = JObject.Parse(body) - errorCode = (If(jobj("message"), New JValue(ex.Message))).ToString() - Catch - errorCode = ex.Message - End Try - Else - errorCode = ex.Message - End If - Return False - Catch ex As Exception - errorCode = ex.Message - Return False - End Try - End Function - - Private Function ExtractJwtExpUtcOrMin(ByVal jwt As String) As DateTime - Try - If jwt Is Nothing Then Return DateTime.MinValue - Dim parts = jwt.Split("."c) - If parts.Length < 2 Then Return DateTime.MinValue - - Dim payloadJson = Encoding.UTF8.GetString(Base64UrlDecode(parts(1))) - Dim jobj = JObject.Parse(payloadJson) - Dim expToken = jobj("exp") - If expToken Is Nothing Then Return DateTime.MinValue - - Dim expSeconds As Long - If Long.TryParse(expToken.ToString(), expSeconds) Then - Return DateTimeOffset.FromUnixTimeSeconds(expSeconds).UtcDateTime - End If - Catch - End Try - Return DateTime.MinValue - End Function - - Private Function Base64UrlDecode(ByVal input As String) As Byte() - Dim s = If(input, "").Replace("-"c, "+"c).Replace("_"c, "/"c) - Select Case (s.Length Mod 4) - Case 2 - s &= "==" - Case 3 - s &= "=" - End Select - Return Convert.FromBase64String(s) - End Function - - Private Function BuildCustomerUploadRequirements(ByVal anhangsartenMap As Dictionary(Of String, Integer)) As List(Of Object) - Dim requirements As New List(Of Object) - - Dim missing As New List(Of String) - - For Each cb In _anforderungCheckboxes - If cb Is Nothing OrElse Not cb.Checked Then Continue For - - Dim documentType = GetEffectiveDocumentName(cb) - If documentType = "" Then Continue For - Dim baseText = GetDocumentBaseText(cb) - Dim validationError = "" - - Dim anhangsartId = GetEffectiveAnhangsartId(cb) - If anhangsartId <= 0 Then - missing.Add(documentType) - Continue For - End If - If Not ValidateDocumentSelectionPayload(documentType, baseText, anhangsartId, validationError) Then - MsgBox("Ungültige Eingabe für Dokument '" & documentType & "': " & validationError, vbInformation) - Return Nothing - End If - - AddCustomerUploadRequirementByAnhangsartId(requirements, documentType, anhangsartId, BuildUploadCustomText(baseText)) - Next - - If cbxSonstDok.Checked Then - Dim custom = If(txtSonstigesDokumentFehlt.Text, "").Trim() - If custom = "" Then - MsgBox("Bitte den Dokumentnamen eintragen.", vbInformation) - txtSonstigesDokumentFehlt.Focus() - Return Nothing - End If - AddCustomerUploadRequirement(requirements, missing, anhangsartenMap, True, custom, {"SONSTIGES", "DOKUMENT"}, "Bitte " & custom & " hochladen.", True) - End If - - If missing.Count > 0 Then - MsgBox("Anhangsarten nicht gefunden: " & String.Join(", ", missing), vbExclamation) - Return Nothing - End If - - Return requirements - End Function - - Private Sub AddCustomerUploadRequirementByAnhangsartId(ByVal requirements As List(Of Object), ByVal documentType As String, ByVal anhangsartId As Integer, ByVal customText As String) - If requirements Is Nothing Then Exit Sub - If anhangsartId <= 0 Then Exit Sub - - Dim req As New Dictionary(Of String, Object) From { - {"documentType", documentType}, - {"anhangsartId", anhangsartId}, - {"customText", customText} - } - requirements.Add(req) - End Sub - - Private Sub AddCustomerUploadRequirement(ByVal requirements As List(Of Object), ByVal missing As List(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer), ByVal isSelected As Boolean, ByVal documentType As String, ByVal anhangsartenCandidates As String(), ByVal customText As String, ByVal allowCustomFilename As Boolean) - If Not isSelected Then Exit Sub - - Dim anhangsartId = ResolveAnhangsartId(anhangsartenCandidates, anhangsartenMap) - If anhangsartId <= 0 AndAlso allowCustomFilename AndAlso _customerPortalCustomFilenameAnhangsartId > 0 Then - anhangsartId = _customerPortalCustomFilenameAnhangsartId - End If - If anhangsartId <= 0 Then - missing.Add(documentType) - Exit Sub - End If - - Dim req As New Dictionary(Of String, Object) From { - {"documentType", documentType}, - {"anhangsartId", anhangsartId}, - {"customText", customText} - } - requirements.Add(req) - End Sub - - Private Function ResolveAnhangsartId(ByVal candidates As IEnumerable(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer)) As Integer - If candidates Is Nothing OrElse anhangsartenMap Is Nothing Then Return -1 - - For Each c In candidates - Dim key = If(c, "").Trim() - If key = "" Then Continue For - - Dim id As Integer - If anhangsartenMap.TryGetValue(key.ToUpperInvariant(), id) Then - Return id - End If - Next - - Return -1 - End Function - - Private Function TryGetCustomerPortalAnhangsartenMap(ByVal config As CustomerPortalApiConfig, ByVal jwtToken As String, ByRef anhangsartenMap As Dictionary(Of String, Integer), ByRef errorCode As String) As Boolean - anhangsartenMap = Nothing - errorCode = "" - - If _customerPortalAnhangsartenMap IsNot Nothing AndAlso _customerPortalAnhangsartenFetchedUtc <> DateTime.MinValue Then - If DateTime.UtcNow < _customerPortalAnhangsartenFetchedUtc.AddMinutes(30) Then - anhangsartenMap = _customerPortalAnhangsartenMap - Return True - End If - End If - - Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/AvisoUpload/anhangsarten/all" - Dim request = CType(WebRequest.Create(url), HttpWebRequest) - request.Method = "GET" - request.Accept = "application/json" - request.Timeout = 15000 - request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken - - Try - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 - Using response = CType(request.GetResponse(), HttpWebResponse) - Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) - Dim respText = reader.ReadToEnd() - If respText Is Nothing Then respText = "" - respText = respText.Trim() - - Dim map As New Dictionary(Of String, Integer)(StringComparer.OrdinalIgnoreCase) - Dim customFilenameId As Integer = -1 - - If respText.StartsWith("[") Then - Dim arr = JArray.Parse(respText) - For Each t In arr - Dim id = 0 - If t("id") IsNot Nothing AndAlso Integer.TryParse(t("id").ToString(), id) Then - Dim name = (If(t("name"), New JValue(""))).ToString().Trim() - Dim bez = (If(t("bezeichnung"), New JValue(""))).ToString().Trim() - If name <> "" Then map(name.ToUpperInvariant()) = id - If bez <> "" Then map(bez.ToUpperInvariant()) = id - If id = 24 Then customFilenameId = 24 - End If - Next - ElseIf respText.StartsWith("{") Then - Dim jobj = JObject.Parse(respText) - errorCode = (If(jobj("message"), If(jobj("code"), New JValue("ANHANGSARTEN_LOAD_FAILED")))).ToString() - Return False - Else - errorCode = "ANHANGSARTEN_INVALID_RESPONSE" - Return False - End If - - If map.Count = 0 Then - errorCode = "ANHANGSARTEN_EMPTY" - Return False - End If - - _customerPortalCustomFilenameAnhangsartId = customFilenameId - _customerPortalAnhangsartenMap = map - _customerPortalAnhangsartenFetchedUtc = DateTime.UtcNow - - anhangsartenMap = map - Return True - End Using - End Using - Catch ex As WebException - errorCode = ReadWebExceptionMessage(ex) - Return False - Catch ex As Exception - errorCode = ex.Message - Return False - End Try - End Function - - Private Function TryCreateCustomerUploadLinkMultiWithoutEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean - linkUrl = "" - errorCode = "" - - Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/create-upload-link-multi" - Dim payload As New Dictionary(Of String, Object) From { - {"avisoId", AvisoID}, - {"validityHours", validityHours}, - {"requirements", requirements} - } - - If SendungID > 0 Then payload("sendungsId") = SendungID - - Dim jsonBody = JsonConvert.SerializeObject(payload) - - Dim jwtToken = "" - Dim authErr = "" - If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then - errorCode = authErr - Return False - End If - - Try - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 - Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) - - Catch ex As WebException - errorCode = ReadWebExceptionMessage(ex) - Return False - Catch ex As Exception - errorCode = ex.Message - Return False - End Try - End Function - - Private Function TryRequestCustomerUploadLinkMultiWithEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal recipientEmail As String, ByVal emailText As String, ByVal language As String, ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean - linkUrl = "" - errorCode = "" - - Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/request-upload-link-multi" - If language Is Nothing OrElse language.Trim() = "" Then language = "de" - - Dim payload As New Dictionary(Of String, Object) From { - {"avisoId", AvisoID}, - {"emailText", emailText}, - {"language", language}, - {"validityHours", validityHours}, - {"requirements", requirements} - } - - If SendungID > 0 Then payload("sendungsId") = SendungID - payload("recipientEmail") = recipientEmail - - Dim jsonBody = JsonConvert.SerializeObject(payload) - - Dim jwtToken = "" - Dim authErr = "" - If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then - errorCode = authErr - Return False - End If - - Try - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 - Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) - Catch ex As WebException - errorCode = ReadWebExceptionMessage(ex) - Return False - Catch ex As Exception - errorCode = ex.Message - Return False - End Try - End Function - - Private Function TryPostCustomerPortalJson(ByVal url As String, ByVal jwtToken As String, ByVal jsonBody As String, ByRef linkUrl As String, ByRef errorCode As String) As Boolean - Dim request = CType(WebRequest.Create(url), HttpWebRequest) - request.Method = "POST" - request.ContentType = "application/json" - request.Accept = "application/json" - request.Timeout = 15000 - request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken - - Using requestStream = request.GetRequestStream() - Using writer As New StreamWriter(requestStream, Encoding.UTF8) - writer.Write(jsonBody) - End Using - End Using - - Using response = CType(request.GetResponse(), HttpWebResponse) - Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) - Dim respText = reader.ReadToEnd() - Dim jobj = JObject.Parse(respText) - Dim result = (If(jobj("result"), New JValue(""))).ToString() - If String.Equals(result, "pass", StringComparison.OrdinalIgnoreCase) Then - Dim link = (If(jobj.SelectToken("data.linkUrl"), New JValue(""))).ToString() - If link = "" Then link = (If(jobj.SelectToken("linkUrl"), New JValue(""))).ToString() - linkUrl = link - Return True - End If - errorCode = (If(jobj("message"), New JValue("UNKNOWN_ERROR"))).ToString() - Return False - End Using - End Using - End Function - - Private Function ReadWebExceptionMessage(ByVal ex As WebException) As String - Dim body = "" - Try - If ex.Response IsNot Nothing Then - Using respStream = ex.Response.GetResponseStream() - If respStream IsNot Nothing Then - Using reader As New StreamReader(respStream, Encoding.UTF8) - body = reader.ReadToEnd() - End Using - End If - End Using - End If - Catch - End Try - - If body <> "" Then - Try - Dim jobj = JObject.Parse(body) - Return (If(jobj("message"), New JValue(ex.Message))).ToString() - Catch - Return ex.Message - End Try - End If - - Return ex.Message - End Function - - Private Class AnhangsartOption - Public ReadOnly Id As Integer - Public ReadOnly Text As String - - Public Sub New(id As Integer, text As String) - Me.Id = id - Me.Text = If(text, "").Trim() - End Sub - - Public Overrides Function ToString() As String - Return Text - End Function - End Class End Class diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb index 0288998..1277d14 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -33,11 +33,13 @@ Public Class frmSendungsDokumentanforderung Private Shared _customerPortalAnhangsartenFetchedUtc As DateTime = DateTime.MinValue Private Shared _customerPortalCustomFilenameAnhangsartId As Integer = -1 Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) + Private ReadOnly _kundenFirmaByNr As New Dictionary(Of Integer, String) + Private _kontaktRolleTabs As TabControl - Public Sub New(avisoId As Integer, sendungId As Integer, state As DokumentanforderungState) + Public Sub New(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) InitializeComponent() - AvisoID = avisoId - SendungID = sendungId + AvisoID = avisoIdValue + SendungID = sendungIdValue Icon = cMeineFunktionenAVISO.GetProgrammIcon _stateToApply = If(state, New DokumentanforderungState()) End Sub @@ -45,6 +47,7 @@ Public Class frmSendungsDokumentanforderung Private ReadOnly _stateToApply As DokumentanforderungState Private Sub frmSendungsDokumentanforderung_Load(sender As Object, e As EventArgs) Handles MyBase.Load + ResolveContextIds() VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) If cmbCustomerUploadLanguage.SelectedIndex < 0 Then Dim idx = cmbCustomerUploadLanguage.Items.IndexOf("de") @@ -62,17 +65,25 @@ Public Class frmSendungsDokumentanforderung LoadKontaktEmails() End Sub + Private Sub ResolveContextIds() + If AvisoID > 0 AndAlso SendungID <> 0 Then Return + + Dim parentForm = TryCast(Me.Owner, frmAddSendungsvermerkShort) + If parentForm IsNot Nothing Then + If AvisoID <= 0 AndAlso parentForm.AvisoID > 0 Then + AvisoID = parentForm.AvisoID + End If + If SendungID = 0 AndAlso parentForm.SendungID <> 0 Then + SendungID = parentForm.SendungID + End If + End If + End Sub + Private Sub InitializeKontaktEmailGrid() + EnsureKontaktRolleTabs() If dgvKontaktEmails.Columns.Count > 0 Then Return dgvKontaktEmails.AutoGenerateColumns = False - Dim colRolle As New DataGridViewTextBoxColumn() - colRolle.Name = "colRolle" - colRolle.HeaderText = "Rolle" - colRolle.DataPropertyName = "Rolle" - colRolle.Width = 100 - dgvKontaktEmails.Columns.Add(colRolle) - Dim colArt As New DataGridViewTextBoxColumn() colArt.Name = "colArt" colArt.HeaderText = "Art" @@ -80,6 +91,13 @@ Public Class frmSendungsDokumentanforderung colArt.Width = 130 dgvKontaktEmails.Columns.Add(colArt) + Dim colFirma As New DataGridViewTextBoxColumn() + colFirma.Name = "colFirma" + colFirma.HeaderText = "Firma" + colFirma.DataPropertyName = "Firma" + colFirma.Width = 180 + dgvKontaktEmails.Columns.Add(colFirma) + Dim colEmail As New DataGridViewTextBoxColumn() colEmail.Name = "colEmail" colEmail.HeaderText = "E-Mail" @@ -93,7 +111,7 @@ Public Class frmSendungsDokumentanforderung dgvKontaktEmails.Rows.Clear() Dim dedupe As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase) - + Dim fraechterKdNr As Integer = 0 Dim auftraggeberKdNr As Integer = 0 Dim avisiererKdNr As Integer = 0 @@ -115,12 +133,11 @@ Public Class frmSendungsDokumentanforderung End If If AvisoID > 0 Then - Dim dtAviso = AvisoDAL.loadDataTableBySQL("SELECT Frächter_KdNr, Auftraggeber_KdNr FROM tblAviso WHERE AvisoID = " & AvisoID) - If dtAviso IsNot Nothing AndAlso dtAviso.Rows.Count > 0 Then - Dim r = dtAviso.Rows(0) - fraechterKdNr = ToIntSafe(r("Frächter_KdNr")) + Dim aviso = AvisoDAL.LesenAviso(AvisoID, "") + If aviso IsNot Nothing Then + fraechterKdNr = ToIntSafe(aviso.Frächter_KdNr) If auftraggeberKdNr = 0 Then - auftraggeberKdNr = ToIntSafe(r("Auftraggeber_KdNr")) + auftraggeberKdNr = ToIntSafe(aviso.Auftraggeber_KdNr) End If End If End If @@ -134,82 +151,111 @@ Public Class frmSendungsDokumentanforderung AddKontaktEmailsByKunde("Absender", absenderKdNr, dedupe) AddKontaktEmailsByKunde("Frachtführer", frachtfuehrerKdNr, dedupe) + RefreshKontaktRolleTabs() + End Sub + + Private Sub EnsureKontaktRolleTabs() + If _kontaktRolleTabs IsNot Nothing Then Return + + _kontaktRolleTabs = New TabControl() + _kontaktRolleTabs.Name = "tbKontaktRollen" + _kontaktRolleTabs.Location = New Point(dgvKontaktEmails.Left, dgvKontaktEmails.Top) + _kontaktRolleTabs.Size = New Size(dgvKontaktEmails.Width, 24) + _kontaktRolleTabs.Anchor = dgvKontaktEmails.Anchor + + AddHandler _kontaktRolleTabs.SelectedIndexChanged, AddressOf KontaktRolleTabs_SelectedIndexChanged + + Controls.Add(_kontaktRolleTabs) + _kontaktRolleTabs.BringToFront() + + dgvKontaktEmails.Top = _kontaktRolleTabs.Bottom + 4 + dgvKontaktEmails.Height = btnVermerkSetzen.Top - dgvKontaktEmails.Top - 6 + End Sub + + Private Sub RefreshKontaktRolleTabs() + EnsureKontaktRolleTabs() + + Dim selectedRolle = GetSelectedKontaktRolle() + RemoveHandler _kontaktRolleTabs.SelectedIndexChanged, AddressOf KontaktRolleTabs_SelectedIndexChanged + _kontaktRolleTabs.TabPages.Clear() + + Dim rollen As New List(Of String) For Each row In _kontaktEmailRows - dgvKontaktEmails.Rows.Add(row.Rolle, row.Art, row.Email) + If row Is Nothing Then Continue For + If rollen.Contains(row.Rolle) Then Continue For + rollen.Add(row.Rolle) + Dim page As New TabPage(row.Rolle) + page.Tag = row.Rolle + _kontaktRolleTabs.TabPages.Add(page) Next + + _kontaktRolleTabs.Visible = _kontaktRolleTabs.TabPages.Count > 0 + + If _kontaktRolleTabs.TabPages.Count > 0 Then + Dim selectedIndex As Integer = 0 + For i As Integer = 0 To _kontaktRolleTabs.TabPages.Count - 1 + If String.Equals(_kontaktRolleTabs.TabPages(i).Tag.ToString(), selectedRolle, StringComparison.OrdinalIgnoreCase) Then + selectedIndex = i + Exit For + End If + Next + _kontaktRolleTabs.SelectedIndex = selectedIndex + End If + + AddHandler _kontaktRolleTabs.SelectedIndexChanged, AddressOf KontaktRolleTabs_SelectedIndexChanged + BindKontaktEmailsForSelectedRolle() + End Sub + + Private Function GetSelectedKontaktRolle() As String + If _kontaktRolleTabs Is Nothing Then Return "" + If _kontaktRolleTabs.SelectedTab Is Nothing Then Return "" + Return If(_kontaktRolleTabs.SelectedTab.Tag, "").ToString().Trim() + End Function + + Private Sub BindKontaktEmailsForSelectedRolle() + dgvKontaktEmails.Rows.Clear() + + Dim selectedRolle = GetSelectedKontaktRolle() + For Each row In _kontaktEmailRows + If row Is Nothing Then Continue For + If selectedRolle <> "" AndAlso Not String.Equals(row.Rolle, selectedRolle, StringComparison.OrdinalIgnoreCase) Then Continue For + dgvKontaktEmails.Rows.Add(row.Art, row.Firma, row.Email) + Next + If If(txtCustomerUploadEmail.Text, "").Trim() = "" AndAlso dgvKontaktEmails.Rows.Count > 0 Then txtCustomerUploadEmail.Text = If(dgvKontaktEmails.Rows(0).Cells("colEmail").Value, "").ToString().Trim() End If End Sub + Private Sub KontaktRolleTabs_SelectedIndexChanged(sender As Object, e As EventArgs) + BindKontaktEmailsForSelectedRolle() + End Sub + Private Sub AddKontaktEmailsByKunde(rolle As String, kundenNr As Integer, dedupe As HashSet(Of String)) If kundenNr <= 0 Then Return - - ' 1. E-Mails aus Kundenstammdaten laden (direkt von Datenbank) - Try - Dim sql As String = "SELECT E_Mail, E_Mail2 FROM Adressen WHERE AdressenNr = " & kundenNr - Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) - Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) - Using reader = cmd.ExecuteReader() - If reader.Read() Then - Dim email1 = If(reader("E_Mail") Is DBNull.Value, "", reader("E_Mail").ToString().Trim()) - Dim email2 = If(reader("E_Mail2") Is DBNull.Value, "", reader("E_Mail2").ToString().Trim()) - - If email1 <> "" Then - For Each splitEmail In email1.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) - Dim em = splitEmail.Trim() - If em = "" Then Continue For - Dim key1 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() - If Not dedupe.Contains(key1) Then - dedupe.Add(key1) - _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) - End If - Next - End If - - If email2 <> "" Then - For Each splitEmail In email2.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) - Dim em = splitEmail.Trim() - If em = "" Then Continue For - Dim key2 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() - If Not dedupe.Contains(key2) Then - dedupe.Add(key2) - _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) - End If - Next - End If - End If - End Using - End Using - End Using - Catch - End Try + Dim firma = GetKundenFirma(kundenNr) - ' 2. E-Mails aus E-Mail-Benachrichtigungen (Sendungsdetails) laden (direkt von Datenbank) Try - Dim sql As String = "SELECT eb_ebartId, eb_EMail, eb_cc, eb_bcc FROM tblEmailBenachrichtigung WHERE eb_KundenNr = " & kundenNr + Dim sql As String = "SELECT * FROM tblKundenKontakt WHERE kkd_KundenNr = " & kundenNr Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) Using reader = cmd.ExecuteReader() While reader.Read() - Dim artId = If(reader("eb_ebartId") Is DBNull.Value, 0, Convert.ToInt32(reader("eb_ebartId"))) - Dim email = If(reader("eb_EMail") Is DBNull.Value, "", reader("eb_EMail").ToString().Trim()) - Dim isCc = If(reader("eb_cc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_cc"))) - Dim isBcc = If(reader("eb_bcc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_bcc"))) - - If email = "" Then Continue While - - Dim empfaengerArt = If(isBcc, "BCC", If(isCc, "CC", "AN")) - Dim artText = ResolveMailArtLabel(artId) & " / " & empfaengerArt - - For Each splitEmail In email.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) - Dim em = splitEmail.Trim() - If em = "" Then Continue For - Dim key = rolle & "|" & kundenNr.ToString() & "|" & artText & "|" & em.ToLowerInvariant() - If Not dedupe.Contains(key) Then - dedupe.Add(key) - _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = artText, .Email = em}) - End If + Dim artText = GetStringValue(reader, "kkd_kkaBez") + If artText = "" Then artText = "Kontakt" + Dim emails = GetStringValues(reader, "kkd_EMail", "kkd_EMail2", "kkd_Email", "kkd_Email2", "kkd_Mail", "kkd_Mail2", "EMail", "EMail2", "Email", "Email2", "Mail", "Mail2") + If emails.Count = 0 Then Continue While + + For Each email In emails + For Each splitEmail In email.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key = rolle & "|" & kundenNr.ToString() & "|" & artText & "|" & em.ToLowerInvariant() + If Not dedupe.Contains(key) Then + dedupe.Add(key) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = artText, .Firma = firma, .Email = em}) + End If + Next Next End While End Using @@ -219,21 +265,57 @@ Public Class frmSendungsDokumentanforderung End Try End Sub - Private Function ResolveMailArtLabel(artId As Integer) As String - Select Case artId - Case 1 - Return "Ankunft" - Case 2 - Return "Freigabe" - Case 3 - Return "Ankunft Export" - Case 4 - Return "Freigabe Export" - Case 5 - Return "Status" - Case Else - Return "Unbekannt" - End Select + Private Function GetStringValue(reader As IDataRecord, fieldName As String) As String + For i As Integer = 0 To reader.FieldCount - 1 + If String.Equals(reader.GetName(i), fieldName, StringComparison.OrdinalIgnoreCase) Then + If reader.IsDBNull(i) Then Return "" + Return reader(i).ToString().Trim() + End If + Next + + Return "" + End Function + + Private Function GetStringValues(reader As IDataRecord, ParamArray fieldNames() As String) As List(Of String) + Dim values As New List(Of String) + Dim seen As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase) + + For Each fieldName In fieldNames + Dim value = GetStringValue(reader, fieldName) + If value = "" Then Continue For + If seen.Contains(value) Then Continue For + seen.Add(value) + values.Add(value) + Next + + Return values + End Function + + Private Function GetKundenFirma(kundenNr As Integer) As String + If kundenNr <= 0 Then Return "" + If _kundenFirmaByNr.ContainsKey(kundenNr) Then Return _kundenFirmaByNr(kundenNr) + + Dim firma As String = "" + + Try + Dim sql As String = "SELECT TOP 1 [Name 1], [Ordnungsbegriff] FROM Adressen WHERE AdressenNr = " & kundenNr + Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) + Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) + Using reader = cmd.ExecuteReader() + If reader.Read() Then + firma = If(reader("Name 1") Is DBNull.Value, "", reader("Name 1").ToString().Trim()) + If firma = "" Then + firma = If(reader("Ordnungsbegriff") Is DBNull.Value, "", reader("Ordnungsbegriff").ToString().Trim()) + End If + End If + End Using + End Using + End Using + Catch + End Try + + _kundenFirmaByNr(kundenNr) = firma + Return firma End Function Private Function ToIntSafe(value As Object) As Integer @@ -1179,6 +1261,7 @@ Public Class frmSendungsDokumentanforderung Private Class KontaktEmailRow Public Property Rolle As String Public Property Art As String + Public Property Firma As String Public Property Email As String End Class