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