From e85d7ec574cde9775d6bc33cca0e60d4a669e171 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Mon, 27 Apr 2026 16:56:08 +0200 Subject: [PATCH 01/15] exg --- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmHauptfenster.Designer.vb | 223 +++++++++++++++------------ Aviso/frmHauptfenster.vb | 10 ++ Aviso/frmHauptfensterNew.Designer.vb | 107 ++++++++----- Aviso/frmHauptfensterNew.vb | 11 ++ 5 files changed, 213 insertions(+), 142 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index d834ce7..b036dad 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/frmHauptfenster.Designer.vb b/Aviso/frmHauptfenster.Designer.vb index 62f3ce4..f95d68c 100644 --- a/Aviso/frmHauptfenster.Designer.vb +++ b/Aviso/frmHauptfenster.Designer.vb @@ -24,15 +24,15 @@ Partial Class frmHauptfenster Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmHauptfenster)) - Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle13 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle14 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle15 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle16 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle17 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle18 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle28 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle29 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle30 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle31 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle32 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle33 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle34 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle35 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle36 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.mnuInfo = New System.Windows.Forms.ToolStripMenuItem() Me.conÜbernehmen = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso = New System.Windows.Forms.ContextMenuStrip(Me.components) @@ -99,6 +99,7 @@ Partial Class frmHauptfenster Me.NEUToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.AMBToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DTBToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.KLIPPHAUSENToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SpracheWechselnToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DeutschToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.EnglishToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -424,7 +425,9 @@ Partial Class frmHauptfenster Me.UsrCntlBenachrichtigungen2 = New AVISO.usrCntlBenachrichtigungen() Me.Panel5 = New System.Windows.Forms.Panel() Me.Panel7 = New System.Windows.Forms.Panel() - Me.KLIPPHAUSENToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem23 = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem25 = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.pnlDetailsRechts.SuspendLayout() @@ -843,46 +846,52 @@ Partial Class frmHauptfenster 'SUBToolStripMenuItem ' Me.SUBToolStripMenuItem.Name = "SUBToolStripMenuItem" - Me.SUBToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.SUBToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.SUBToolStripMenuItem.Text = "SUB" ' 'SBGToolStripMenuItem ' Me.SBGToolStripMenuItem.Name = "SBGToolStripMenuItem" - Me.SBGToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.SBGToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.SBGToolStripMenuItem.Text = "SBG" ' 'WAIToolStripMenuItem ' Me.WAIToolStripMenuItem.Name = "WAIToolStripMenuItem" - Me.WAIToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.WAIToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.WAIToolStripMenuItem.Text = "WAI" ' 'NKDToolStripMenuItem ' Me.NKDToolStripMenuItem.Name = "NKDToolStripMenuItem" - Me.NKDToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.NKDToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.NKDToolStripMenuItem.Text = "NKD" ' 'NEUToolStripMenuItem ' Me.NEUToolStripMenuItem.Name = "NEUToolStripMenuItem" - Me.NEUToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.NEUToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.NEUToolStripMenuItem.Text = "NEU" ' 'AMBToolStripMenuItem ' Me.AMBToolStripMenuItem.Name = "AMBToolStripMenuItem" - Me.AMBToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.AMBToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.AMBToolStripMenuItem.Text = "AMB" Me.AMBToolStripMenuItem.Visible = False ' 'DTBToolStripMenuItem ' Me.DTBToolStripMenuItem.Name = "DTBToolStripMenuItem" - Me.DTBToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.DTBToolStripMenuItem.Size = New System.Drawing.Size(150, 22) Me.DTBToolStripMenuItem.Text = "DTB" ' + 'KLIPPHAUSENToolStripMenuItem + ' + Me.KLIPPHAUSENToolStripMenuItem.Name = "KLIPPHAUSENToolStripMenuItem" + Me.KLIPPHAUSENToolStripMenuItem.Size = New System.Drawing.Size(150, 22) + Me.KLIPPHAUSENToolStripMenuItem.Text = "KLIPPHAUSEN" + ' 'SpracheWechselnToolStripMenuItem ' Me.SpracheWechselnToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DeutschToolStripMenuItem, Me.EnglishToolStripMenuItem, Me.TürkischToolStripMenuItem}) @@ -1294,7 +1303,7 @@ Partial Class frmHauptfenster 'ToolStripFormulare ' Me.ToolStripFormulare.BackColor = System.Drawing.Color.White - Me.ToolStripFormulare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MANAGERToolStripMenuItem, Me.ToolStripSeparator3, Me.MailvorlagenToolStripMenuItem, Me.ToolStripMenuItem2, Me.ToolStripMenuItem7, Me.ToolStripMenuItem12, Me.ToolStripMenuItem15, Me.ToolStripMenuItem18, Me.AuftragÜberwachungsdokumentToolStripMenuItem, Me.toolVUB, Me.toolVPCreditreform, Me.ToolStripSeparator9, Me.VerzollungsunterlagenToolStripMenuItem, Me.ToolStripMenuItem11, Me.ToolStripSeparator6, Me.WAIDHAUSToolStripMenuItem, Me.ToolStripSeparator13, Me.EinheitspapierToolStripMenuItem, Me.CMRToolStripMenuItem, Me.Einheitspapier0735VersandverfahrenToolStripMenuItem, Me.CarnetTIRToolStripMenuItem, Me.CarnetTIRALTToolStripMenuItem}) + Me.ToolStripFormulare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MANAGERToolStripMenuItem, Me.ToolStripSeparator3, Me.MailvorlagenToolStripMenuItem, Me.ToolStripMenuItem2, Me.ToolStripMenuItem7, Me.ToolStripMenuItem12, Me.ToolStripMenuItem15, Me.ToolStripMenuItem18, Me.AuftragÜberwachungsdokumentToolStripMenuItem, Me.toolVUB, Me.toolVPCreditreform, Me.ToolStripSeparator9, Me.VerzollungsunterlagenToolStripMenuItem, Me.ToolStripMenuItem11, Me.ToolStripSeparator6, Me.WAIDHAUSToolStripMenuItem, Me.ToolStripMenuItem3, Me.ToolStripSeparator13, Me.EinheitspapierToolStripMenuItem, Me.CMRToolStripMenuItem, Me.Einheitspapier0735VersandverfahrenToolStripMenuItem, Me.CarnetTIRToolStripMenuItem, Me.CarnetTIRALTToolStripMenuItem}) Me.ToolStripFormulare.Font = New System.Drawing.Font("Segoe UI", 9.0!) Me.ToolStripFormulare.ForeColor = System.Drawing.Color.Black Me.ToolStripFormulare.ImageAlign = System.Drawing.ContentAlignment.BottomRight @@ -1308,20 +1317,20 @@ Partial Class frmHauptfenster Me.MANAGERToolStripMenuItem.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Bold) Me.MANAGERToolStripMenuItem.Image = Global.AVISO.My.Resources.Resources.android_note Me.MANAGERToolStripMenuItem.Name = "MANAGERToolStripMenuItem" - Me.MANAGERToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.MANAGERToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.MANAGERToolStripMenuItem.Text = "Formular - Manager" ' 'ToolStripSeparator3 ' Me.ToolStripSeparator3.Name = "ToolStripSeparator3" - Me.ToolStripSeparator3.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator3.Size = New System.Drawing.Size(282, 6) ' 'MailvorlagenToolStripMenuItem ' Me.MailvorlagenToolStripMenuItem.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Bold) Me.MailvorlagenToolStripMenuItem.Image = Global.AVISO.My.Resources.Resources.stift Me.MailvorlagenToolStripMenuItem.Name = "MailvorlagenToolStripMenuItem" - Me.MailvorlagenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.MailvorlagenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.MailvorlagenToolStripMenuItem.Text = "Mailvorlagen" Me.MailvorlagenToolStripMenuItem.Visible = False ' @@ -1329,7 +1338,7 @@ Partial Class frmHauptfenster ' Me.ToolStripMenuItem2.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStrVM_de, Me.ZollvollmachtDEFiskalToolStripMenuItem, Me.toolStrVM_at, Me.toolStrVM_at4200, Me.ZollvollmachtATEVToolStripMenuItem}) Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2" - Me.ToolStripMenuItem2.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem2.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem2.Text = "Vollmachten" ' 'toolStrVM_de @@ -1365,38 +1374,38 @@ Partial Class frmHauptfenster 'ToolStripMenuItem7 ' Me.ToolStripMenuItem7.Name = "ToolStripMenuItem7" - Me.ToolStripMenuItem7.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem7.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem7.Text = "Gestellungsgarantien" ' 'ToolStripMenuItem12 ' Me.ToolStripMenuItem12.Name = "ToolStripMenuItem12" - Me.ToolStripMenuItem12.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem12.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem12.Text = "Importaviso" ' 'ToolStripMenuItem15 ' Me.ToolStripMenuItem15.Name = "ToolStripMenuItem15" - Me.ToolStripMenuItem15.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem15.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem15.Text = "Dispoliste" ' 'ToolStripMenuItem18 ' Me.ToolStripMenuItem18.Name = "ToolStripMenuItem18" - Me.ToolStripMenuItem18.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem18.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem18.Text = "Verzollungspreise" ' 'AuftragÜberwachungsdokumentToolStripMenuItem ' Me.AuftragÜberwachungsdokumentToolStripMenuItem.Name = "AuftragÜberwachungsdokumentToolStripMenuItem" - Me.AuftragÜberwachungsdokumentToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.AuftragÜberwachungsdokumentToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.AuftragÜberwachungsdokumentToolStripMenuItem.Text = "Auftrag Überwachungsdokument" ' 'toolVUB ' Me.toolVUB.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.VUBVERAGSpeditionAGToolStripMenuItem, Me.VeragCustomsServiceToolStripMenuItem}) Me.toolVUB.Name = "toolVUB" - Me.toolVUB.Size = New System.Drawing.Size(277, 22) + Me.toolVUB.Size = New System.Drawing.Size(285, 30) Me.toolVUB.Text = "VUB" ' 'VUBVERAGSpeditionAGToolStripMenuItem @@ -1414,37 +1423,37 @@ Partial Class frmHauptfenster 'toolVPCreditreform ' Me.toolVPCreditreform.Name = "toolVPCreditreform" - Me.toolVPCreditreform.Size = New System.Drawing.Size(277, 22) + Me.toolVPCreditreform.Size = New System.Drawing.Size(285, 30) Me.toolVPCreditreform.Text = "Bonitätsauskunft (Creditreform)" Me.toolVPCreditreform.Visible = False ' 'ToolStripSeparator9 ' Me.ToolStripSeparator9.Name = "ToolStripSeparator9" - Me.ToolStripSeparator9.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator9.Size = New System.Drawing.Size(282, 6) ' 'VerzollungsunterlagenToolStripMenuItem ' Me.VerzollungsunterlagenToolStripMenuItem.Name = "VerzollungsunterlagenToolStripMenuItem" - Me.VerzollungsunterlagenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.VerzollungsunterlagenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.VerzollungsunterlagenToolStripMenuItem.Text = "Verzollungsunterlagen" ' 'ToolStripMenuItem11 ' Me.ToolStripMenuItem11.Name = "ToolStripMenuItem11" - Me.ToolStripMenuItem11.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem11.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem11.Text = "Verzollungsunterlagen BAR" ' 'ToolStripSeparator6 ' Me.ToolStripSeparator6.Name = "ToolStripSeparator6" - Me.ToolStripSeparator6.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator6.Size = New System.Drawing.Size(282, 6) ' 'WAIDHAUSToolStripMenuItem ' Me.WAIDHAUSToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem8, Me.ToolStripMenuItem9, Me.AnnahmeblattIMPORTToolStripMenuItem, Me.AnnahmeblattEXPORTToolStripMenuItem, Me.ChecklisteVerwahrlagerToolStripMenuItem}) Me.WAIDHAUSToolStripMenuItem.Name = "WAIDHAUSToolStripMenuItem" - Me.WAIDHAUSToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.WAIDHAUSToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.WAIDHAUSToolStripMenuItem.Text = "WAIDHAUS" ' 'ToolStripMenuItem8 @@ -1480,36 +1489,36 @@ Partial Class frmHauptfenster 'ToolStripSeparator13 ' Me.ToolStripSeparator13.Name = "ToolStripSeparator13" - Me.ToolStripSeparator13.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator13.Size = New System.Drawing.Size(282, 6) ' 'EinheitspapierToolStripMenuItem ' Me.EinheitspapierToolStripMenuItem.Name = "EinheitspapierToolStripMenuItem" - Me.EinheitspapierToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.EinheitspapierToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.EinheitspapierToolStripMenuItem.Text = "Einheitspapier 0777 (Vereinfachte ZA)" ' 'CMRToolStripMenuItem ' Me.CMRToolStripMenuItem.Name = "CMRToolStripMenuItem" - Me.CMRToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CMRToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CMRToolStripMenuItem.Text = "CMR" ' 'Einheitspapier0735VersandverfahrenToolStripMenuItem ' Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Name = "Einheitspapier0735VersandverfahrenToolStripMenuItem" - Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Text = "Einheitspapier 0735 (Versandverfahren)" ' 'CarnetTIRToolStripMenuItem ' Me.CarnetTIRToolStripMenuItem.Name = "CarnetTIRToolStripMenuItem" - Me.CarnetTIRToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CarnetTIRToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CarnetTIRToolStripMenuItem.Text = "Carnet TIR" ' 'CarnetTIRALTToolStripMenuItem ' Me.CarnetTIRALTToolStripMenuItem.Name = "CarnetTIRALTToolStripMenuItem" - Me.CarnetTIRALTToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CarnetTIRALTToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CarnetTIRALTToolStripMenuItem.Text = "Carnet TIR (ALT)" ' 'mnuFragezeichen @@ -2714,38 +2723,38 @@ Partial Class frmHauptfenster Me.gridMyAviso.AllowUserToDeleteRows = False Me.gridMyAviso.AllowUserToOrderColumns = True Me.gridMyAviso.AllowUserToResizeRows = False - DataGridViewCellStyle10.BackColor = System.Drawing.Color.Azure - Me.gridMyAviso.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle10 + DataGridViewCellStyle28.BackColor = System.Drawing.Color.Azure + Me.gridMyAviso.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle28 Me.gridMyAviso.BackgroundColor = System.Drawing.Color.White - DataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle11.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - DataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.gridMyAviso.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle11 + DataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle29.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle29.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + DataGridViewCellStyle29.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle29.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle29.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.gridMyAviso.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle29 Me.gridMyAviso.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - DataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window - DataGridViewCellStyle12.Font = New System.Drawing.Font("Microsoft Sans Serif", 5.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText - DataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.gridMyAviso.DefaultCellStyle = DataGridViewCellStyle12 + DataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle30.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle30.Font = New System.Drawing.Font("Microsoft Sans Serif", 5.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle30.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle30.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle30.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.gridMyAviso.DefaultCellStyle = DataGridViewCellStyle30 Me.gridMyAviso.Dock = System.Windows.Forms.DockStyle.Fill Me.gridMyAviso.Location = New System.Drawing.Point(0, 21) Me.gridMyAviso.Name = "gridMyAviso" Me.gridMyAviso.ReadOnly = True - DataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle13.Font = New System.Drawing.Font("Microsoft Sans Serif", 5.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.gridMyAviso.RowHeadersDefaultCellStyle = DataGridViewCellStyle13 + DataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle31.Font = New System.Drawing.Font("Microsoft Sans Serif", 5.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.gridMyAviso.RowHeadersDefaultCellStyle = DataGridViewCellStyle31 Me.gridMyAviso.RowHeadersVisible = False Me.gridMyAviso.RowHeadersWidth = 62 Me.gridMyAviso.Size = New System.Drawing.Size(328, 279) @@ -3172,47 +3181,47 @@ Partial Class frmHauptfenster Me.gridAviso.AllowUserToAddRows = False Me.gridAviso.AllowUserToDeleteRows = False Me.gridAviso.AllowUserToResizeRows = False - DataGridViewCellStyle14.BackColor = System.Drawing.Color.Azure - DataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.gridAviso.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle14 + DataGridViewCellStyle32.BackColor = System.Drawing.Color.Azure + DataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.gridAviso.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle32 Me.gridAviso.BackgroundColor = System.Drawing.Color.DarkGray Me.gridAviso.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable - DataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle15.BackColor = System.Drawing.Color.LightBlue - DataGridViewCellStyle15.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.gridAviso.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle15 + DataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle33.BackColor = System.Drawing.Color.LightBlue + DataGridViewCellStyle33.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle33.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle33.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle33.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.gridAviso.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle33 Me.gridAviso.ColumnHeadersHeight = 25 Me.gridAviso.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing - DataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window - DataGridViewCellStyle16.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText - DataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.gridAviso.DefaultCellStyle = DataGridViewCellStyle16 + DataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle34.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle34.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle34.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle34.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle34.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.gridAviso.DefaultCellStyle = DataGridViewCellStyle34 Me.gridAviso.Dock = System.Windows.Forms.DockStyle.Fill Me.gridAviso.Location = New System.Drawing.Point(0, 248) Me.gridAviso.MultiSelect = False Me.gridAviso.Name = "gridAviso" Me.gridAviso.ReadOnly = True - DataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle17.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.gridAviso.RowHeadersDefaultCellStyle = DataGridViewCellStyle17 + DataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle35.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle35.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle35.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle35.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle35.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.gridAviso.RowHeadersDefaultCellStyle = DataGridViewCellStyle35 Me.gridAviso.RowHeadersVisible = False Me.gridAviso.RowHeadersWidth = 62 Me.gridAviso.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing - DataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.gridAviso.RowsDefaultCellStyle = DataGridViewCellStyle18 + DataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.gridAviso.RowsDefaultCellStyle = DataGridViewCellStyle36 Me.gridAviso.RowTemplate.ReadOnly = True Me.gridAviso.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.[False] Me.gridAviso.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect @@ -4063,11 +4072,24 @@ Partial Class frmHauptfenster Me.Panel7.Size = New System.Drawing.Size(252, 51) Me.Panel7.TabIndex = 4 ' - 'KLIPPHAUSENToolStripMenuItem + 'ToolStripMenuItem3 ' - Me.KLIPPHAUSENToolStripMenuItem.Name = "KLIPPHAUSENToolStripMenuItem" - Me.KLIPPHAUSENToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.KLIPPHAUSENToolStripMenuItem.Text = "KLIPPHAUSEN" + Me.ToolStripMenuItem3.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem23, Me.ToolStripMenuItem25}) + Me.ToolStripMenuItem3.Name = "ToolStripMenuItem3" + Me.ToolStripMenuItem3.Size = New System.Drawing.Size(285, 30) + Me.ToolStripMenuItem3.Text = "KLIPPHAUSEN" + ' + 'ToolStripMenuItem23 + ' + Me.ToolStripMenuItem23.Name = "ToolStripMenuItem23" + Me.ToolStripMenuItem23.Size = New System.Drawing.Size(243, 22) + Me.ToolStripMenuItem23.Text = "Annahmeblatt EXPORT DE / TR" + ' + 'ToolStripMenuItem25 + ' + Me.ToolStripMenuItem25.Name = "ToolStripMenuItem25" + Me.ToolStripMenuItem25.Size = New System.Drawing.Size(243, 22) + Me.ToolStripMenuItem25.Text = "Annahmeblatt EXPORT DE / SRB" ' 'frmHauptfenster ' @@ -4534,4 +4556,7 @@ Partial Class frmHauptfenster Friend WithEvents PrüfeBilderAufBase64ToolStripMenuItem As ToolStripMenuItem Friend WithEvents ReferenzwerteToolStripMenuItem As ToolStripMenuItem Friend WithEvents KLIPPHAUSENToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ToolStripMenuItem3 As ToolStripMenuItem + Friend WithEvents ToolStripMenuItem23 As ToolStripMenuItem + Friend WithEvents ToolStripMenuItem25 As ToolStripMenuItem End Class diff --git a/Aviso/frmHauptfenster.vb b/Aviso/frmHauptfenster.vb index bf657c8..062d54e 100644 --- a/Aviso/frmHauptfenster.vb +++ b/Aviso/frmHauptfenster.vb @@ -5457,4 +5457,14 @@ ELSE_ATILLA: MsgBox("Keine Berechtigung!") End If End Sub + + Private Sub ToolStripMenuItem23_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem23.Click + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VORLAGEN", "SONSTIGE", "", "", "Annahmeblatt_KLIPP_EXPORT_TR") + DS.OPEN_SINGLE_ORIG() + End Sub + + Private Sub ToolStripMenuItem25_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem25.Click + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VORLAGEN", "SONSTIGE", "", "", "Annahmeblatt_KLIPP_EXPORT_YU") + DS.OPEN_SINGLE_ORIG() + End Sub End Class diff --git a/Aviso/frmHauptfensterNew.Designer.vb b/Aviso/frmHauptfensterNew.Designer.vb index 682ef15..9000a7d 100644 --- a/Aviso/frmHauptfensterNew.Designer.vb +++ b/Aviso/frmHauptfensterNew.Designer.vb @@ -288,6 +288,7 @@ Partial Class frmHauptfensterNew Me.btnKasse_LG = New System.Windows.Forms.Button() Me.btnTV = New System.Windows.Forms.Button() Me.Panel9 = New System.Windows.Forms.Panel() + Me.Button4 = New System.Windows.Forms.Button() Me.btnSmall = New System.Windows.Forms.Button() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() @@ -323,7 +324,9 @@ Partial Class frmHauptfensterNew Me.Panel7 = New System.Windows.Forms.Panel() Me.UsrCntlTestsystem1 = New VERAG_PROG_ALLGEMEIN.usrCntlTestsystem() Me.UidAbfrageService1 = New VERAG_PROG_ALLGEMEIN.at.gv.bmf.finanzonline.uidAbfrageService() - Me.Button4 = New System.Windows.Forms.Button() + Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem23 = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripMenuItem25 = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.pnlDetailsRechts.SuspendLayout() @@ -1143,7 +1146,7 @@ Partial Class frmHauptfensterNew 'ToolStripFormulare ' Me.ToolStripFormulare.BackColor = System.Drawing.Color.White - Me.ToolStripFormulare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MANAGERToolStripMenuItem, Me.ToolStripSeparator3, Me.MailvorlagenToolStripMenuItem, Me.ToolStripMenuItem2, Me.ToolStripMenuItem7, Me.ToolStripMenuItem12, Me.ToolStripMenuItem15, Me.ToolStripMenuItem18, Me.AuftragÜberwachungsdokumentToolStripMenuItem, Me.toolVUB, Me.toolVPCreditreform, Me.ToolStripSeparator9, Me.VerzollungsunterlagenToolStripMenuItem, Me.ToolStripMenuItem11, Me.ToolStripSeparator6, Me.WAIDHAUSToolStripMenuItem, Me.ToolStripSeparator13, Me.EinheitspapierToolStripMenuItem, Me.CMRToolStripMenuItem, Me.Einheitspapier0735VersandverfahrenToolStripMenuItem, Me.CarnetTIRToolStripMenuItem, Me.CarnetTIRALTToolStripMenuItem}) + Me.ToolStripFormulare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MANAGERToolStripMenuItem, Me.ToolStripSeparator3, Me.MailvorlagenToolStripMenuItem, Me.ToolStripMenuItem2, Me.ToolStripMenuItem7, Me.ToolStripMenuItem12, Me.ToolStripMenuItem15, Me.ToolStripMenuItem18, Me.AuftragÜberwachungsdokumentToolStripMenuItem, Me.toolVUB, Me.toolVPCreditreform, Me.ToolStripSeparator9, Me.VerzollungsunterlagenToolStripMenuItem, Me.ToolStripMenuItem11, Me.ToolStripSeparator6, Me.WAIDHAUSToolStripMenuItem, Me.ToolStripMenuItem3, Me.ToolStripSeparator13, Me.EinheitspapierToolStripMenuItem, Me.CMRToolStripMenuItem, Me.Einheitspapier0735VersandverfahrenToolStripMenuItem, Me.CarnetTIRToolStripMenuItem, Me.CarnetTIRALTToolStripMenuItem}) Me.ToolStripFormulare.Font = New System.Drawing.Font("Segoe UI", 9.0!) Me.ToolStripFormulare.ForeColor = System.Drawing.Color.Black Me.ToolStripFormulare.ImageAlign = System.Drawing.ContentAlignment.BottomRight @@ -1157,20 +1160,20 @@ Partial Class frmHauptfensterNew Me.MANAGERToolStripMenuItem.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Bold) Me.MANAGERToolStripMenuItem.Image = Global.AVISO.My.Resources.Resources.android_note Me.MANAGERToolStripMenuItem.Name = "MANAGERToolStripMenuItem" - Me.MANAGERToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.MANAGERToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.MANAGERToolStripMenuItem.Text = "Formular - Manager" ' 'ToolStripSeparator3 ' Me.ToolStripSeparator3.Name = "ToolStripSeparator3" - Me.ToolStripSeparator3.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator3.Size = New System.Drawing.Size(282, 6) ' 'MailvorlagenToolStripMenuItem ' Me.MailvorlagenToolStripMenuItem.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Bold) Me.MailvorlagenToolStripMenuItem.Image = Global.AVISO.My.Resources.Resources.stift Me.MailvorlagenToolStripMenuItem.Name = "MailvorlagenToolStripMenuItem" - Me.MailvorlagenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.MailvorlagenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.MailvorlagenToolStripMenuItem.Text = "Mailvorlagen" Me.MailvorlagenToolStripMenuItem.Visible = False ' @@ -1178,7 +1181,7 @@ Partial Class frmHauptfensterNew ' Me.ToolStripMenuItem2.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStrVM_de, Me.ZollvollmachtDEFiskalToolStripMenuItem, Me.toolStrVM_at, Me.toolStrVM_at4200, Me.ZollvollmachtATEVToolStripMenuItem}) Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2" - Me.ToolStripMenuItem2.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem2.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem2.Text = "Vollmachten" ' 'toolStrVM_de @@ -1214,38 +1217,38 @@ Partial Class frmHauptfensterNew 'ToolStripMenuItem7 ' Me.ToolStripMenuItem7.Name = "ToolStripMenuItem7" - Me.ToolStripMenuItem7.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem7.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem7.Text = "Gestellungsgarantien" ' 'ToolStripMenuItem12 ' Me.ToolStripMenuItem12.Name = "ToolStripMenuItem12" - Me.ToolStripMenuItem12.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem12.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem12.Text = "Importaviso" ' 'ToolStripMenuItem15 ' Me.ToolStripMenuItem15.Name = "ToolStripMenuItem15" - Me.ToolStripMenuItem15.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem15.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem15.Text = "Dispoliste" ' 'ToolStripMenuItem18 ' Me.ToolStripMenuItem18.Name = "ToolStripMenuItem18" - Me.ToolStripMenuItem18.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem18.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem18.Text = "Verzollungspreise" ' 'AuftragÜberwachungsdokumentToolStripMenuItem ' Me.AuftragÜberwachungsdokumentToolStripMenuItem.Name = "AuftragÜberwachungsdokumentToolStripMenuItem" - Me.AuftragÜberwachungsdokumentToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.AuftragÜberwachungsdokumentToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.AuftragÜberwachungsdokumentToolStripMenuItem.Text = "Auftrag Überwachungsdokument" ' 'toolVUB ' Me.toolVUB.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.VUBVERAGSpeditionAGToolStripMenuItem, Me.VeragCustomsServiceToolStripMenuItem}) Me.toolVUB.Name = "toolVUB" - Me.toolVUB.Size = New System.Drawing.Size(277, 22) + Me.toolVUB.Size = New System.Drawing.Size(285, 30) Me.toolVUB.Text = "VUB" ' 'VUBVERAGSpeditionAGToolStripMenuItem @@ -1263,37 +1266,37 @@ Partial Class frmHauptfensterNew 'toolVPCreditreform ' Me.toolVPCreditreform.Name = "toolVPCreditreform" - Me.toolVPCreditreform.Size = New System.Drawing.Size(277, 22) + Me.toolVPCreditreform.Size = New System.Drawing.Size(285, 30) Me.toolVPCreditreform.Text = "Bonitätsauskunft (Creditreform)" Me.toolVPCreditreform.Visible = False ' 'ToolStripSeparator9 ' Me.ToolStripSeparator9.Name = "ToolStripSeparator9" - Me.ToolStripSeparator9.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator9.Size = New System.Drawing.Size(282, 6) ' 'VerzollungsunterlagenToolStripMenuItem ' Me.VerzollungsunterlagenToolStripMenuItem.Name = "VerzollungsunterlagenToolStripMenuItem" - Me.VerzollungsunterlagenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.VerzollungsunterlagenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.VerzollungsunterlagenToolStripMenuItem.Text = "Verzollungsunterlagen" ' 'ToolStripMenuItem11 ' Me.ToolStripMenuItem11.Name = "ToolStripMenuItem11" - Me.ToolStripMenuItem11.Size = New System.Drawing.Size(277, 22) + Me.ToolStripMenuItem11.Size = New System.Drawing.Size(285, 30) Me.ToolStripMenuItem11.Text = "Verzollungsunterlagen BAR" ' 'ToolStripSeparator6 ' Me.ToolStripSeparator6.Name = "ToolStripSeparator6" - Me.ToolStripSeparator6.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator6.Size = New System.Drawing.Size(282, 6) ' 'WAIDHAUSToolStripMenuItem ' Me.WAIDHAUSToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem8, Me.ToolStripMenuItem9, Me.AnnahmeblattIMPORTToolStripMenuItem, Me.AnnahmeblattEXPORTToolStripMenuItem, Me.ChecklisteVerwahrlagerToolStripMenuItem}) Me.WAIDHAUSToolStripMenuItem.Name = "WAIDHAUSToolStripMenuItem" - Me.WAIDHAUSToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.WAIDHAUSToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.WAIDHAUSToolStripMenuItem.Text = "WAIDHAUS" ' 'ToolStripMenuItem8 @@ -1329,36 +1332,36 @@ Partial Class frmHauptfensterNew 'ToolStripSeparator13 ' Me.ToolStripSeparator13.Name = "ToolStripSeparator13" - Me.ToolStripSeparator13.Size = New System.Drawing.Size(274, 6) + Me.ToolStripSeparator13.Size = New System.Drawing.Size(282, 6) ' 'EinheitspapierToolStripMenuItem ' Me.EinheitspapierToolStripMenuItem.Name = "EinheitspapierToolStripMenuItem" - Me.EinheitspapierToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.EinheitspapierToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.EinheitspapierToolStripMenuItem.Text = "Einheitspapier 0777 (Vereinfachte ZA)" ' 'CMRToolStripMenuItem ' Me.CMRToolStripMenuItem.Name = "CMRToolStripMenuItem" - Me.CMRToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CMRToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CMRToolStripMenuItem.Text = "CMR" ' 'Einheitspapier0735VersandverfahrenToolStripMenuItem ' Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Name = "Einheitspapier0735VersandverfahrenToolStripMenuItem" - Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.Einheitspapier0735VersandverfahrenToolStripMenuItem.Text = "Einheitspapier 0735 (Versandverfahren)" ' 'CarnetTIRToolStripMenuItem ' Me.CarnetTIRToolStripMenuItem.Name = "CarnetTIRToolStripMenuItem" - Me.CarnetTIRToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CarnetTIRToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CarnetTIRToolStripMenuItem.Text = "Carnet TIR" ' 'CarnetTIRALTToolStripMenuItem ' Me.CarnetTIRALTToolStripMenuItem.Name = "CarnetTIRALTToolStripMenuItem" - Me.CarnetTIRALTToolStripMenuItem.Size = New System.Drawing.Size(277, 22) + Me.CarnetTIRALTToolStripMenuItem.Size = New System.Drawing.Size(285, 30) Me.CarnetTIRALTToolStripMenuItem.Text = "Carnet TIR (ALT)" ' 'mnuFragezeichen @@ -2558,6 +2561,25 @@ Partial Class frmHauptfensterNew Me.Panel9.Size = New System.Drawing.Size(156, 157) Me.Panel9.TabIndex = 88 ' + 'Button4 + ' + Me.Button4.BackColor = System.Drawing.Color.FromArgb(CType(CType(253, Byte), Integer), CType(CType(253, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.Button4.Cursor = System.Windows.Forms.Cursors.Default + Me.Button4.FlatAppearance.BorderSize = 3 + Me.Button4.Font = New System.Drawing.Font("Segoe UI", 10.0!) + Me.Button4.ForeColor = System.Drawing.Color.Black + Me.Button4.Image = Global.AVISO.My.Resources.Resources.ico_atez_tariffAI + Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleRight + Me.Button4.Location = New System.Drawing.Point(11, 84) + Me.Button4.Margin = New System.Windows.Forms.Padding(0) + Me.Button4.Name = "Button4" + Me.Button4.Padding = New System.Windows.Forms.Padding(10, 0, 10, 0) + Me.Button4.Size = New System.Drawing.Size(135, 52) + Me.Button4.TabIndex = 8 + Me.Button4.Text = "Tariff AI" + Me.Button4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.Button4.UseVisualStyleBackColor = False + ' 'btnSmall ' Me.btnSmall.BackColor = System.Drawing.Color.White @@ -2853,24 +2875,24 @@ Partial Class frmHauptfensterNew Me.UidAbfrageService1.Url = "https://finanzonline.bmf.gv.at/fon/ws/uidAbfrage/" Me.UidAbfrageService1.UseDefaultCredentials = False ' - 'Button4 + 'ToolStripMenuItem3 ' - Me.Button4.BackColor = System.Drawing.Color.FromArgb(CType(CType(253, Byte), Integer), CType(CType(253, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.Button4.Cursor = System.Windows.Forms.Cursors.Default - Me.Button4.FlatAppearance.BorderSize = 3 - Me.Button4.Font = New System.Drawing.Font("Segoe UI", 10.0!) - Me.Button4.ForeColor = System.Drawing.Color.Black - Me.Button4.Image = Global.AVISO.My.Resources.Resources.ico_atez_tariffAI - Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleRight - Me.Button4.Location = New System.Drawing.Point(11, 84) - Me.Button4.Margin = New System.Windows.Forms.Padding(0) - Me.Button4.Name = "Button4" - Me.Button4.Padding = New System.Windows.Forms.Padding(10, 0, 10, 0) - Me.Button4.Size = New System.Drawing.Size(135, 52) - Me.Button4.TabIndex = 8 - Me.Button4.Text = "Tariff AI" - Me.Button4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button4.UseVisualStyleBackColor = False + Me.ToolStripMenuItem3.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem23, Me.ToolStripMenuItem25}) + Me.ToolStripMenuItem3.Name = "ToolStripMenuItem3" + Me.ToolStripMenuItem3.Size = New System.Drawing.Size(285, 30) + Me.ToolStripMenuItem3.Text = "KLIPPHAUSEN" + ' + 'ToolStripMenuItem23 + ' + Me.ToolStripMenuItem23.Name = "ToolStripMenuItem23" + Me.ToolStripMenuItem23.Size = New System.Drawing.Size(243, 22) + Me.ToolStripMenuItem23.Text = "Annahmeblatt EXPORT DE / TR" + ' + 'ToolStripMenuItem25 + ' + Me.ToolStripMenuItem25.Name = "ToolStripMenuItem25" + Me.ToolStripMenuItem25.Size = New System.Drawing.Size(243, 22) + Me.ToolStripMenuItem25.Text = "Annahmeblatt EXPORT DE / SRB" ' 'frmHauptfensterNew ' @@ -3236,4 +3258,7 @@ Partial Class frmHauptfensterNew Friend WithEvents btnDEFAULT_UnSelected As Button Friend WithEvents UsrCntlMessenger_ListNewChats1 As VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ListNewChats Friend WithEvents Button4 As Button + Friend WithEvents ToolStripMenuItem3 As ToolStripMenuItem + Friend WithEvents ToolStripMenuItem23 As ToolStripMenuItem + Friend WithEvents ToolStripMenuItem25 As ToolStripMenuItem End Class diff --git a/Aviso/frmHauptfensterNew.vb b/Aviso/frmHauptfensterNew.vb index 582e80b..847f890 100644 --- a/Aviso/frmHauptfensterNew.vb +++ b/Aviso/frmHauptfensterNew.vb @@ -3959,4 +3959,15 @@ ELSE_ATILLA: Private Sub Button4_Click_2(sender As Object, e As EventArgs) Handles Button4.Click End Sub + + Private Sub ToolStripMenuItem23_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem23.Click + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VORLAGEN", "SONSTIGE", "", "", "Annahmeblatt_KLIPP_EXPORT_TR") + DS.OPEN_SINGLE_ORIG() + End Sub + + + Private Sub ToolStripMenuItem25_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem25.Click + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VORLAGEN", "SONSTIGE", "", "", "Annahmeblatt_KLIPP_EXPORT_YU") + DS.OPEN_SINGLE_ORIG() + End Sub End Class From e118d47b5e1463e62a587d97829227638fa994c5 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Mon, 27 Apr 2026 17:09:00 +0200 Subject: [PATCH 02/15] Update, etc. --- Aviso/App.config | 6 ++- Aviso/Aviso.vbproj | 92 ++++++++++++++++++++++---------- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/packages.config | 20 +++++-- 4 files changed, 88 insertions(+), 34 deletions(-) diff --git a/Aviso/App.config b/Aviso/App.config index cf5284a..46899ba 100644 --- a/Aviso/App.config +++ b/Aviso/App.config @@ -90,12 +90,16 @@ - + + + + + diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 9a86296..cff782d 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -148,8 +148,8 @@ False C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\BouncyCastle.Crypto.dll - - F:\PROGRAMMIERUNG\dll\ActiveReports18\allDll\BouncyCastle.Cryptography.dll + + ..\packages\BouncyCastle.Cryptography.2.6.2\lib\net461\BouncyCastle.Cryptography.dll False @@ -201,32 +201,44 @@ ..\Gemeinsames\bin\Debug\Gemeinsames.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.barcodes.dll + + ..\packages\itext.9.6.0\lib\net461\itext.barcodes.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.forms.dll + + ..\packages\itext.bouncy-castle-adapter.9.6.0\lib\net461\itext.bouncy-castle-adapter.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.io.dll + + ..\packages\itext.9.6.0\lib\net461\itext.bouncy-castle-connector.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.kernel.dll + + ..\packages\itext.commons.9.6.0\lib\net461\itext.commons.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.layout.dll + + ..\packages\itext.9.6.0\lib\net461\itext.forms.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.pdfa.dll + + ..\packages\itext.9.6.0\lib\net461\itext.io.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.sign.dll + + ..\packages\itext.9.6.0\lib\net461\itext.kernel.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.styledxmlparser.dll + + ..\packages\itext.9.6.0\lib\net461\itext.layout.dll - - ..\packages\itext7.7.1.11\lib\net40\itext.svg.dll + + ..\packages\itext.9.6.0\lib\net461\itext.pdfa.dll + + + ..\packages\itext.9.6.0\lib\net461\itext.pdfua.dll + + + ..\packages\itext.9.6.0\lib\net461\itext.sign.dll + + + ..\packages\itext.9.6.0\lib\net461\itext.styledxmlparser.dll + + + ..\packages\itext.9.6.0\lib\net461\itext.svg.dll False @@ -397,8 +409,8 @@ ..\..\..\dll\ASP.NET\Microsoft.AspNetCore.Http.Abstractions.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll @@ -407,15 +419,27 @@ ..\..\..\dll\ASP.NET\Microsoft.Extensions.Configuration.Abstractions.dll - - ..\..\..\dll\ASP.NET\Microsoft.Extensions.DependencyInjection.dll + + ..\packages\Microsoft.Extensions.DependencyInjection.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - ..\..\..\dll\ASP.NET\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\..\..\dll\ASP.NET\Microsoft.Extensions.Hosting.dll + + ..\packages\Microsoft.Extensions.Logging.5.0.0\lib\net461\Microsoft.Extensions.Logging.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Options.5.0.0\lib\net461\Microsoft.Extensions.Options.dll + + + ..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll + True @@ -455,6 +479,9 @@ + + ..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + @@ -501,6 +528,9 @@ + + ..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll True @@ -524,13 +554,19 @@ True True + + ..\packages\System.Security.Cryptography.Xml.6.0.2\lib\net461\System.Security.Cryptography.Xml.dll + + + ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + ..\packages\System.Text.Encoding.CodePages.8.0.0\lib\net462\System.Text.Encoding.CodePages.dll - - ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index d834ce7..6a0dc2d 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/packages.config b/Aviso/packages.config index 5b035fc..2477d1b 100644 --- a/Aviso/packages.config +++ b/Aviso/packages.config @@ -1,5 +1,6 @@  + @@ -15,14 +16,24 @@ - + + + + - + + + + + + + + @@ -33,12 +44,15 @@ + + + - + \ No newline at end of file From 448d72ed2366fe89f7eb8596aa3fa62701219759 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Tue, 28 Apr 2026 08:17:00 +0200 Subject: [PATCH 03/15] Version --- Aviso/My Project/AssemblyInfo.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 6a0dc2d..2b6c3da 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: ' - - + + From dd8e11fe749864b8a7712f652301029c20ab1b8d Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Wed, 29 Apr 2026 15:41:39 +0200 Subject: [PATCH 04/15] aa --- Aviso/My Project/AssemblyInfo.vb | 4 ++-- Aviso/frmLaufzettel.vb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 2b6c3da..b9da5b3 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/frmLaufzettel.vb b/Aviso/frmLaufzettel.vb index 0bdd3ae..e9fc87d 100644 --- a/Aviso/frmLaufzettel.vb +++ b/Aviso/frmLaufzettel.vb @@ -425,7 +425,7 @@ Public Class frmLaufzettel Mail.To = "poststelle.za-dettelbach@zoll.bund.de" tX = New VERAG_PROG_ALLGEMEIN.cTextkonserve("LAUFZETTEL_DIGITAL", "LAUFZETTEL_DE_DIGITAL_DTB", "DE", VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA) Case "WAI" - Mail.To = "" + Mail.To = "zE-zV-VERAG.hza-regensburg@zoll.bund.de" tX = New VERAG_PROG_ALLGEMEIN.cTextkonserve("LAUFZETTEL_DIGITAL", "LAUFZETTEL_DE_DIGITAL_WAI", "DE", VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA) Case "SBG" Mail.To = "" From 352bafc61810fc202827cdc8dec3048f6dc717ae Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Wed, 29 Apr 2026 15:48:48 +0200 Subject: [PATCH 05/15] version --- Aviso/My Project/AssemblyInfo.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 2b6c3da..0b15f2d 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: ' - - + + From 9460d070d1c3b15bdb4e19a055eea3b17c949417 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Mon, 27 Apr 2026 15:24:29 +0200 Subject: [PATCH 06/15] update --- Aviso/Aviso.vbproj | 12 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 443 +----- Aviso/frmAddSendungsvermerkShort.vb | 223 ++- ...frmSendungsDokumentanforderung.Designer.vb | 440 ++++++ Aviso/frmSendungsDokumentanforderung.resx | 61 + Aviso/frmSendungsDokumentanforderung.vb | 1281 +++++++++++++++++ 7 files changed, 2031 insertions(+), 433 deletions(-) create mode 100644 Aviso/frmSendungsDokumentanforderung.Designer.vb create mode 100644 Aviso/frmSendungsDokumentanforderung.resx create mode 100644 Aviso/frmSendungsDokumentanforderung.vb diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index cff782d..6491167 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -1,4 +1,4 @@ - + @@ -803,6 +803,12 @@ Form + + frmSendungsDokumentanforderung.vb + + + Form + frmAnkunftAendern.vb @@ -1473,6 +1479,9 @@ frmAddSendungsvermerkShort.vb + + frmSendungsDokumentanforderung.vb + frmAnkunftAendern.vb @@ -1581,6 +1590,7 @@ frmLogin.vb + Designer frmAuswahl_Aviso.vb diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 0b15f2d..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 c19bbbb..9e37c70 100644 --- a/Aviso/frmAddSendungsvermerkShort.Designer.vb +++ b/Aviso/frmAddSendungsvermerkShort.Designer.vb @@ -27,59 +27,36 @@ 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.optDraft = New System.Windows.Forms.CheckBox() - Me.optGewPackAngefordert = New System.Windows.Forms.CheckBox() - Me.optKostenbestaetigungAngefordert = New System.Windows.Forms.CheckBox() - Me.optZolltarifnummerAngefordert = New System.Windows.Forms.CheckBox() - Me.txtSonstigesDokumentFehlt = New System.Windows.Forms.TextBox() - Me.cbxPackliste = New System.Windows.Forms.CheckBox() + Me.flpAngefordert = New System.Windows.Forms.FlowLayoutPanel() Me.Label4 = New System.Windows.Forms.Label() Me.optFremd_ATB = New System.Windows.Forms.CheckBox() Me.optFremd_SendungAvisiert = New System.Windows.Forms.CheckBox() - Me.optFahrerKeinATR = New System.Windows.Forms.CheckBox() - Me.optFrachtkostenAngefordert = New System.Windows.Forms.CheckBox() - Me.optKundeNichtErreichbar = New System.Windows.Forms.CheckBox() - Me.optAbsenderbestätigung = New System.Windows.Forms.CheckBox() - Me.cbxRgBest = New System.Windows.Forms.CheckBox() - Me.optUeberwachungsdok = New System.Windows.Forms.CheckBox() Me.lblErrSpedition = New System.Windows.Forms.Label() + Me.lblDragIndicator = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.lblErrGrund = New System.Windows.Forms.Label() Me.btnCLose = New System.Windows.Forms.Button() - Me.lblErrDokument = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.txtSpedition = New System.Windows.Forms.TextBox() Me.optSendungInVorbereitung = New System.Windows.Forms.CheckBox() Me.optSpeditionWeitergeleitet = New System.Windows.Forms.CheckBox() Me.optFreierText = New System.Windows.Forms.CheckBox() Me.optATAangefordert = New System.Windows.Forms.CheckBox() - Me.optVorkasseAngefordert = New System.Windows.Forms.CheckBox() - Me.optKontaktdatenAngefordert = New System.Windows.Forms.CheckBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblErr240Zeichen = New System.Windows.Forms.Label() Me.txtDetail = New System.Windows.Forms.TextBox() 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.cbxSonstDok = New System.Windows.Forms.CheckBox() + Me.btnDokumtanforderung = New System.Windows.Forms.Button() Me.Label9 = New System.Windows.Forms.Label() - Me.cbxVollmacht = New System.Windows.Forms.CheckBox() - Me.cbxCMR = New System.Windows.Forms.CheckBox() Me.Label17 = New System.Windows.Forms.Label() Me.Label13 = New System.Windows.Forms.Label() - Me.cbxATR = New System.Windows.Forms.CheckBox() - Me.cbxLS = New System.Windows.Forms.CheckBox() Me.txtFreierText = New System.Windows.Forms.TextBox() - Me.cbxRechnung = New System.Windows.Forms.CheckBox() - Me.Label20 = New System.Windows.Forms.Label() - Me.cbxAuftrag = New System.Windows.Forms.CheckBox() - Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.PictureBox4 = New System.Windows.Forms.PictureBox() Me.Panel4 = New System.Windows.Forms.Panel() Me.pnlMain.SuspendLayout() Me.pnlSendungsVermker.SuspendLayout() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' @@ -95,135 +72,62 @@ 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(454, 605) + 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.optDraft) - Me.pnlSendungsVermker.Controls.Add(Me.optGewPackAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.optKostenbestaetigungAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.optZolltarifnummerAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.txtSonstigesDokumentFehlt) - Me.pnlSendungsVermker.Controls.Add(Me.cbxPackliste) + Me.pnlSendungsVermker.Controls.Add(Me.flpAngefordert) Me.pnlSendungsVermker.Controls.Add(Me.Label4) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_ATB) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_SendungAvisiert) - Me.pnlSendungsVermker.Controls.Add(Me.optFahrerKeinATR) - Me.pnlSendungsVermker.Controls.Add(Me.optFrachtkostenAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.optKundeNichtErreichbar) - Me.pnlSendungsVermker.Controls.Add(Me.optAbsenderbestätigung) - Me.pnlSendungsVermker.Controls.Add(Me.cbxRgBest) - Me.pnlSendungsVermker.Controls.Add(Me.optUeberwachungsdok) Me.pnlSendungsVermker.Controls.Add(Me.lblErrSpedition) + Me.pnlSendungsVermker.Controls.Add(Me.lblDragIndicator) Me.pnlSendungsVermker.Controls.Add(Me.Label2) Me.pnlSendungsVermker.Controls.Add(Me.lblErrGrund) Me.pnlSendungsVermker.Controls.Add(Me.btnCLose) - Me.pnlSendungsVermker.Controls.Add(Me.lblErrDokument) Me.pnlSendungsVermker.Controls.Add(Me.Label1) Me.pnlSendungsVermker.Controls.Add(Me.txtSpedition) Me.pnlSendungsVermker.Controls.Add(Me.optSendungInVorbereitung) Me.pnlSendungsVermker.Controls.Add(Me.optSpeditionWeitergeleitet) Me.pnlSendungsVermker.Controls.Add(Me.optFreierText) Me.pnlSendungsVermker.Controls.Add(Me.optATAangefordert) - Me.pnlSendungsVermker.Controls.Add(Me.optVorkasseAngefordert) - Me.pnlSendungsVermker.Controls.Add(Me.optKontaktdatenAngefordert) Me.pnlSendungsVermker.Controls.Add(Me.Label3) Me.pnlSendungsVermker.Controls.Add(Me.lblErr240Zeichen) Me.pnlSendungsVermker.Controls.Add(Me.txtDetail) 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.cbxSonstDok) + Me.pnlSendungsVermker.Controls.Add(Me.btnDokumtanforderung) Me.pnlSendungsVermker.Controls.Add(Me.Label9) - Me.pnlSendungsVermker.Controls.Add(Me.cbxVollmacht) - Me.pnlSendungsVermker.Controls.Add(Me.cbxCMR) Me.pnlSendungsVermker.Controls.Add(Me.Label17) Me.pnlSendungsVermker.Controls.Add(Me.Label13) - Me.pnlSendungsVermker.Controls.Add(Me.cbxATR) - Me.pnlSendungsVermker.Controls.Add(Me.cbxLS) Me.pnlSendungsVermker.Controls.Add(Me.txtFreierText) - Me.pnlSendungsVermker.Controls.Add(Me.cbxRechnung) - Me.pnlSendungsVermker.Controls.Add(Me.Label20) - Me.pnlSendungsVermker.Controls.Add(Me.cbxAuftrag) - Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) Me.pnlSendungsVermker.Controls.Add(Me.PictureBox4) 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(454, 605) + Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 400) Me.pnlSendungsVermker.TabIndex = 0 ' - 'optDraft + 'flpAngefordert ' - Me.optDraft.AutoSize = True - Me.optDraft.Location = New System.Drawing.Point(12, 262) - Me.optDraft.Name = "optDraft" - Me.optDraft.Size = New System.Drawing.Size(174, 17) - Me.optDraft.TabIndex = 102 - Me.optDraft.Text = "T1/T2 ""Draft"" OK - angefordert" - Me.optDraft.UseVisualStyleBackColor = True - ' - 'optGewPackAngefordert - ' - Me.optGewPackAngefordert.AutoSize = True - Me.optGewPackAngefordert.Location = New System.Drawing.Point(12, 236) - Me.optGewPackAngefordert.Name = "optGewPackAngefordert" - Me.optGewPackAngefordert.Size = New System.Drawing.Size(245, 17) - Me.optGewPackAngefordert.TabIndex = 101 - Me.optGewPackAngefordert.Text = "Gewicht/Packstücke mangelhaft - angefordert" - Me.optGewPackAngefordert.UseVisualStyleBackColor = True - ' - 'optKostenbestaetigungAngefordert - ' - Me.optKostenbestaetigungAngefordert.AutoSize = True - Me.optKostenbestaetigungAngefordert.Location = New System.Drawing.Point(270, 214) - Me.optKostenbestaetigungAngefordert.Name = "optKostenbestaetigungAngefordert" - Me.optKostenbestaetigungAngefordert.Size = New System.Drawing.Size(177, 17) - Me.optKostenbestaetigungAngefordert.TabIndex = 99 - Me.optKostenbestaetigungAngefordert.Text = "Kostenbestätigung - angefordert" - Me.optKostenbestaetigungAngefordert.UseVisualStyleBackColor = True - ' - 'optZolltarifnummerAngefordert - ' - Me.optZolltarifnummerAngefordert.AutoSize = True - Me.optZolltarifnummerAngefordert.Location = New System.Drawing.Point(12, 214) - Me.optZolltarifnummerAngefordert.Name = "optZolltarifnummerAngefordert" - Me.optZolltarifnummerAngefordert.Size = New System.Drawing.Size(154, 17) - Me.optZolltarifnummerAngefordert.TabIndex = 98 - Me.optZolltarifnummerAngefordert.Text = "Zolltarifnummer angefordert" - Me.optZolltarifnummerAngefordert.UseVisualStyleBackColor = True - ' - '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, 96) - Me.txtSonstigesDokumentFehlt.MaxLength = 80 - Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) - Me.txtSonstigesDokumentFehlt.TabIndex = 10 - ' - 'cbxPackliste - ' - Me.cbxPackliste.AutoSize = True - Me.cbxPackliste.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxPackliste.Location = New System.Drawing.Point(308, 75) - Me.cbxPackliste.Name = "cbxPackliste" - Me.cbxPackliste.Size = New System.Drawing.Size(69, 17) - Me.cbxPackliste.TabIndex = 97 - Me.cbxPackliste.Text = "Packliste" - Me.cbxPackliste.UseVisualStyleBackColor = False + Me.flpAngefordert.BackColor = System.Drawing.Color.White + Me.flpAngefordert.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + 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 ' '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(11, 411) + 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 @@ -233,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(12, 458) + 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 @@ -244,93 +148,44 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_SendungAvisiert.AutoSize = True Me.optFremd_SendungAvisiert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(12, 435) + 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 Me.optFremd_SendungAvisiert.Text = "Sendung an Fremdeinsteller avisiert" Me.optFremd_SendungAvisiert.UseVisualStyleBackColor = False ' - 'optFahrerKeinATR - ' - Me.optFahrerKeinATR.AutoSize = True - Me.optFahrerKeinATR.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFahrerKeinATR.Location = New System.Drawing.Point(308, 52) - Me.optFahrerKeinATR.Name = "optFahrerKeinATR" - Me.optFahrerKeinATR.Size = New System.Drawing.Size(125, 17) - Me.optFahrerKeinATR.TabIndex = 92 - Me.optFahrerKeinATR.Text = "Fahrer hat kein A.TR" - Me.optFahrerKeinATR.UseVisualStyleBackColor = False - ' - 'optFrachtkostenAngefordert - ' - Me.optFrachtkostenAngefordert.AutoSize = True - Me.optFrachtkostenAngefordert.Location = New System.Drawing.Point(12, 162) - Me.optFrachtkostenAngefordert.Name = "optFrachtkostenAngefordert" - Me.optFrachtkostenAngefordert.Size = New System.Drawing.Size(145, 17) - Me.optFrachtkostenAngefordert.TabIndex = 91 - Me.optFrachtkostenAngefordert.Text = "Frachtkosten angefordert" - Me.optFrachtkostenAngefordert.UseVisualStyleBackColor = True - ' - 'optKundeNichtErreichbar - ' - Me.optKundeNichtErreichbar.AutoSize = True - Me.optKundeNichtErreichbar.Location = New System.Drawing.Point(270, 141) - Me.optKundeNichtErreichbar.Name = "optKundeNichtErreichbar" - Me.optKundeNichtErreichbar.Size = New System.Drawing.Size(133, 17) - Me.optKundeNichtErreichbar.TabIndex = 90 - Me.optKundeNichtErreichbar.Text = "Kunde nicht erreichbar" - Me.optKundeNichtErreichbar.UseVisualStyleBackColor = True - ' - 'optAbsenderbestätigung - ' - Me.optAbsenderbestätigung.AutoSize = True - Me.optAbsenderbestätigung.BackColor = System.Drawing.Color.WhiteSmoke - Me.optAbsenderbestätigung.Location = New System.Drawing.Point(308, 32) - Me.optAbsenderbestätigung.Name = "optAbsenderbestätigung" - Me.optAbsenderbestätigung.Size = New System.Drawing.Size(136, 17) - Me.optAbsenderbestätigung.TabIndex = 89 - Me.optAbsenderbestätigung.Text = "Absenderbestät. angef." - Me.optAbsenderbestätigung.UseVisualStyleBackColor = False - ' - 'cbxRgBest - ' - Me.cbxRgBest.AutoSize = True - Me.cbxRgBest.Location = New System.Drawing.Point(270, 185) - Me.cbxRgBest.Name = "cbxRgBest" - Me.cbxRgBest.Size = New System.Drawing.Size(146, 17) - Me.cbxRgBest.TabIndex = 86 - Me.cbxRgBest.Text = "Rechnungsbestät. angef." - Me.cbxRgBest.UseVisualStyleBackColor = True - ' - 'optUeberwachungsdok - ' - Me.optUeberwachungsdok.AutoSize = True - Me.optUeberwachungsdok.Location = New System.Drawing.Point(270, 163) - Me.optUeberwachungsdok.Name = "optUeberwachungsdok" - Me.optUeberwachungsdok.Size = New System.Drawing.Size(114, 17) - Me.optUeberwachungsdok.TabIndex = 85 - Me.optUeberwachungsdok.Text = "Ü-Dok. angefodert" - Me.optUeberwachungsdok.UseVisualStyleBackColor = True - ' 'lblErrSpedition ' Me.lblErrSpedition.AutoSize = True Me.lblErrSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrSpedition.ForeColor = System.Drawing.Color.Red - Me.lblErrSpedition.Location = New System.Drawing.Point(175, 316) + 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 Me.lblErrSpedition.Text = "Bitte eine Spedition angegeben:" Me.lblErrSpedition.Visible = False ' + 'lblDragIndicator + ' + Me.lblDragIndicator.AutoSize = True + Me.lblDragIndicator.BackColor = System.Drawing.Color.Transparent + Me.lblDragIndicator.Cursor = System.Windows.Forms.Cursors.SizeAll + Me.lblDragIndicator.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDragIndicator.ForeColor = System.Drawing.Color.Gray + Me.lblDragIndicator.Location = New System.Drawing.Point(323, 3) + Me.lblDragIndicator.Name = "lblDragIndicator" + Me.lblDragIndicator.Size = New System.Drawing.Size(84, 15) + Me.lblDragIndicator.TabIndex = 132 + Me.lblDragIndicator.Text = "✥ Verschieben" + ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.BackColor = System.Drawing.Color.WhiteSmoke Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!) - Me.Label2.Location = New System.Drawing.Point(175, 316) + 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 @@ -341,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(147, 385) + 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 @@ -357,7 +212,7 @@ Partial Class frmAddSendungsvermerkShort Me.btnCLose.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnCLose.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCLose.ForeColor = System.Drawing.Color.White - Me.btnCLose.Location = New System.Drawing.Point(399, -1) + Me.btnCLose.Location = New System.Drawing.Point(419, -1) Me.btnCLose.Name = "btnCLose" Me.btnCLose.RightToLeft = System.Windows.Forms.RightToLeft.Yes Me.btnCLose.Size = New System.Drawing.Size(54, 20) @@ -365,24 +220,12 @@ Partial Class frmAddSendungsvermerkShort Me.btnCLose.Text = "X" Me.btnCLose.UseVisualStyleBackColor = False ' - 'lblErrDokument - ' - Me.lblErrDokument.AutoSize = True - Me.lblErrDokument.BackColor = System.Drawing.Color.WhiteSmoke - Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(91, 115) - Me.lblErrDokument.Name = "lblErrDokument" - Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) - Me.lblErrDokument.TabIndex = 11 - Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" - Me.lblErrDokument.Visible = False - ' 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.BackColor = System.Drawing.Color.WhiteSmoke + Me.Label1.BackColor = System.Drawing.Color.Transparent Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label1.Location = New System.Drawing.Point(9, 9) + Me.Label1.Location = New System.Drawing.Point(9, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(156, 17) Me.Label1.TabIndex = 1 @@ -392,16 +235,16 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSpedition.Location = New System.Drawing.Point(177, 332) + Me.txtSpedition.Location = New System.Drawing.Point(178, 215) Me.txtSpedition.MaxLength = 50 Me.txtSpedition.Name = "txtSpedition" - Me.txtSpedition.Size = New System.Drawing.Size(125, 20) + Me.txtSpedition.Size = New System.Drawing.Size(126, 20) Me.txtSpedition.TabIndex = 20 ' 'optSendungInVorbereitung ' Me.optSendungInVorbereitung.AutoSize = True - Me.optSendungInVorbereitung.Location = New System.Drawing.Point(203, 3) + Me.optSendungInVorbereitung.Location = New System.Drawing.Point(174, 3) Me.optSendungInVorbereitung.Name = "optSendungInVorbereitung" Me.optSendungInVorbereitung.Size = New System.Drawing.Size(143, 17) Me.optSendungInVorbereitung.TabIndex = 13 @@ -413,7 +256,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optSpeditionWeitergeleitet.AutoSize = True Me.optSpeditionWeitergeleitet.BackColor = System.Drawing.Color.WhiteSmoke - Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(12, 334) + 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 @@ -424,7 +267,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFreierText.AutoSize = True Me.optFreierText.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFreierText.Location = New System.Drawing.Point(12, 361) + 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 @@ -435,38 +278,18 @@ Partial Class frmAddSendungsvermerkShort ' Me.optATAangefordert.AutoSize = True Me.optATAangefordert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optATAangefordert.Location = New System.Drawing.Point(164, 458) + 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 Me.optATAangefordert.Text = "ATA/ATC-Nr. angefordert (Fremdanm.)" Me.optATAangefordert.UseVisualStyleBackColor = False ' - 'optVorkasseAngefordert - ' - Me.optVorkasseAngefordert.AutoSize = True - Me.optVorkasseAngefordert.Location = New System.Drawing.Point(12, 184) - Me.optVorkasseAngefordert.Name = "optVorkasseAngefordert" - Me.optVorkasseAngefordert.Size = New System.Drawing.Size(144, 17) - Me.optVorkasseAngefordert.TabIndex = 14 - Me.optVorkasseAngefordert.Text = "Vorauskasse angefordert" - Me.optVorkasseAngefordert.UseVisualStyleBackColor = True - ' - 'optKontaktdatenAngefordert - ' - Me.optKontaktdatenAngefordert.AutoSize = True - Me.optKontaktdatenAngefordert.Location = New System.Drawing.Point(12, 141) - Me.optKontaktdatenAngefordert.Name = "optKontaktdatenAngefordert" - Me.optKontaktdatenAngefordert.Size = New System.Drawing.Size(212, 17) - Me.optKontaktdatenAngefordert.TabIndex = 12 - Me.optKontaktdatenAngefordert.Text = "Kontaktdaten (z.B.Tel-Nr.) - angefordert" - Me.optKontaktdatenAngefordert.UseVisualStyleBackColor = True - ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label3.Location = New System.Drawing.Point(308, 335) + 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 @@ -476,7 +299,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.lblErr240Zeichen.AutoSize = True Me.lblErr240Zeichen.ForeColor = System.Drawing.Color.Red - Me.lblErr240Zeichen.Location = New System.Drawing.Point(219, 496) + 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 @@ -488,12 +311,12 @@ Partial Class frmAddSendungsvermerkShort Me.txtDetail.AcceptsReturn = True Me.txtDetail.BackColor = System.Drawing.Color.White Me.txtDetail.ForeColor = System.Drawing.SystemColors.InfoText - Me.txtDetail.Location = New System.Drawing.Point(12, 512) + Me.txtDetail.Location = New System.Drawing.Point(17, 348) Me.txtDetail.MaxLength = 240 Me.txtDetail.Multiline = True Me.txtDetail.Name = "txtDetail" Me.txtDetail.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtDetail.Size = New System.Drawing.Size(302, 54) + Me.txtDetail.Size = New System.Drawing.Size(303, 41) Me.txtDetail.TabIndex = 33 Me.txtDetail.TabStop = False Me.txtDetail.WordWrap = False @@ -501,7 +324,7 @@ Partial Class frmAddSendungsvermerkShort 'lblZustzlFreitext ' Me.lblZustzlFreitext.AutoSize = True - Me.lblZustzlFreitext.Location = New System.Drawing.Point(9, 496) + 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 @@ -511,84 +334,50 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtSendungSpedition.BackColor = System.Drawing.Color.WhiteSmoke Me.txtSendungSpedition.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtSendungSpedition.Location = New System.Drawing.Point(144, 332) + Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 234) Me.txtSendungSpedition.MaxLength = 50 Me.txtSendungSpedition.Name = "txtSendungSpedition" - Me.txtSendungSpedition.Size = New System.Drawing.Size(25, 20) + Me.txtSendungSpedition.Size = New System.Drawing.Size(26, 20) Me.txtSendungSpedition.TabIndex = 18 Me.txtSendungSpedition.Visible = False ' - 'cbxNichtLeserlich - ' - Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 98) - 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(320, 512) + Me.btnOK.Location = New System.Drawing.Point(325, 348) Me.btnOK.Name = "btnOK" - Me.btnOK.Size = New System.Drawing.Size(124, 54) + Me.btnOK.Size = New System.Drawing.Size(125, 41) Me.btnOK.TabIndex = 34 Me.btnOK.Text = "Hinzufügen" Me.btnOK.UseVisualStyleBackColor = True ' - 'cbxSonstDok + 'btnDokumtanforderung ' - Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxSonstDok.Location = New System.Drawing.Point(12, 98) - 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 + Me.btnDokumtanforderung.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnDokumtanforderung.Location = New System.Drawing.Point(323, 22) + Me.btnDokumtanforderung.Name = "btnDokumtanforderung" + Me.btnDokumtanforderung.Size = New System.Drawing.Size(140, 23) + Me.btnDokumtanforderung.TabIndex = 133 + Me.btnDokumtanforderung.Text = "Dokumtanforderung" + Me.btnDokumtanforderung.UseVisualStyleBackColor = True ' '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(354, 385) + 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 Me.Label9.Text = "(max. 80 Zeichen)" ' - 'cbxVollmacht - ' - Me.cbxVollmacht.AutoSize = True - Me.cbxVollmacht.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxVollmacht.Location = New System.Drawing.Point(164, 75) - Me.cbxVollmacht.Name = "cbxVollmacht" - Me.cbxVollmacht.Size = New System.Drawing.Size(72, 17) - Me.cbxVollmacht.TabIndex = 7 - Me.cbxVollmacht.Text = "Vollmacht" - Me.cbxVollmacht.UseVisualStyleBackColor = False - ' - 'cbxCMR - ' - Me.cbxCMR.AutoSize = True - Me.cbxCMR.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxCMR.Location = New System.Drawing.Point(164, 32) - Me.cbxCMR.Name = "cbxCMR" - Me.cbxCMR.Size = New System.Drawing.Size(50, 17) - Me.cbxCMR.TabIndex = 3 - Me.cbxCMR.Text = "CMR" - Me.cbxCMR.UseVisualStyleBackColor = False - ' 'Label17 ' Me.Label17.AutoSize = True Me.Label17.BackColor = System.Drawing.Color.WhiteSmoke Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Italic) - Me.Label17.Location = New System.Drawing.Point(144, 385) + 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 @@ -599,92 +388,29 @@ Partial Class frmAddSendungsvermerkShort Me.Label13.AutoSize = True Me.Label13.BackColor = System.Drawing.Color.WhiteSmoke Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label13.Location = New System.Drawing.Point(9, 307) + 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 Me.Label13.Text = "Sonstiges:" ' - 'cbxATR - ' - Me.cbxATR.AutoSize = True - Me.cbxATR.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxATR.Location = New System.Drawing.Point(164, 52) - Me.cbxATR.Name = "cbxATR" - Me.cbxATR.Size = New System.Drawing.Size(127, 17) - Me.cbxATR.TabIndex = 5 - Me.cbxATR.Text = "A.TR (Original/Kopie)" - Me.cbxATR.UseVisualStyleBackColor = False - ' - 'cbxLS - ' - Me.cbxLS.AutoSize = True - Me.cbxLS.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxLS.Location = New System.Drawing.Point(12, 75) - Me.cbxLS.Name = "cbxLS" - Me.cbxLS.Size = New System.Drawing.Size(83, 17) - Me.cbxLS.TabIndex = 6 - Me.cbxLS.Text = "Lieferschein" - Me.cbxLS.UseVisualStyleBackColor = False - ' 'txtFreierText ' Me.txtFreierText.BackColor = System.Drawing.Color.WhiteSmoke Me.txtFreierText.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtFreierText.Location = New System.Drawing.Point(122, 359) + Me.txtFreierText.Location = New System.Drawing.Point(123, 230) Me.txtFreierText.MaxLength = 80 Me.txtFreierText.Name = "txtFreierText" - Me.txtFreierText.Size = New System.Drawing.Size(322, 23) + Me.txtFreierText.Size = New System.Drawing.Size(323, 23) Me.txtFreierText.TabIndex = 28 ' - 'cbxRechnung - ' - Me.cbxRechnung.AutoSize = True - Me.cbxRechnung.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxRechnung.Location = New System.Drawing.Point(12, 53) - Me.cbxRechnung.Name = "cbxRechnung" - Me.cbxRechnung.Size = New System.Drawing.Size(137, 17) - Me.cbxRechnung.TabIndex = 4 - Me.cbxRechnung.Text = "Rechnung (mangelhaft)" - Me.cbxRechnung.UseVisualStyleBackColor = False - ' - 'Label20 - ' - Me.Label20.AutoSize = True - Me.Label20.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label20.Location = New System.Drawing.Point(267, 335) - Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(0, 13) - Me.Label20.TabIndex = 21 - ' - 'cbxAuftrag - ' - Me.cbxAuftrag.AutoSize = True - Me.cbxAuftrag.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxAuftrag.Location = New System.Drawing.Point(12, 32) - Me.cbxAuftrag.Name = "cbxAuftrag" - Me.cbxAuftrag.Size = New System.Drawing.Size(60, 17) - Me.cbxAuftrag.TabIndex = 2 - Me.cbxAuftrag.Text = "Auftrag" - Me.cbxAuftrag.UseVisualStyleBackColor = False - ' - 'PictureBox1 - ' - Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke - Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox1.Location = New System.Drawing.Point(-1, -1) - Me.PictureBox1.Name = "PictureBox1" - Me.PictureBox1.Size = New System.Drawing.Size(453, 130) - Me.PictureBox1.TabIndex = 83 - Me.PictureBox1.TabStop = False - ' 'PictureBox4 ' Me.PictureBox4.BackColor = System.Drawing.Color.WhiteSmoke Me.PictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.PictureBox4.Location = New System.Drawing.Point(-1, 297) + Me.PictureBox4.Location = New System.Drawing.Point(-1, 190) Me.PictureBox4.Name = "PictureBox4" - Me.PictureBox4.Size = New System.Drawing.Size(453, 189) + Me.PictureBox4.Size = New System.Drawing.Size(474, 139) Me.PictureBox4.TabIndex = 78 Me.PictureBox4.TabStop = False ' @@ -695,14 +421,14 @@ Partial Class frmAddSendungsvermerkShort Me.Panel4.Dock = System.Windows.Forms.DockStyle.Top Me.Panel4.Location = New System.Drawing.Point(0, 0) Me.Panel4.Name = "Panel4" - Me.Panel4.Size = New System.Drawing.Size(454, 0) + Me.Panel4.Size = New System.Drawing.Size(474, 0) Me.Panel4.TabIndex = 1 ' 'frmAddSendungsvermerkShort ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(454, 605) + 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) @@ -714,7 +440,6 @@ Partial Class frmAddSendungsvermerkShort Me.pnlMain.ResumeLayout(False) Me.pnlSendungsVermker.ResumeLayout(False) Me.pnlSendungsVermker.PerformLayout() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) @@ -723,53 +448,31 @@ 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 - Friend WithEvents optVorkasseAngefordert As System.Windows.Forms.CheckBox - Friend WithEvents optKontaktdatenAngefordert As System.Windows.Forms.CheckBox Friend WithEvents Label3 As System.Windows.Forms.Label 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 cbxSonstDok As System.Windows.Forms.CheckBox + Friend WithEvents btnDokumtanforderung As System.Windows.Forms.Button Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents cbxVollmacht As System.Windows.Forms.CheckBox Friend WithEvents lblErrSpedition As System.Windows.Forms.Label - Friend WithEvents cbxCMR As System.Windows.Forms.CheckBox Friend WithEvents lblErrGrund As System.Windows.Forms.Label Friend WithEvents Label17 As System.Windows.Forms.Label Friend WithEvents Label13 As System.Windows.Forms.Label - Friend WithEvents cbxATR As System.Windows.Forms.CheckBox - Friend WithEvents cbxLS As System.Windows.Forms.CheckBox Friend WithEvents txtFreierText As System.Windows.Forms.TextBox Friend WithEvents txtSpedition As System.Windows.Forms.TextBox - Friend WithEvents cbxRechnung As System.Windows.Forms.CheckBox - Friend WithEvents Label20 As System.Windows.Forms.Label - Friend WithEvents cbxAuftrag As System.Windows.Forms.CheckBox Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents optSendungInVorbereitung As System.Windows.Forms.CheckBox - Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox - Friend WithEvents lblErrDokument As System.Windows.Forms.Label + Friend WithEvents lblDragIndicator As System.Windows.Forms.Label Friend WithEvents btnCLose As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents optUeberwachungsdok As System.Windows.Forms.CheckBox - Friend WithEvents cbxRgBest As CheckBox Friend WithEvents Label4 As Label Friend WithEvents optFremd_ATB As CheckBox Friend WithEvents optFremd_SendungAvisiert As CheckBox - Friend WithEvents optFahrerKeinATR As CheckBox - Friend WithEvents optFrachtkostenAngefordert As CheckBox - Friend WithEvents optKundeNichtErreichbar As CheckBox - Friend WithEvents optAbsenderbestätigung As CheckBox - Friend WithEvents cbxPackliste As CheckBox - Friend WithEvents optGewPackAngefordert As CheckBox - Friend WithEvents optKostenbestaetigungAngefordert As CheckBox - Friend WithEvents optZolltarifnummerAngefordert As CheckBox - Friend WithEvents optDraft As CheckBox Public WithEvents txtDetail As TextBox + Friend WithEvents flpAngefordert As FlowLayoutPanel End Class diff --git a/Aviso/frmAddSendungsvermerkShort.vb b/Aviso/frmAddSendungsvermerkShort.vb index a672768..fd6c042 100644 --- a/Aviso/frmAddSendungsvermerkShort.vb +++ b/Aviso/frmAddSendungsvermerkShort.vb @@ -1,7 +1,13 @@ - -Imports AVISO.AvisoStatusFunctions -Imports SDL + +Imports System.Configuration +Imports System.IO +Imports System.Net +Imports System.Net.Mail +Imports System.Text +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq Imports VERAG_PROG_ALLGEMEIN +Imports AVISO.AvisoStatusFunctions Public Class frmAddSendungsvermerkShort Dim AvisoDAL As New cAvisoDAL @@ -15,6 +21,9 @@ Public Class frmAddSendungsvermerkShort 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 @@ -31,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() @@ -59,16 +68,18 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub frmEintragVermerk_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) - 'cboDokumente.Items.Clear() - ' cboDokumente.Items.Add(New MyListItem("nachgefordert", CStr(0))) - 'cboDokumente.Items.Add(New MyListItem("erhalten", CStr(1))) - 'cboDokumente.SelectedIndex = 0 - - Me.CenterToParent() - If My.Computer.Screen.WorkingArea.Height < Me.Height Then - Me.Height = My.Computer.Screen.WorkingArea.Height + Dim pt As Point = Cursor.Position + Dim screenBounds As Rectangle = Screen.FromPoint(pt).WorkingArea + If pt.X + Me.Width > screenBounds.Right Then + pt.X = screenBounds.Right - Me.Width End If + If pt.Y + Me.Height > screenBounds.Bottom Then + pt.Y = screenBounds.Bottom - Me.Height + End If + Me.Location = pt + + VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) + For Each c In Me.Controls If c.GetType.Name.ToString = "RadioButton" Then AddHandler DirectCast(c, RadioButton).CheckedChanged, AddressOf selectionChanged @@ -92,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 & "" @@ -119,6 +133,81 @@ Public Class frmAddSendungsvermerkShort ' Me.Close() ' End Sub + Private Sub SetupDynamicAnforderungCheckboxes() + _anforderungCheckboxes.Clear() + _backendBezeichnungByCodeId.Clear() + + Dim dt As DataTable = Nothing + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Return + End Try + End Try + + If dt Is Nothing OrElse dt.Rows.Count = 0 Then + Return + End If + + flpAngefordert.Controls.Clear() + + For Each row As DataRow In dt.Rows + Dim id As Integer + Try + id = CInt(row("VermerkCodeId")) + Catch + Continue For + End Try + + Dim bezeichnung = If(IsDBNull(row("Bezeichnung")), "", CStr(row("Bezeichnung"))).Trim() + If bezeichnung = "" Then Continue For + _backendBezeichnungByCodeId(id) = bezeichnung + + Dim frontendBezeichnung = bezeichnung + If dt.Columns.Contains("FrontendBezeichnung") Then + frontendBezeichnung = If(IsDBNull(row("FrontendBezeichnung")), "", CStr(row("FrontendBezeichnung"))).Trim() + If frontendBezeichnung = "" Then frontendBezeichnung = bezeichnung + End If + + Dim bereich As Integer = BereichAngefordert + Try + If Not IsDBNull(row("AnforderungBereich")) Then + bereich = CInt(row("AnforderungBereich")) + End If + Catch + End Try + + 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 + Next + End Sub + + Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) + If cb Is Nothing OrElse container Is Nothing Then Return + + cb.AutoSize = False + cb.Height = 18 + + Dim cols As Integer = 2 + Dim colGap As Integer = 14 + 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 txtFeld_GotFocus(sender As Object, e As System.EventArgs) Handles txtFreierText.GotFocus, txtSpedition.GotFocus CType(sender, TextBox).SelectAll() End Sub @@ -145,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) @@ -156,44 +244,32 @@ Public Class frmAddSendungsvermerkShort insertSendungsVermerk(SendungID, myAviso.AvisoID, txtFreierText.Text.Trim & " - offen", 101) End If - If cbxAuftrag.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Auftrag für Sendung '" & txtSendung.Text.Trim & "' fehlt - angefordert", 1) - If cbxRechnung.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Rechnung für Sendung '" & txtSendung.Text.Trim & "' fehlt / mangelhaft - angefordert", 3) - If cbxLS.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Lieferschein für Sendung '" & txtSendung.Text.Trim & "' fehlt - angefordert", 5) - If cbxATR.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "ATR für Sendung '" & txtSendung.Text.Trim & "' fehlt - angefordert", 7) - If cbxVollmacht.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Vollmacht für Sendung '" & txtSendung.Text.Trim & "' fehlt - angefordert", 9) - If cbxCMR.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "CMR bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 11) - If cbxPackliste.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Packliste bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 90) - If cbxRgBest.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Rechnungsbestätigung bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 55) - If optGewPackAngefordert.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Gewicht/Packstücke bei Sendung '" & txtSendung.Text.Trim & "' mangelhaft - angefordert", 103) - If optZolltarifnummerAngefordert.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Zolltarifnummer bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 105) - If optKostenbestaetigungAngefordert.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Kostenbestaetigung bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 107) + For Each cb In _anforderungCheckboxes + 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() - If optFrachtkostenAngefordert.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Frachtkosten bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 74) - If optAbsenderbestätigung.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Absenderbestätigung bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 76) + 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) + End If + End If + End If + Next - If optKundeNichtErreichbar.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Kunde bei Sendung '" & txtSendung.Text.Trim & "' nicht erreichbar", 70) - If optFahrerKeinATR.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Fahrer ohne A.TR bei Sendung '" & txtSendung.Text.Trim & "'", 71) 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 optDraft.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "T2 Draft OK bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 118) - - If optUeberwachungsdok.Checked Then insertSendungsVermerk(SendungID, myAviso.AvisoID, "Ü-Dok bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 53) - - 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 optVorkasseAngefordert.Checked = True Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, "Vorauskasse bei Sendung '" & txtSendung.Text.Trim & "' angefordert", 13) - End If If optSpeditionWeitergeleitet.Checked = True Then If txtSpedition.Text.Trim = "" Then showErr(lblErrSpedition) @@ -206,9 +282,6 @@ Public Class frmAddSendungsvermerkShort insertSendungsVermerk(SendungID, myAviso.AvisoID, "Sendung '" & txtSendung.Text.Trim & "' in Vorbereitung.", 31) VermerkeDAL.UpdateSendungVorbereitet(AvisoID, SendungID, VERAG_PROG_ALLGEMEIN.cGlobal.AktiverMitarbeiter.MitarbeiterID, True) End If - If optKontaktdatenAngefordert.Checked = True Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, "Kontaktdaten bei Sendung '" & txtSendung.Text.Trim & "' - angefordert", 36) - End If ' If optSendungVorbereitet.Checked = True Then 'insertSendungsVermerk(SendungID,myAviso.AvisoID, "Sendung '" & txtSendung.Text.Trim & "' Vorbereitung abgeschlossen.", 32) ' VermerkeDAL.UpdateSendungVorbereitet(AvisoID, SendungID, VERAG_PROG_ALLGEMEIN.cglobal.AktiverMitarbeiter.MitarbeiterID, False) @@ -275,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 @@ -299,13 +371,11 @@ Public Class frmAddSendungsvermerkShort ' optDokumente.Checked = True 'End Sub - Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) Handles cbxAuftrag.CheckedChanged, cbxRechnung.CheckedChanged, cbxLS.CheckedChanged, - cbxCMR.CheckedChanged, cbxATR.CheckedChanged, cbxVollmacht.CheckedChanged, cbxSonstDok.CheckedChanged, cbxNichtLeserlich.CheckedChanged, cbxPackliste.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 @@ -327,18 +397,51 @@ Public Class frmAddSendungsvermerkShort Private Sub frmAddSendungsvermerk_Shown(sender As Object, e As EventArgs) Handles Me.Shown - Dim p = Cursor.Position - If (p.X + Me.Width) > My.Computer.Screen.WorkingArea.Width Then p.X = My.Computer.Screen.WorkingArea.Width - Me.Width - If (p.Y + Me.Height) > My.Computer.Screen.WorkingArea.Height Then p.Y = My.Computer.Screen.WorkingArea.Height - Me.Height - Me.Location = p '.Me.PointToClient(System.Cursor.Position) txtSendung.SelectionLength = 0 - cbxAuftrag.Focus() + txtFreierText.Focus() End Sub + Private drag As Boolean + Private mouseX As Integer + Private mouseY As Integer + + Private Sub Form_MouseDown(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseDown + If e.Button = MouseButtons.Left Then + drag = True + mouseX = Cursor.Position.X - Me.Left + mouseY = Cursor.Position.Y - Me.Top + End If + End Sub + + Private Sub Form_MouseMove(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseMove + If drag Then + Me.Top = Cursor.Position.Y - mouseY + Me.Left = Cursor.Position.X - mouseX + End If + End Sub + + Private Sub Form_MouseUp(sender As Object, e As MouseEventArgs) Handles lblDragIndicator.MouseUp + drag = False + End Sub + ' ---------------------- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnCLose.Click Me.Close() End Sub + Private Sub btnDokumtanforderung_Click(sender As Object, e As EventArgs) Handles btnDokumtanforderung.Click + 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 + frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) + Me.Close() + End If + End Using + End Sub + Private Sub Button2_Click(sender As Object, e As EventArgs) If insertVermerke() Then VERAG_PROG_ALLGEMEIN.cAvisoBenachrichtigungen.INSERT_BENACHRICHTIGUNG(myAviso.AvisoID, SendungID, 1, "T", 13, , 1) diff --git a/Aviso/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb new file mode 100644 index 0000000..38a1cd2 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -0,0 +1,440 @@ + +Partial Class frmSendungsDokumentanforderung + Inherits System.Windows.Forms.Form + + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + Private components As System.ComponentModel.IContainer + + + Private Sub InitializeComponent() + Me.flpDokumenteFehlenMain = New System.Windows.Forms.FlowLayoutPanel() + Me.cbxSonstDok = New System.Windows.Forms.CheckBox() + Me.txtSonstigesDokumentFehlt = New System.Windows.Forms.TextBox() + Me.cbxNichtLeserlich = New System.Windows.Forms.CheckBox() + Me.lblErrDokument = New System.Windows.Forms.Label() + Me.pnlDocumentEditor = New System.Windows.Forms.Panel() + Me.flpDocumentTabs = New System.Windows.Forms.FlowLayoutPanel() + Me.lblDocumentEditorTitle = New System.Windows.Forms.Label() + Me.lblDocumentEditorName = New System.Windows.Forms.Label() + Me.txtDocumentEditorName = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorAnhangsart = New System.Windows.Forms.Label() + Me.cmbDocumentEditorAnhangsart = New System.Windows.Forms.ComboBox() + Me.lblDocumentEditorInfo = New System.Windows.Forms.Label() + Me.txtDocumentEditorInfo = New System.Windows.Forms.TextBox() + Me.lblDocumentEditorStatus = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.Label20 = New System.Windows.Forms.Label() + Me.btnCustomerUploadLink = New System.Windows.Forms.Button() + Me.btnCustomerUploadEmail = New System.Windows.Forms.Button() + Me.txtCustomerUploadEmail = New System.Windows.Forms.TextBox() + Me.lblCustomerUploadEmail = New System.Windows.Forms.Label() + Me.lblCustomerUploadValidityHours = New System.Windows.Forms.Label() + Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() + Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() + Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() + Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() + Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() + Me.btnVermerkSetzen = New System.Windows.Forms.Button() + Me.lblTitel = New System.Windows.Forms.Label() + Me.lblKontaktEmails = New System.Windows.Forms.Label() + Me.dgvKontaktEmails = New System.Windows.Forms.DataGridView() + Me.pnlDocumentEditor.SuspendLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dgvKontaktEmails, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'flpDokumenteFehlenMain + ' + Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent + Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 34) + Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) + Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.TabIndex = 0 + ' + 'cbxSonstDok + ' + Me.cbxSonstDok.AutoSize = True + Me.cbxSonstDok.Location = New System.Drawing.Point(12, 126) + Me.cbxSonstDok.Name = "cbxSonstDok" + Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) + Me.cbxSonstDok.TabIndex = 1 + Me.cbxSonstDok.Text = "Dok. Name:" + Me.cbxSonstDok.UseVisualStyleBackColor = True + ' + 'txtSonstigesDokumentFehlt + ' + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(95, 124) + Me.txtSonstigesDokumentFehlt.MaxLength = 80 + Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) + Me.txtSonstigesDokumentFehlt.TabIndex = 2 + ' + 'cbxNichtLeserlich + ' + Me.cbxNichtLeserlich.AutoSize = True + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 126) + Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" + Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) + Me.cbxNichtLeserlich.TabIndex = 3 + Me.cbxNichtLeserlich.Text = "nicht leserlich" + Me.cbxNichtLeserlich.UseVisualStyleBackColor = True + ' + 'lblErrDokument + ' + Me.lblErrDokument.AutoSize = True + Me.lblErrDokument.ForeColor = System.Drawing.Color.Red + Me.lblErrDokument.Location = New System.Drawing.Point(96, 146) + Me.lblErrDokument.Name = "lblErrDokument" + Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) + Me.lblErrDokument.TabIndex = 4 + Me.lblErrDokument.Text = "Bitte ein Dokument angegeben!" + Me.lblErrDokument.Visible = False + ' + 'pnlDocumentEditor + ' + Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke + Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 159) + Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.TabIndex = 5 + ' + 'flpDocumentTabs + ' + Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDocumentTabs.AutoScroll = True + Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) + Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) + Me.flpDocumentTabs.Name = "flpDocumentTabs" + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) + Me.flpDocumentTabs.TabIndex = 0 + Me.flpDocumentTabs.WrapContents = False + ' + 'lblDocumentEditorTitle + ' + Me.lblDocumentEditorTitle.AutoSize = True + Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) + Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" + Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) + Me.lblDocumentEditorTitle.TabIndex = 1 + Me.lblDocumentEditorTitle.Text = "Dokumentdetails" + ' + 'lblDocumentEditorName + ' + Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Name = "lblDocumentEditorName" + Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) + Me.lblDocumentEditorName.TabIndex = 2 + Me.lblDocumentEditorName.Text = "Dokumentname:" + ' + 'txtDocumentEditorName + ' + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.MaxLength = 120 + Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.TabIndex = 3 + ' + 'lblDocumentEditorAnhangsart + ' + Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" + Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) + Me.lblDocumentEditorAnhangsart.TabIndex = 4 + Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" + ' + 'cmbDocumentEditorAnhangsart + ' + Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.TabIndex = 5 + ' + 'lblDocumentEditorInfo + ' + Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" + Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) + Me.lblDocumentEditorInfo.TabIndex = 6 + Me.lblDocumentEditorInfo.Text = "Dokument Info:" + ' + 'txtDocumentEditorInfo + ' + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.MaxLength = 500 + Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.TabIndex = 7 + Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." + ' + 'lblDocumentEditorStatus + ' + Me.lblDocumentEditorStatus.AutoSize = True + Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) + Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" + Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) + Me.lblDocumentEditorStatus.TabIndex = 8 + Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label5.Location = New System.Drawing.Point(6, 298) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(202, 17) + Me.Label5.TabIndex = 6 + Me.Label5.Text = "Kundenportal Upload-Link:" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.Label20.Location = New System.Drawing.Point(216, 300) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(207, 13) + Me.Label20.TabIndex = 7 + Me.Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + ' + 'btnCustomerUploadLink + ' + Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 321) + Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadLink.TabIndex = 11 + Me.btnCustomerUploadLink.Text = "Link kopieren" + Me.btnCustomerUploadLink.UseVisualStyleBackColor = True + ' + 'btnCustomerUploadEmail + ' + Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 346) + Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadEmail.TabIndex = 13 + Me.btnCustomerUploadEmail.Text = "E-Mail senden" + Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True + ' + 'txtCustomerUploadEmail + ' + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 348) + Me.txtCustomerUploadEmail.MaxLength = 255 + Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) + Me.txtCustomerUploadEmail.TabIndex = 12 + ' + 'lblCustomerUploadEmail + ' + Me.lblCustomerUploadEmail.AutoSize = True + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 351) + Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" + Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) + Me.lblCustomerUploadEmail.TabIndex = 10 + Me.lblCustomerUploadEmail.Text = "E-Mail an:" + ' + 'lblCustomerUploadValidityHours + ' + Me.lblCustomerUploadValidityHours.AutoSize = True + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 325) + Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" + Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) + Me.lblCustomerUploadValidityHours.TabIndex = 9 + Me.lblCustomerUploadValidityHours.Text = "Gültigkeit(h):" + ' + 'nudCustomerUploadValidityHours + ' + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 323) + Me.nudCustomerUploadValidityHours.Maximum = New Decimal(New Integer() {168, 0, 0, 0}) + Me.nudCustomerUploadValidityHours.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.nudCustomerUploadValidityHours.Name = "nudCustomerUploadValidityHours" + Me.nudCustomerUploadValidityHours.Size = New System.Drawing.Size(74, 20) + Me.nudCustomerUploadValidityHours.TabIndex = 10 + Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) + ' + 'cmbCustomerUploadLanguage + ' + Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbCustomerUploadLanguage.FormattingEnabled = True + Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 322) + Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) + Me.cmbCustomerUploadLanguage.TabIndex = 9 + ' + 'lblCustomerUploadLanguage + ' + Me.lblCustomerUploadLanguage.AutoSize = True + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 325) + Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" + Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) + Me.lblCustomerUploadLanguage.TabIndex = 8 + Me.lblCustomerUploadLanguage.Text = "Mail Sprache:" + ' + 'txtCustomerUploadEmailText + ' + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 374) + Me.txtCustomerUploadEmailText.MaxLength = 500 + Me.txtCustomerUploadEmailText.Multiline = True + Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" + Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 44) + Me.txtCustomerUploadEmailText.TabIndex = 14 + Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + ' + 'lblCustomerUploadEmailText + ' + Me.lblCustomerUploadEmailText.AutoSize = True + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 377) + Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" + Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) + Me.lblCustomerUploadEmailText.TabIndex = 15 + Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" + ' + 'lblKontaktEmails + ' + Me.lblKontaktEmails.AutoSize = True + Me.lblKontaktEmails.Location = New System.Drawing.Point(6, 427) + Me.lblKontaktEmails.Name = "lblKontaktEmails" + Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) + Me.lblKontaktEmails.TabIndex = 17 + Me.lblKontaktEmails.Text = "Hinterlegte E-Mail-Adressen (Doppelklick = Übernehmen):" + ' + 'dgvKontaktEmails + ' + Me.dgvKontaktEmails.AllowUserToAddRows = False + Me.dgvKontaktEmails.AllowUserToDeleteRows = False + Me.dgvKontaktEmails.AllowUserToResizeRows = False + Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White + Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 445) + Me.dgvKontaktEmails.MultiSelect = False + Me.dgvKontaktEmails.Name = "dgvKontaktEmails" + Me.dgvKontaktEmails.ReadOnly = True + Me.dgvKontaktEmails.RowHeadersVisible = False + Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgvKontaktEmails.Size = New System.Drawing.Size(455, 84) + Me.dgvKontaktEmails.TabIndex = 18 + ' + 'btnVermerkSetzen + ' + Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnVermerkSetzen.Location = New System.Drawing.Point(340, 535) + Me.btnVermerkSetzen.Name = "btnVermerkSetzen" + Me.btnVermerkSetzen.Size = New System.Drawing.Size(124, 30) + Me.btnVermerkSetzen.TabIndex = 16 + Me.btnVermerkSetzen.Text = "Vermerk setzen" + Me.btnVermerkSetzen.UseVisualStyleBackColor = True + ' + 'lblTitel + ' + Me.lblTitel.AutoSize = True + Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblTitel.Location = New System.Drawing.Point(9, 9) + Me.lblTitel.Name = "lblTitel" + Me.lblTitel.Size = New System.Drawing.Size(156, 17) + Me.lblTitel.TabIndex = 18 + Me.lblTitel.Text = "Dokument(e) fehlen:" + ' + 'frmSendungsDokumentanforderung + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(474, 576) + Me.Controls.Add(Me.dgvKontaktEmails) + Me.Controls.Add(Me.lblKontaktEmails) + Me.Controls.Add(Me.lblTitel) + Me.Controls.Add(Me.btnVermerkSetzen) + Me.Controls.Add(Me.lblCustomerUploadEmailText) + Me.Controls.Add(Me.txtCustomerUploadEmailText) + Me.Controls.Add(Me.lblCustomerUploadLanguage) + Me.Controls.Add(Me.cmbCustomerUploadLanguage) + Me.Controls.Add(Me.nudCustomerUploadValidityHours) + Me.Controls.Add(Me.lblCustomerUploadValidityHours) + Me.Controls.Add(Me.lblCustomerUploadEmail) + Me.Controls.Add(Me.txtCustomerUploadEmail) + Me.Controls.Add(Me.btnCustomerUploadEmail) + Me.Controls.Add(Me.btnCustomerUploadLink) + Me.Controls.Add(Me.Label20) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.pnlDocumentEditor) + Me.Controls.Add(Me.lblErrDokument) + Me.Controls.Add(Me.cbxNichtLeserlich) + Me.Controls.Add(Me.txtSonstigesDokumentFehlt) + Me.Controls.Add(Me.cbxSonstDok) + Me.Controls.Add(Me.flpDokumenteFehlenMain) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmSendungsDokumentanforderung" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Dokumentanforderung" + Me.pnlDocumentEditor.ResumeLayout(False) + Me.pnlDocumentEditor.PerformLayout() + CType(Me.nudCustomerUploadValidityHours, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dgvKontaktEmails, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents flpDokumenteFehlenMain As FlowLayoutPanel + Friend WithEvents cbxSonstDok As CheckBox + Friend WithEvents txtSonstigesDokumentFehlt As TextBox + Friend WithEvents cbxNichtLeserlich As CheckBox + Friend WithEvents lblErrDokument As Label + Friend WithEvents pnlDocumentEditor As Panel + Friend WithEvents flpDocumentTabs As FlowLayoutPanel + Friend WithEvents lblDocumentEditorTitle As Label + Friend WithEvents lblDocumentEditorName As Label + Friend WithEvents txtDocumentEditorName As TextBox + Friend WithEvents lblDocumentEditorAnhangsart As Label + Friend WithEvents cmbDocumentEditorAnhangsart As ComboBox + Friend WithEvents lblDocumentEditorInfo As Label + Friend WithEvents txtDocumentEditorInfo As TextBox + Friend WithEvents lblDocumentEditorStatus As Label + Friend WithEvents Label5 As Label + Friend WithEvents Label20 As Label + Friend WithEvents btnCustomerUploadLink As Button + Friend WithEvents btnCustomerUploadEmail As Button + Friend WithEvents txtCustomerUploadEmail As TextBox + Friend WithEvents lblCustomerUploadEmail As Label + Friend WithEvents lblCustomerUploadValidityHours As Label + Friend WithEvents nudCustomerUploadValidityHours As NumericUpDown + Friend WithEvents cmbCustomerUploadLanguage As ComboBox + Friend WithEvents lblCustomerUploadLanguage As Label + Friend WithEvents txtCustomerUploadEmailText As TextBox + Friend WithEvents lblCustomerUploadEmailText As Label + Friend WithEvents btnVermerkSetzen As Button + Friend WithEvents lblTitel As Label + Friend WithEvents lblKontaktEmails As Label + Friend WithEvents dgvKontaktEmails As DataGridView +End Class diff --git a/Aviso/frmSendungsDokumentanforderung.resx b/Aviso/frmSendungsDokumentanforderung.resx new file mode 100644 index 0000000..459ff73 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.resx @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb new file mode 100644 index 0000000..1277d14 --- /dev/null +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -0,0 +1,1281 @@ +Imports System.Configuration +Imports System.IO +Imports System.Net +Imports System.Net.Mail +Imports System.Text +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports VERAG_PROG_ALLGEMEIN + +Public Class frmSendungsDokumentanforderung + Private ReadOnly AvisoDAL As New cAvisoDAL + Public Property AvisoID As Integer + Public Property SendungID As Integer + + Private ReadOnly _anforderungCheckboxes As New List(Of CheckBox) + Private ReadOnly _anhangsartIdByCheckbox As New Dictionary(Of CheckBox, Integer) + Private ReadOnly _backendBezeichnungByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _selectedAnhangsartIdByCodeId As New Dictionary(Of Integer, Integer) + Private ReadOnly _documentCustomNameByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _documentBaseTextByCodeId As New Dictionary(Of Integer, String) + Private ReadOnly _anhangsartenOptions As New List(Of AnhangsartOption) + Private ReadOnly _bereichByCodeId As New Dictionary(Of Integer, Integer) + + Private _selectedDocumentCodeId As Integer + Private _isLoadingDocumentEditor As Boolean + + Private Const DefaultDocumentBaseText As String = "Bitte das Dokument hochladen." + Private Const BereichDokumentMain As Integer = 1 + + Private Shared _customerPortalJwtToken As String = "" + Private Shared _customerPortalJwtExpUtc As DateTime = DateTime.MinValue + Private Shared _customerPortalAnhangsartenMap As Dictionary(Of String, Integer) = Nothing + Private Shared _customerPortalAnhangsartenFetchedUtc As DateTime = DateTime.MinValue + Private Shared _customerPortalCustomFilenameAnhangsartId As Integer = -1 + Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) + Private ReadOnly _kundenFirmaByNr As New Dictionary(Of Integer, String) + Private _kontaktRolleTabs As TabControl + + Public Sub New(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) + InitializeComponent() + AvisoID = avisoIdValue + SendungID = sendungIdValue + Icon = cMeineFunktionenAVISO.GetProgrammIcon + _stateToApply = If(state, New DokumentanforderungState()) + End Sub + + Private ReadOnly _stateToApply As DokumentanforderungState + + Private Sub frmSendungsDokumentanforderung_Load(sender As Object, e As EventArgs) Handles MyBase.Load + ResolveContextIds() + VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me) + If cmbCustomerUploadLanguage.SelectedIndex < 0 Then + Dim idx = cmbCustomerUploadLanguage.Items.IndexOf("de") + If idx >= 0 Then + cmbCustomerUploadLanguage.SelectedIndex = idx + ElseIf cmbCustomerUploadLanguage.Items.Count > 0 Then + cmbCustomerUploadLanguage.SelectedIndex = 0 + End If + End If + + InitializeDocumentEditor() + SetupDynamicAnforderungCheckboxes() + ApplyStateToUi(_stateToApply) + InitializeKontaktEmailGrid() + LoadKontaktEmails() + End Sub + + Private Sub 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 colArt As New DataGridViewTextBoxColumn() + colArt.Name = "colArt" + colArt.HeaderText = "Art" + colArt.DataPropertyName = "Art" + 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" + colEmail.DataPropertyName = "Email" + colEmail.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + dgvKontaktEmails.Columns.Add(colEmail) + End Sub + + Private Sub LoadKontaktEmails() + _kontaktEmailRows.Clear() + dgvKontaktEmails.Rows.Clear() + + Dim dedupe As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase) + + Dim fraechterKdNr As Integer = 0 + Dim auftraggeberKdNr As Integer = 0 + Dim avisiererKdNr As Integer = 0 + Dim empfaengerKdNr As Integer = 0 + Dim absenderKdNr As Integer = 0 + Dim frachtfuehrerKdNr As Integer = 0 + + Try + If SendungID > 0 Then + Dim dtSnd = AvisoDAL.loadDataTableBySQL("SELECT tblSnd_AvisiererKdNr, tblSnd_AuftraggeberKdNr, tblSnd_EmpfaengerKdNr, tblSnd_AbsenderKdNr, tblSnd_FrachtfuehrerKdNr FROM tblSendungen WHERE tblSnd_SendungID = " & SendungID) + If dtSnd IsNot Nothing AndAlso dtSnd.Rows.Count > 0 Then + Dim r = dtSnd.Rows(0) + avisiererKdNr = ToIntSafe(r("tblSnd_AvisiererKdNr")) + auftraggeberKdNr = ToIntSafe(r("tblSnd_AuftraggeberKdNr")) + empfaengerKdNr = ToIntSafe(r("tblSnd_EmpfaengerKdNr")) + absenderKdNr = ToIntSafe(r("tblSnd_AbsenderKdNr")) + frachtfuehrerKdNr = ToIntSafe(r("tblSnd_FrachtfuehrerKdNr")) + End If + End If + + If AvisoID > 0 Then + Dim aviso = AvisoDAL.LesenAviso(AvisoID, "") + If aviso IsNot Nothing Then + fraechterKdNr = ToIntSafe(aviso.Frächter_KdNr) + If auftraggeberKdNr = 0 Then + auftraggeberKdNr = ToIntSafe(aviso.Auftraggeber_KdNr) + End If + End If + End If + Catch + End Try + + AddKontaktEmailsByKunde("Frächter", fraechterKdNr, dedupe) + AddKontaktEmailsByKunde("Avisierer", avisiererKdNr, dedupe) + AddKontaktEmailsByKunde("Auftraggeber", auftraggeberKdNr, dedupe) + AddKontaktEmailsByKunde("Empfänger", empfaengerKdNr, dedupe) + AddKontaktEmailsByKunde("Absender", absenderKdNr, dedupe) + AddKontaktEmailsByKunde("Frachtführer", frachtfuehrerKdNr, dedupe) + + 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 + 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 + Dim firma = GetKundenFirma(kundenNr) + + Try + 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 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 + End Using + End Using + Catch + End Try + End Sub + + 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 + Try + If value Is Nothing Then Return 0 + Dim tmp As Integer = 0 + If Integer.TryParse(value.ToString(), tmp) Then Return tmp + Catch + End Try + Return 0 + End Function + + Private Sub dgvKontaktEmails_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvKontaktEmails.CellDoubleClick + If e.RowIndex < 0 OrElse e.RowIndex >= dgvKontaktEmails.Rows.Count Then Return + Dim emailObj = dgvKontaktEmails.Rows(e.RowIndex).Cells("colEmail").Value + Dim email = If(emailObj, "").ToString().Trim() + If email = "" Then Return + txtCustomerUploadEmail.Text = email + End Sub + + Private Sub InitializeDocumentEditor() + RemoveHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorName.TextChanged, AddressOf DocumentEditorInputChanged + RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + + EnsureAnhangsartenOptionsLoaded() + + RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + cmbDocumentEditorAnhangsart.BeginUpdate() + cmbDocumentEditorAnhangsart.Items.Clear() + For Each optionItem In _anhangsartenOptions + cmbDocumentEditorAnhangsart.Items.Add(optionItem) + Next + cmbDocumentEditorAnhangsart.EndUpdate() + AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + + ClearDocumentEditor() + End Sub + + Private Sub SetupDynamicAnforderungCheckboxes() + _anforderungCheckboxes.Clear() + _anhangsartIdByCheckbox.Clear() + _backendBezeichnungByCodeId.Clear() + _selectedAnhangsartIdByCodeId.Clear() + _documentCustomNameByCodeId.Clear() + _documentBaseTextByCodeId.Clear() + _bereichByCodeId.Clear() + _selectedDocumentCodeId = 0 + + Dim dt As DataTable = Nothing + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + Catch + Return + End Try + End Try + + If dt Is Nothing OrElse dt.Rows.Count = 0 Then Return + EnsureAnhangsartenOptionsLoaded() + flpDokumenteFehlenMain.Controls.Clear() + + For Each row As DataRow In dt.Rows + Dim id As Integer + Try + id = CInt(row("VermerkCodeId")) + Catch + Continue For + End Try + + Dim bezeichnung = If(IsDBNull(row("Bezeichnung")), "", CStr(row("Bezeichnung"))).Trim() + If bezeichnung = "" Then Continue For + _backendBezeichnungByCodeId(id) = bezeichnung + + Dim frontendBezeichnung = bezeichnung + If dt.Columns.Contains("FrontendBezeichnung") Then + frontendBezeichnung = If(IsDBNull(row("FrontendBezeichnung")), "", CStr(row("FrontendBezeichnung"))).Trim() + If frontendBezeichnung = "" Then frontendBezeichnung = bezeichnung + End If + + If bezeichnung.ToLowerInvariant().Contains("nicht leserlich") Then Continue For + + Dim bereich As Integer = 0 + Try + If Not IsDBNull(row("AnforderungBereich")) Then bereich = CInt(row("AnforderungBereich")) + Catch + End Try + _bereichByCodeId(id) = bereich + If bereich <> BereichDokumentMain Then Continue For + + Dim cb As New CheckBox() + cb.Text = frontendBezeichnung + cb.Tag = id + cb.Margin = New Padding(0, 0, 4, 0) + cb.BackColor = Color.Transparent + cb.UseVisualStyleBackColor = False + ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) + AddHandler cb.CheckedChanged, AddressOf DynamicAnforderungCheckboxChanged + flpDokumenteFehlenMain.Controls.Add(cb) + + Dim anhangsartId As Integer = 0 + Try + If Not IsDBNull(row("AvisoAnhangsartId")) Then anhangsartId = CInt(row("AvisoAnhangsartId")) + Catch + End Try + _anhangsartIdByCheckbox(cb) = anhangsartId + If Not _documentCustomNameByCodeId.ContainsKey(id) Then + _documentCustomNameByCodeId(id) = GetAnhangsartDisplayTextById(anhangsartId) + End If + + _anforderungCheckboxes.Add(cb) + Next + End Sub + + Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) + cb.AutoSize = False + cb.Height = 18 + Dim usableWidth = Math.Max(120, container.Width - 20) + Dim cbWidth = CInt(Math.Floor((usableWidth - 4) / 3)) + cb.Width = Math.Max(80, Math.Min(cbWidth, 220)) + End Sub + + Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) + If _isLoadingDocumentEditor OrElse _selectedDocumentCodeId <= 0 Then Return + _documentCustomNameByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorName.Text, "").Trim() + _documentBaseTextByCodeId(_selectedDocumentCodeId) = If(txtDocumentEditorInfo.Text, "").Trim() + + Dim tab = TryCast(flpDocumentTabs.Controls("tab_" & _selectedDocumentCodeId), Panel) + If tab Is Nothing Then Return + Dim lblText = TryCast(tab.Controls("lblText"), Label) + Dim lblClose = TryCast(tab.Controls("lblClose"), Label) + If lblText Is Nothing OrElse lblClose Is Nothing Then Return + lblText.Text = _documentCustomNameByCodeId(_selectedDocumentCodeId) + If lblText.Text = "" Then lblText.Text = "Unbenannt" + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + tab.Width = lblClose.Right + 5 + End Sub + + Private Sub DocumentEditorAnhangsartChanged(sender As Object, e As EventArgs) + If _isLoadingDocumentEditor OrElse _selectedDocumentCodeId <= 0 Then Return + Dim selected = TryCast(cmbDocumentEditorAnhangsart.SelectedItem, AnhangsartOption) + If selected Is Nothing Then Return + _selectedAnhangsartIdByCodeId(_selectedDocumentCodeId) = selected.Id + End Sub + + Private Sub EnsureAnhangsartenOptionsLoaded() + If _anhangsartenOptions.Count > 0 Then Return + Dim dt As DataTable = Nothing + Try + dt = AvisoDAL.loadDataTableBySQL("SELECT [aa_id],[aa_bezeichnung],[aa_name] FROM [tblAvisoAnhangsarten] WHERE [aa_aktiv]=1 ORDER BY [aa_sort],[aa_bezeichnung]") + Catch + Return + End Try + If dt Is Nothing Then Return + + For Each row As DataRow In dt.Rows + Dim id As Integer = 0 + Try + id = CInt(row("aa_id")) + Catch + Continue For + End Try + If id <= 0 Then Continue For + + Dim alreadyAdded As Boolean = False + For Each existing In _anhangsartenOptions + If existing.Id = id Then + alreadyAdded = True + Exit For + End If + Next + If alreadyAdded Then Continue For + + Dim text = If(IsDBNull(row("aa_bezeichnung")), "", CStr(row("aa_bezeichnung"))).Trim() + If text = "" Then text = If(IsDBNull(row("aa_name")), "", CStr(row("aa_name"))).Trim() + If text = "" Then text = "#" & id.ToString() + _anhangsartenOptions.Add(New AnhangsartOption(id, text)) + Next + End Sub + + Private Sub SelectAnhangsartInEditor(anhangsartId As Integer) + cmbDocumentEditorAnhangsart.SelectedIndex = -1 + If anhangsartId <= 0 Then Return + For i = 0 To cmbDocumentEditorAnhangsart.Items.Count - 1 + Dim optionItem = TryCast(cmbDocumentEditorAnhangsart.Items(i), AnhangsartOption) + If optionItem IsNot Nothing AndAlso optionItem.Id = anhangsartId Then + cmbDocumentEditorAnhangsart.SelectedIndex = i + Exit For + End If + Next + End Sub + + Private Function GetAnhangsartDisplayTextById(anhangsartId As Integer) As String + If anhangsartId <= 0 Then Return "" + EnsureAnhangsartenOptionsLoaded() + For Each optionItem In _anhangsartenOptions + If optionItem.Id = anhangsartId Then Return If(optionItem.Text, "").Trim() + Next + Return "" + End Function + + Private Function TryGetCheckboxCodeId(cb As CheckBox, ByRef codeId As Integer) As Boolean + codeId = 0 + If cb Is Nothing OrElse cb.Tag Is Nothing Then Return False + Return Integer.TryParse(cb.Tag.ToString(), codeId) AndAlso codeId > 0 + End Function + + Private Sub ClearDocumentEditor() + _selectedDocumentCodeId = 0 + _isLoadingDocumentEditor = True + txtDocumentEditorName.Text = "" + txtDocumentEditorInfo.Text = "" + cmbDocumentEditorAnhangsart.SelectedIndex = -1 + _isLoadingDocumentEditor = False + lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + End Sub + + Private Sub SelectDocument(codeId As Integer) + _selectedDocumentCodeId = codeId + If codeId <= 0 Then + ClearDocumentEditor() + SyncTabs() + Return + End If + + Dim targetCb As CheckBox = Nothing + For Each cb In _anforderungCheckboxes + If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then + targetCb = cb + Exit For + End If + Next + If targetCb Is Nothing Then Return + + Dim anhangsartId = GetEffectiveAnhangsartId(targetCb) + Dim customName = "" + If _documentCustomNameByCodeId.ContainsKey(codeId) Then + customName = If(_documentCustomNameByCodeId(codeId), "").Trim() + Else + customName = GetAnhangsartDisplayTextById(anhangsartId) + _documentCustomNameByCodeId(codeId) = customName + End If + Dim baseText = GetDocumentBaseTextByCodeId(codeId) + + _isLoadingDocumentEditor = True + txtDocumentEditorName.Text = customName + txtDocumentEditorInfo.Text = baseText + SelectAnhangsartInEditor(anhangsartId) + _isLoadingDocumentEditor = False + + If anhangsartId > 0 Then _selectedAnhangsartIdByCodeId(codeId) = anhangsartId + lblDocumentEditorStatus.ForeColor = Color.FromArgb(0, 102, 153) + lblDocumentEditorStatus.Text = "Ausgewählt: " & If(targetCb.Text, "").Trim() + SyncTabs() + End Sub + + Private Function CreateTab(codeId As Integer, text As String) As Panel + Dim pnl As New Panel() + pnl.Name = "tab_" & codeId + pnl.Tag = codeId + pnl.Height = 28 + pnl.BackColor = Color.White + pnl.BorderStyle = BorderStyle.FixedSingle + pnl.Margin = New Padding(2, 4, 2, 0) + pnl.Cursor = Cursors.Hand + + Dim lblText As New Label() + lblText.Name = "lblText" + lblText.Text = If(text = "", "Unbenannt", text) + lblText.AutoSize = True + lblText.Location = New Point(5, 5) + lblText.Tag = codeId + lblText.Cursor = Cursors.Hand + AddHandler lblText.Click, AddressOf Tab_Click + pnl.Controls.Add(lblText) + + Dim lblClose As New Label() + lblClose.Name = "lblClose" + lblClose.Text = "X" + lblClose.AutoSize = True + lblClose.ForeColor = Color.Red + lblClose.Font = New Font("Microsoft Sans Serif", 8.25!, FontStyle.Bold) + lblClose.Cursor = Cursors.Hand + lblClose.Tag = codeId + AddHandler lblClose.Click, AddressOf TabClose_Click + pnl.Controls.Add(lblClose) + + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + pnl.Width = lblClose.Right + 5 + + AddHandler pnl.Click, AddressOf Tab_Click + Return pnl + End Function + + Private Sub SyncTabs() + flpDocumentTabs.SuspendLayout() + Dim requiredCodeIds As New List(Of Integer) + For Each cb In _anforderungCheckboxes + If cb.Checked Then + Dim codeId As Integer = 0 + If Integer.TryParse(cb.Tag.ToString(), codeId) Then requiredCodeIds.Add(codeId) + End If + Next + + Dim i = flpDocumentTabs.Controls.Count - 1 + While i >= 0 + Dim pnl = TryCast(flpDocumentTabs.Controls(i), Panel) + If pnl IsNot Nothing Then + Dim codeId = CInt(pnl.Tag) + If Not requiredCodeIds.Contains(codeId) Then + flpDocumentTabs.Controls.RemoveAt(i) + pnl.Dispose() + End If + End If + i -= 1 + End While + + For Each codeId In requiredCodeIds + Dim existingTab = TryCast(flpDocumentTabs.Controls("tab_" & codeId), Panel) + Dim text = If(_documentCustomNameByCodeId.ContainsKey(codeId), _documentCustomNameByCodeId(codeId), "") + If existingTab Is Nothing Then + existingTab = CreateTab(codeId, text) + flpDocumentTabs.Controls.Add(existingTab) + Else + Dim lblText = TryCast(existingTab.Controls("lblText"), Label) + Dim lblClose = TryCast(existingTab.Controls("lblClose"), Label) + If lblText IsNot Nothing AndAlso lblClose IsNot Nothing Then + lblText.Text = If(text = "", "Unbenannt", text) + lblText.PerformLayout() + lblClose.Location = New Point(lblText.Right + 5, 5) + existingTab.Width = lblClose.Right + 5 + End If + End If + + If codeId = _selectedDocumentCodeId Then + existingTab.BackColor = Color.White + existingTab.BorderStyle = BorderStyle.FixedSingle + existingTab.Height = 28 + existingTab.Margin = New Padding(2, 2, 2, 0) + Else + existingTab.BackColor = Color.LightGray + existingTab.BorderStyle = BorderStyle.None + existingTab.Height = 25 + existingTab.Margin = New Padding(2, 5, 2, 0) + End If + Next + + flpDocumentTabs.ResumeLayout() + If _selectedDocumentCodeId > 0 AndAlso Not requiredCodeIds.Contains(_selectedDocumentCodeId) Then + If requiredCodeIds.Count > 0 Then + SelectDocument(requiredCodeIds(0)) + Else + ClearDocumentEditor() + End If + ElseIf _selectedDocumentCodeId = 0 AndAlso requiredCodeIds.Count > 0 Then + SelectDocument(requiredCodeIds(0)) + End If + End Sub + + Private Sub Tab_Click(sender As Object, e As EventArgs) + Dim ctrl = TryCast(sender, Control) + If ctrl Is Nothing OrElse ctrl.Tag Is Nothing Then Return + Dim codeId As Integer = 0 + If Integer.TryParse(ctrl.Tag.ToString(), codeId) Then SelectDocument(codeId) + End Sub + + Private Sub TabClose_Click(sender As Object, e As EventArgs) + Dim ctrl = TryCast(sender, Control) + If ctrl Is Nothing OrElse ctrl.Tag Is Nothing Then Return + Dim codeId As Integer = 0 + If Not Integer.TryParse(ctrl.Tag.ToString(), codeId) Then Return + For Each cb In _anforderungCheckboxes + If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString() = codeId.ToString() Then + cb.Checked = False + Exit For + End If + Next + End Sub + + Private Function GetEffectiveDocumentName(cb As CheckBox) As String + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) AndAlso _documentCustomNameByCodeId.ContainsKey(codeId) Then + Return If(_documentCustomNameByCodeId(codeId), "").Trim() + End If + Return "" + End Function + + Private Function GetDocumentBaseText(cb As CheckBox) As String + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) Then Return GetDocumentBaseTextByCodeId(codeId) + Return DefaultDocumentBaseText + End Function + + Private Function GetDocumentBaseTextByCodeId(codeId As Integer) As String + If codeId > 0 AndAlso _documentBaseTextByCodeId.ContainsKey(codeId) Then + Dim configuredBaseText = If(_documentBaseTextByCodeId(codeId), "").Trim() + If configuredBaseText <> "" Then Return configuredBaseText + End If + Return DefaultDocumentBaseText + End Function + + Private Function GetEffectiveAnhangsartId(cb As CheckBox) As Integer + Dim codeId As Integer = 0 + If TryGetCheckboxCodeId(cb, codeId) Then + If _selectedAnhangsartIdByCodeId.ContainsKey(codeId) AndAlso _selectedAnhangsartIdByCodeId(codeId) > 0 Then + Return _selectedAnhangsartIdByCodeId(codeId) + End If + End If + Dim defaultId As Integer = 0 + If _anhangsartIdByCheckbox.TryGetValue(cb, defaultId) Then Return defaultId + Return 0 + End Function + + Private Function BuildUploadCustomText(baseText As String) As String + Dim effectiveBaseText = If(baseText, "").Trim() + If effectiveBaseText = "" Then effectiveBaseText = DefaultDocumentBaseText + Return effectiveBaseText + End Function + + Private Function ValidateDocumentSelectionPayload(documentName As String, baseText As String, anhangsartId As Integer, ByRef validationError As String) As Boolean + validationError = "" + If anhangsartId <= 0 Then validationError = "ANHANGSART_ID_FEHLT" : Return False + documentName = If(documentName, "").Trim() + If documentName = "" Then validationError = "DOKUMENTNAME_FEHLT" : Return False + If documentName.Length > 120 Then validationError = "DOKUMENTNAME_ZU_LANG" : Return False + If If(baseText, "").Trim().Length > 500 Then validationError = "BASETEXT_ZU_LANG" : Return False + Return True + End Function + + Private Sub DynamicAnforderungCheckboxChanged(sender As Object, e As EventArgs) + Dim cb = TryCast(sender, CheckBox) + If cb Is Nothing Then Return + If cb.Checked Then + Dim codeId As Integer = 0 + If Integer.TryParse(cb.Tag.ToString(), codeId) Then SelectDocument(codeId) + Else + SyncTabs() + End If + End Sub + + Private Function HasPrimaryDokumentSelection() As Boolean + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb IsNot Nothing AndAlso cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then + If _bereichByCodeId.ContainsKey(codeId) AndAlso _bereichByCodeId(codeId) = BereichDokumentMain Then + Return True + End If + End If + Next + Return False + End Function + + Private Sub SonstChanged(sender As Object, e As EventArgs) Handles txtSonstigesDokumentFehlt.TextChanged + cbxSonstDok.Checked = (sender.text <> "") + End Sub + + Private Sub btnVermerkSetzen_Click(sender As Object, e As EventArgs) Handles btnVermerkSetzen.Click + lblErrDokument.Visible = False + If Not HasPrimaryDokumentSelection() AndAlso Not cbxSonstDok.Checked AndAlso Not cbxNichtLeserlich.Checked Then + lblErrDokument.Visible = True + Exit Sub + End If + If cbxSonstDok.Checked AndAlso txtSonstigesDokumentFehlt.Text.Trim = "" Then + lblErrDokument.Visible = True + txtSonstigesDokumentFehlt.Focus() + Exit Sub + End If + DialogResult = DialogResult.OK + Close() + End Sub + + Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click + Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) + Dim config = GetCustomerPortalApiConfig() + If config Is Nothing Then Exit Sub + + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then + MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) + Exit Sub + End If + + Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing + Dim anhangsartenErr = "" + If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then + MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) + Exit Sub + End If + + Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) + If requirements Is Nothing Then Exit Sub + If requirements.Count = 0 Then + MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) + Label20.ForeColor = Color.Red + Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." + Exit Sub + End If + Label20.ForeColor = Color.FromArgb(0, 102, 153) + Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + + Cursor = Cursors.WaitCursor + Try + Dim linkUrl = "" + Dim errorCode = "" + If Not TryCreateCustomerUploadLinkMultiWithoutEmail(config, requirements, validityHours, linkUrl, errorCode) Then + MsgBox("Fehler beim Erzeugen des Upload-Links: " & errorCode, vbExclamation) + Exit Sub + End If + If linkUrl <> "" Then + Clipboard.SetText(linkUrl) + MsgBox("Upload-Link wurde in die Zwischenablage kopiert.", vbInformation) + Else + MsgBox("Upload-Link konnte nicht aus der Antwort gelesen werden.", vbExclamation) + End If + Finally + Cursor = Cursors.Default + End Try + End Sub + + Private Sub btnCustomerUploadEmail_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadEmail.Click + Dim recipient = If(txtCustomerUploadEmail.Text, "").Trim() + If recipient = "" Then MsgBox("Bitte eine E-Mail-Adresse eingeben.", vbInformation) : txtCustomerUploadEmail.Focus() : Exit Sub + Try + Dim addr As New MailAddress(recipient) + recipient = addr.Address + Catch + MsgBox("E-Mail-Adresse ist ungültig.", vbInformation) + txtCustomerUploadEmail.Focus() + Exit Sub + End Try + + Dim emailText = If(txtCustomerUploadEmailText.Text, "").Trim() + If emailText = "" Then MsgBox("Bitte den Text eintragen.", vbInformation) : txtCustomerUploadEmailText.Focus() : Exit Sub + + Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) + Dim language = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) + language = language.ToLowerInvariant() + If language <> "de" AndAlso language <> "en" AndAlso language <> "tr" AndAlso language <> "sr" AndAlso language <> "bg" Then language = "de" + + Dim config = GetCustomerPortalApiConfig() + If config Is Nothing Then Exit Sub + + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then MsgBox("Fehler bei Authentifizierung: " & authErr, vbExclamation) : Exit Sub + + Dim anhangsartenMap As Dictionary(Of String, Integer) = Nothing + Dim anhangsartenErr = "" + If Not TryGetCustomerPortalAnhangsartenMap(config, jwtToken, anhangsartenMap, anhangsartenErr) Then MsgBox("Fehler beim Laden der Dokumentarten: " & anhangsartenErr, vbExclamation) : Exit Sub + + Dim requirements = BuildCustomerUploadRequirements(anhangsartenMap) + If requirements Is Nothing Then Exit Sub + If requirements.Count = 0 Then + MsgBox("Bitte mindestens ein Dokument im Bereich 'Dokument(e) fehlen' auswählen.", vbInformation) + Label20.ForeColor = Color.Red + Label20.Text = "Für den Upload-Link muss mindestens ein Dokument ausgewählt sein." + Exit Sub + End If + Label20.ForeColor = Color.FromArgb(0, 102, 153) + Label20.Text = "Bitte zuerst Dokument(e) oben auswählen." + + Cursor = Cursors.WaitCursor + Try + Dim linkUrl = "" + Dim errorCode = "" + If Not TryRequestCustomerUploadLinkMultiWithEmail(config, requirements, recipient, emailText, language, validityHours, linkUrl, errorCode) Then + MsgBox("Fehler beim Versand der E-Mail: " & errorCode, vbExclamation) + Exit Sub + End If + If linkUrl <> "" Then Clipboard.SetText(linkUrl) + MsgBox("E-Mail wurde ausgelöst.", vbInformation) + Finally + Cursor = Cursors.Default + End Try + End Sub + + Public Function BuildState() As DokumentanforderungState + Dim result As New DokumentanforderungState() + result.SelectedCodeIds = New List(Of Integer) + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + If cb.Checked AndAlso Integer.TryParse(If(cb.Tag, "").ToString(), codeId) Then result.SelectedCodeIds.Add(codeId) + Next + result.SelectedAnhangsartIdByCodeId = New Dictionary(Of Integer, Integer)(_selectedAnhangsartIdByCodeId) + result.DocumentCustomNameByCodeId = New Dictionary(Of Integer, String)(_documentCustomNameByCodeId) + result.DocumentBaseTextByCodeId = New Dictionary(Of Integer, String)(_documentBaseTextByCodeId) + result.SonstDokChecked = cbxSonstDok.Checked + result.SonstigesDokumentName = If(txtSonstigesDokumentFehlt.Text, "").Trim() + result.NichtLeserlichChecked = cbxNichtLeserlich.Checked + result.CustomerUploadEmail = If(txtCustomerUploadEmail.Text, "").Trim() + result.CustomerUploadLanguage = If(TryCast(cmbCustomerUploadLanguage.SelectedItem, String), If(cmbCustomerUploadLanguage.Text, "").Trim()) + result.CustomerUploadEmailText = If(txtCustomerUploadEmailText.Text, "").Trim() + result.CustomerUploadValidityHours = CInt(nudCustomerUploadValidityHours.Value) + Return result + End Function + + Private Sub ApplyStateToUi(state As DokumentanforderungState) + If state Is Nothing Then Return + _selectedAnhangsartIdByCodeId.Clear() + _documentCustomNameByCodeId.Clear() + _documentBaseTextByCodeId.Clear() + For Each kvp In state.SelectedAnhangsartIdByCodeId + _selectedAnhangsartIdByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentCustomNameByCodeId + _documentCustomNameByCodeId(kvp.Key) = kvp.Value + Next + For Each kvp In state.DocumentBaseTextByCodeId + _documentBaseTextByCodeId(kvp.Key) = kvp.Value + Next + + For Each cb In _anforderungCheckboxes + Dim codeId As Integer = 0 + cb.Checked = Integer.TryParse(If(cb.Tag, "").ToString(), codeId) AndAlso state.SelectedCodeIds.Contains(codeId) + Next + + cbxSonstDok.Checked = state.SonstDokChecked + txtSonstigesDokumentFehlt.Text = If(state.SonstigesDokumentName, "") + cbxNichtLeserlich.Checked = state.NichtLeserlichChecked + txtCustomerUploadEmail.Text = If(state.CustomerUploadEmail, "") + txtCustomerUploadEmailText.Text = If(state.CustomerUploadEmailText, "Bitte laden Sie die angeforderten Dokumente über den Link hoch.") + nudCustomerUploadValidityHours.Value = Math.Max(nudCustomerUploadValidityHours.Minimum, Math.Min(nudCustomerUploadValidityHours.Maximum, state.CustomerUploadValidityHours)) + + Dim language = If(state.CustomerUploadLanguage, "").Trim().ToLowerInvariant() + Dim idx = cmbCustomerUploadLanguage.Items.IndexOf(language) + If idx >= 0 Then cmbCustomerUploadLanguage.SelectedIndex = idx + SyncTabs() + End Sub + + Private Class CustomerPortalApiConfig + Public Property BaseUrl As String + Public Property Username As String + Public Property Password As String + End Class + + Private Function GetCustomerPortalApiConfig() As CustomerPortalApiConfig + Dim baseUrl = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_BASEURL"), "").Trim() + If baseUrl = "" Then baseUrl = If(ConfigurationManager.AppSettings("CustomerPortalApiBaseUrl"), "").Trim() + If baseUrl = "" Then baseUrl = "https://login.server.verag.ag" + Dim username = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_USERNAME"), "").Trim() + If username = "" Then username = If(ConfigurationManager.AppSettings("CustomerPortalApiUsername"), "").Trim() + Dim password = If(System.Environment.GetEnvironmentVariable("AVISO_CUSTOMERPORTAL_API_PASSWORD"), "").Trim() + If password = "" Then password = If(ConfigurationManager.AppSettings("CustomerPortalApiPassword"), "").Trim() + If username = "" OrElse password = "" Then + MsgBox("CustomerPortalApiUsername/CustomerPortalApiPassword fehlt in App.config (oder ENV: AVISO_CUSTOMERPORTAL_API_USERNAME / AVISO_CUSTOMERPORTAL_API_PASSWORD).", vbExclamation) + Return Nothing + End If + Return New CustomerPortalApiConfig With {.BaseUrl = baseUrl, .Username = username, .Password = password} + End Function + + Private Function TryGetCustomerPortalJwtToken(ByVal config As CustomerPortalApiConfig, ByRef jwtToken As String, ByRef errorCode As String) As Boolean + jwtToken = "" + errorCode = "" + If _customerPortalJwtToken <> "" Then + If _customerPortalJwtExpUtc = DateTime.MinValue OrElse DateTime.UtcNow < _customerPortalJwtExpUtc.AddMinutes(-1) Then + jwtToken = _customerPortalJwtToken + Return True + End If + End If + + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/auth/login" + Dim payload As New Dictionary(Of String, Object) From {{"username", config.Username}, {"password", config.Password}} + Dim jsonBody = JsonConvert.SerializeObject(payload) + Try + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "POST" + request.ContentType = "application/json" + request.Accept = "application/json" + request.Timeout = 15000 + Using requestStream = request.GetRequestStream() + Using writer As New StreamWriter(requestStream, Encoding.UTF8) + writer.Write(jsonBody) + End Using + End Using + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = reader.ReadToEnd() + Dim jobj = JObject.Parse(respText) + Dim token = (If(jobj("token"), New JValue(""))).ToString().Trim() + If token = "" Then errorCode = "TOKEN_MISSING" : Return False + _customerPortalJwtToken = token + _customerPortalJwtExpUtc = ExtractJwtExpUtcOrMin(token) + jwtToken = token + Return True + End Using + End Using + Catch ex As WebException + errorCode = ReadWebExceptionMessage(ex) + Return False + Catch ex As Exception + errorCode = ex.Message + Return False + End Try + End Function + + Private Function ExtractJwtExpUtcOrMin(ByVal jwt As String) As DateTime + Try + Dim parts = If(jwt, "").Split("."c) + If parts.Length < 2 Then Return DateTime.MinValue + Dim payloadJson = Encoding.UTF8.GetString(Base64UrlDecode(parts(1))) + Dim jobj = JObject.Parse(payloadJson) + Dim expToken = jobj("exp") + If expToken Is Nothing Then Return DateTime.MinValue + Dim expSeconds As Long + If Long.TryParse(expToken.ToString(), expSeconds) Then Return DateTimeOffset.FromUnixTimeSeconds(expSeconds).UtcDateTime + Catch + End Try + Return DateTime.MinValue + End Function + + Private Function Base64UrlDecode(ByVal input As String) As Byte() + Dim s = If(input, "").Replace("-"c, "+"c).Replace("_"c, "/"c) + Select Case (s.Length Mod 4) + Case 2 + s &= "==" + Case 3 + s &= "=" + End Select + Return Convert.FromBase64String(s) + End Function + + Private Function BuildCustomerUploadRequirements(ByVal anhangsartenMap As Dictionary(Of String, Integer)) As List(Of Object) + Dim requirements As New List(Of Object) + Dim missing As New List(Of String) + + For Each cb In _anforderungCheckboxes + If cb Is Nothing OrElse Not cb.Checked Then Continue For + Dim documentType = GetEffectiveDocumentName(cb) + If documentType = "" Then Continue For + Dim baseText = GetDocumentBaseText(cb) + Dim validationError = "" + Dim anhangsartId = GetEffectiveAnhangsartId(cb) + If anhangsartId <= 0 Then missing.Add(documentType) : Continue For + If Not ValidateDocumentSelectionPayload(documentType, baseText, anhangsartId, validationError) Then + MsgBox("Ungültige Eingabe für Dokument '" & documentType & "': " & validationError, vbInformation) + Return Nothing + End If + AddCustomerUploadRequirementByAnhangsartId(requirements, documentType, anhangsartId, BuildUploadCustomText(baseText)) + Next + + If cbxSonstDok.Checked Then + Dim custom = If(txtSonstigesDokumentFehlt.Text, "").Trim() + If custom = "" Then + MsgBox("Bitte den Dokumentnamen eintragen.", vbInformation) + txtSonstigesDokumentFehlt.Focus() + Return Nothing + End If + AddCustomerUploadRequirement(requirements, missing, anhangsartenMap, True, custom, {"SONSTIGES", "DOKUMENT"}, "Bitte " & custom & " hochladen.", True) + End If + + If missing.Count > 0 Then + MsgBox("Anhangsarten nicht gefunden: " & String.Join(", ", missing), vbExclamation) + Return Nothing + End If + Return requirements + End Function + + Private Sub AddCustomerUploadRequirementByAnhangsartId(ByVal requirements As List(Of Object), ByVal documentType As String, ByVal anhangsartId As Integer, ByVal customText As String) + If requirements Is Nothing OrElse anhangsartId <= 0 Then Exit Sub + requirements.Add(New Dictionary(Of String, Object) From {{"documentType", documentType}, {"anhangsartId", anhangsartId}, {"customText", customText}}) + End Sub + + Private Sub AddCustomerUploadRequirement(ByVal requirements As List(Of Object), ByVal missing As List(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer), ByVal isSelected As Boolean, ByVal documentType As String, ByVal anhangsartenCandidates As String(), ByVal customText As String, ByVal allowCustomFilename As Boolean) + If Not isSelected Then Exit Sub + Dim anhangsartId = ResolveAnhangsartId(anhangsartenCandidates, anhangsartenMap) + If anhangsartId <= 0 AndAlso allowCustomFilename AndAlso _customerPortalCustomFilenameAnhangsartId > 0 Then anhangsartId = _customerPortalCustomFilenameAnhangsartId + If anhangsartId <= 0 Then missing.Add(documentType) : Exit Sub + requirements.Add(New Dictionary(Of String, Object) From {{"documentType", documentType}, {"anhangsartId", anhangsartId}, {"customText", customText}}) + End Sub + + Private Function ResolveAnhangsartId(ByVal candidates As IEnumerable(Of String), ByVal anhangsartenMap As Dictionary(Of String, Integer)) As Integer + If candidates Is Nothing OrElse anhangsartenMap Is Nothing Then Return -1 + For Each c In candidates + Dim key = If(c, "").Trim() + If key = "" Then Continue For + Dim id As Integer + If anhangsartenMap.TryGetValue(key.ToUpperInvariant(), id) Then Return id + Next + Return -1 + End Function + + Private Function TryGetCustomerPortalAnhangsartenMap(ByVal config As CustomerPortalApiConfig, ByVal jwtToken As String, ByRef anhangsartenMap As Dictionary(Of String, Integer), ByRef errorCode As String) As Boolean + anhangsartenMap = Nothing + errorCode = "" + If _customerPortalAnhangsartenMap IsNot Nothing AndAlso _customerPortalAnhangsartenFetchedUtc <> DateTime.MinValue Then + If DateTime.UtcNow < _customerPortalAnhangsartenFetchedUtc.AddMinutes(30) Then + anhangsartenMap = _customerPortalAnhangsartenMap + Return True + End If + End If + + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/AvisoUpload/anhangsarten/all" + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "GET" + request.Accept = "application/json" + request.Timeout = 15000 + request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken + Try + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = If(reader.ReadToEnd(), "").Trim() + Dim map As New Dictionary(Of String, Integer)(StringComparer.OrdinalIgnoreCase) + Dim customFilenameId As Integer = -1 + If respText.StartsWith("[") Then + Dim arr = JArray.Parse(respText) + For Each t In arr + Dim id = 0 + If t("id") IsNot Nothing AndAlso Integer.TryParse(t("id").ToString(), id) Then + Dim name = (If(t("name"), New JValue(""))).ToString().Trim() + Dim bez = (If(t("bezeichnung"), New JValue(""))).ToString().Trim() + If name <> "" Then map(name.ToUpperInvariant()) = id + If bez <> "" Then map(bez.ToUpperInvariant()) = id + If id = 24 Then customFilenameId = 24 + End If + Next + ElseIf respText.StartsWith("{") Then + Dim jobj = JObject.Parse(respText) + errorCode = (If(jobj("message"), If(jobj("code"), New JValue("ANHANGSARTEN_LOAD_FAILED")))).ToString() + Return False + Else + errorCode = "ANHANGSARTEN_INVALID_RESPONSE" + Return False + End If + If map.Count = 0 Then errorCode = "ANHANGSARTEN_EMPTY" : Return False + _customerPortalCustomFilenameAnhangsartId = customFilenameId + _customerPortalAnhangsartenMap = map + _customerPortalAnhangsartenFetchedUtc = DateTime.UtcNow + anhangsartenMap = map + Return True + End Using + End Using + Catch ex As WebException + errorCode = ReadWebExceptionMessage(ex) + Return False + Catch ex As Exception + errorCode = ex.Message + Return False + End Try + End Function + + Private Function TryCreateCustomerUploadLinkMultiWithoutEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + linkUrl = "" + errorCode = "" + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/create-upload-link-multi" + Dim payload As New Dictionary(Of String, Object) From {{"avisoId", AvisoID}, {"validityHours", validityHours}, {"requirements", requirements}} + If SendungID > 0 Then payload("sendungsId") = SendungID + Dim jsonBody = JsonConvert.SerializeObject(payload) + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then errorCode = authErr : Return False + Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) + End Function + + Private Function TryRequestCustomerUploadLinkMultiWithEmail(ByVal config As CustomerPortalApiConfig, ByVal requirements As List(Of Object), ByVal recipientEmail As String, ByVal emailText As String, ByVal language As String, ByVal validityHours As Integer, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + linkUrl = "" + errorCode = "" + Dim url = config.BaseUrl.TrimEnd("/"c) & "/api/PublicCustomerDocuments/request-upload-link-multi" + If language Is Nothing OrElse language.Trim() = "" Then language = "de" + Dim payload As New Dictionary(Of String, Object) From {{"avisoId", AvisoID}, {"emailText", emailText}, {"language", language}, {"validityHours", validityHours}, {"requirements", requirements}} + If SendungID > 0 Then payload("sendungsId") = SendungID + payload("recipientEmail") = recipientEmail + Dim jsonBody = JsonConvert.SerializeObject(payload) + Dim jwtToken = "" + Dim authErr = "" + If Not TryGetCustomerPortalJwtToken(config, jwtToken, authErr) Then errorCode = authErr : Return False + Return TryPostCustomerPortalJson(url, jwtToken, jsonBody, linkUrl, errorCode) + End Function + + Private Function TryPostCustomerPortalJson(ByVal url As String, ByVal jwtToken As String, ByVal jsonBody As String, ByRef linkUrl As String, ByRef errorCode As String) As Boolean + Dim request = CType(WebRequest.Create(url), HttpWebRequest) + request.Method = "POST" + request.ContentType = "application/json" + request.Accept = "application/json" + request.Timeout = 15000 + request.Headers(HttpRequestHeader.Authorization) = "Bearer " & jwtToken + Using requestStream = request.GetRequestStream() + Using writer As New StreamWriter(requestStream, Encoding.UTF8) + writer.Write(jsonBody) + End Using + End Using + Using response = CType(request.GetResponse(), HttpWebResponse) + Using reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8) + Dim respText = reader.ReadToEnd() + Dim jobj = JObject.Parse(respText) + Dim result = (If(jobj("result"), New JValue(""))).ToString() + If String.Equals(result, "pass", StringComparison.OrdinalIgnoreCase) Then + Dim link = (If(jobj.SelectToken("data.linkUrl"), New JValue(""))).ToString() + If link = "" Then link = (If(jobj.SelectToken("linkUrl"), New JValue(""))).ToString() + linkUrl = link + Return True + End If + errorCode = (If(jobj("message"), New JValue("UNKNOWN_ERROR"))).ToString() + Return False + End Using + End Using + End Function + + Private Function ReadWebExceptionMessage(ByVal ex As WebException) As String + Dim body = "" + Try + If ex.Response IsNot Nothing Then + Using respStream = ex.Response.GetResponseStream() + If respStream IsNot Nothing Then + Using reader As New StreamReader(respStream, Encoding.UTF8) + body = reader.ReadToEnd() + End Using + End If + End Using + End If + Catch + End Try + If body <> "" Then + Try + Dim jobj = JObject.Parse(body) + Return (If(jobj("message"), New JValue(ex.Message))).ToString() + Catch + Return ex.Message + End Try + End If + Return ex.Message + End Function + + Private Class AnhangsartOption + Public ReadOnly Id As Integer + Public ReadOnly Text As String + Public Sub New(id As Integer, text As String) + Me.Id = id + Me.Text = If(text, "").Trim() + End Sub + Public Overrides Function ToString() As String + Return Text + End Function + End Class + + Private Class KontaktEmailRow + Public Property Rolle As String + Public Property Art As String + Public Property Firma As String + Public Property Email As String + End Class + + Public Class DokumentanforderungState + Public Property SelectedCodeIds As New List(Of Integer) + Public Property SelectedAnhangsartIdByCodeId As New Dictionary(Of Integer, Integer) + Public Property DocumentCustomNameByCodeId As New Dictionary(Of Integer, String) + Public Property DocumentBaseTextByCodeId As New Dictionary(Of Integer, String) + Public Property SonstDokChecked As Boolean + Public Property SonstigesDokumentName As String + Public Property NichtLeserlichChecked As Boolean + Public Property CustomerUploadEmail As String + Public Property CustomerUploadLanguage As String = "de" + Public Property CustomerUploadEmailText As String = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + Public Property CustomerUploadValidityHours As Integer = 168 + End Class +End Class From 8cc3bd99066bedc95e04a5cbbbdeecc9d3522546 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Tue, 24 Mar 2026 13:41:36 +0100 Subject: [PATCH 07/15] vermerke --- Aviso/Aviso.vbproj | 2 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 436 +++++- Aviso/frmAddSendungsvermerkShort.vb | 1406 +++++++++++++++++- Aviso/frmSendungsDokumentanforderung.vb | 269 ++-- 5 files changed, 1865 insertions(+), 252 deletions(-) diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 6491167..57e86fa 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -2239,4 +2239,4 @@ --> - \ No newline at end of file + diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 5d87ae2..e8298a3 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmAddSendungsvermerkShort.Designer.vb b/Aviso/frmAddSendungsvermerkShort.Designer.vb index 9e37c70..3dfc1f0 100644 --- a/Aviso/frmAddSendungsvermerkShort.Designer.vb +++ b/Aviso/frmAddSendungsvermerkShort.Designer.vb @@ -27,7 +27,22 @@ 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() @@ -45,18 +60,35 @@ 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() ' @@ -72,14 +104,20 @@ 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, 400) + Me.pnlMain.Size = New System.Drawing.Size(474, 790) Me.pnlMain.TabIndex = 0 ' 'pnlSendungsVermker ' Me.pnlSendungsVermker.BackColor = System.Drawing.Color.White Me.pnlSendungsVermker.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) + Me.pnlSendungsVermker.Controls.Add(Me.pnlDocumentEditor) + Me.pnlSendungsVermker.Controls.Add(Me.flpDokumenteFehlenMain) + Me.pnlSendungsVermker.Controls.Add(Me.lblSonstigeVermerke) Me.pnlSendungsVermker.Controls.Add(Me.flpAngefordert) + Me.pnlSendungsVermker.Controls.Add(Me.Label5) + Me.pnlSendungsVermker.Controls.Add(Me.txtSonstigesDokumentFehlt) Me.pnlSendungsVermker.Controls.Add(Me.Label4) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_ATB) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_SendungAvisiert) @@ -97,37 +135,208 @@ 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, 400) + Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 750) Me.pnlSendungsVermker.TabIndex = 0 ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke + Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.PictureBox1.Location = New System.Drawing.Point(0, 391) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(474, 1) + Me.PictureBox1.TabIndex = 124 + Me.PictureBox1.TabStop = False + ' + 'pnlDocumentEditor + ' + Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke + Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 135) + Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.TabIndex = 123 + ' + 'flpDocumentTabs + ' + Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDocumentTabs.AutoScroll = True + Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) + Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) + Me.flpDocumentTabs.Name = "flpDocumentTabs" + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) + Me.flpDocumentTabs.TabIndex = 124 + Me.flpDocumentTabs.WrapContents = False + ' + 'lblDocumentEditorTitle + ' + Me.lblDocumentEditorTitle.AutoSize = True + Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) + Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" + Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) + Me.lblDocumentEditorTitle.TabIndex = 125 + Me.lblDocumentEditorTitle.Text = "Dokumentdetails" + ' + 'lblDocumentEditorName + ' + Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Name = "lblDocumentEditorName" + Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) + Me.lblDocumentEditorName.TabIndex = 126 + Me.lblDocumentEditorName.Text = "Dokumentname:" + ' + 'txtDocumentEditorName + ' + Me.txtDocumentEditorName.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.MaxLength = 120 + Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.TabIndex = 127 + ' + 'lblDocumentEditorAnhangsart + ' + Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" + Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) + Me.lblDocumentEditorAnhangsart.TabIndex = 128 + Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" + ' + 'cmbDocumentEditorAnhangsart + ' + Me.cmbDocumentEditorAnhangsart.BackColor = System.Drawing.Color.White + Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.TabIndex = 129 + ' + 'lblDocumentEditorInfo + ' + Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" + Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) + Me.lblDocumentEditorInfo.TabIndex = 130 + Me.lblDocumentEditorInfo.Text = "Dokument Info:" + ' + 'txtDocumentEditorInfo + ' + Me.txtDocumentEditorInfo.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.MaxLength = 500 + Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.TabIndex = 131 + Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." + ' + 'lblDocumentEditorStatus + ' + Me.lblDocumentEditorStatus.AutoSize = True + Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) + Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" + Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) + Me.lblDocumentEditorStatus.TabIndex = 119 + Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + ' + 'flpDokumenteFehlenMain + ' + Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent + Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 23) + Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) + Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.TabIndex = 120 + ' + 'lblSonstigeVermerke + ' + Me.lblSonstigeVermerke.AutoSize = True + Me.lblSonstigeVermerke.BackColor = System.Drawing.Color.White + Me.lblSonstigeVermerke.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold) + Me.lblSonstigeVermerke.Location = New System.Drawing.Point(5, 393) + Me.lblSonstigeVermerke.Name = "lblSonstigeVermerke" + Me.lblSonstigeVermerke.Size = New System.Drawing.Size(150, 17) + Me.lblSonstigeVermerke.TabIndex = 121 + Me.lblSonstigeVermerke.Text = "Sonstige Vermerke:" + ' 'flpAngefordert ' Me.flpAngefordert.BackColor = System.Drawing.Color.White Me.flpAngefordert.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpAngefordert.Location = New System.Drawing.Point(12, 50) + Me.flpAngefordert.Location = New System.Drawing.Point(12, 414) Me.flpAngefordert.Margin = New System.Windows.Forms.Padding(0) Me.flpAngefordert.Name = "flpAngefordert" Me.flpAngefordert.Size = New System.Drawing.Size(450, 131) Me.flpAngefordert.TabIndex = 122 ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.BackColor = System.Drawing.Color.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, 268) + Me.Label4.Location = New System.Drawing.Point(12, 625) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(125, 17) Me.Label4.TabIndex = 96 @@ -137,7 +346,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_ATB.AutoSize = True Me.optFremd_ATB.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_ATB.Location = New System.Drawing.Point(13, 303) + Me.optFremd_ATB.Location = New System.Drawing.Point(13, 660) Me.optFremd_ATB.Name = "optFremd_ATB" Me.optFremd_ATB.Size = New System.Drawing.Size(130, 17) Me.optFremd_ATB.TabIndex = 94 @@ -148,7 +357,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_SendungAvisiert.AutoSize = True Me.optFremd_SendungAvisiert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 286) + Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 643) Me.optFremd_SendungAvisiert.Name = "optFremd_SendungAvisiert" Me.optFremd_SendungAvisiert.Size = New System.Drawing.Size(193, 17) Me.optFremd_SendungAvisiert.TabIndex = 93 @@ -160,7 +369,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, 194) + Me.lblErrSpedition.Location = New System.Drawing.Point(177, 551) Me.lblErrSpedition.Name = "lblErrSpedition" Me.lblErrSpedition.Size = New System.Drawing.Size(158, 13) Me.lblErrSpedition.TabIndex = 17 @@ -185,7 +394,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, 205) + Me.Label2.Location = New System.Drawing.Point(176, 562) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(57, 13) Me.Label2.TabIndex = 84 @@ -196,7 +405,7 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrGrund.AutoSize = True Me.lblErrGrund.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrGrund.ForeColor = System.Drawing.Color.Red - Me.lblErrGrund.Location = New System.Drawing.Point(148, 257) + Me.lblErrGrund.Location = New System.Drawing.Point(148, 614) Me.lblErrGrund.Name = "lblErrGrund" Me.lblErrGrund.Size = New System.Drawing.Size(149, 13) Me.lblErrGrund.TabIndex = 26 @@ -235,7 +444,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, 215) + Me.txtSpedition.Location = New System.Drawing.Point(178, 572) Me.txtSpedition.MaxLength = 50 Me.txtSpedition.Name = "txtSpedition" Me.txtSpedition.Size = New System.Drawing.Size(126, 20) @@ -256,7 +465,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optSpeditionWeitergeleitet.AutoSize = True Me.optSpeditionWeitergeleitet.BackColor = System.Drawing.Color.WhiteSmoke - Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 215) + Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 572) Me.optSpeditionWeitergeleitet.Name = "optSpeditionWeitergeleitet" Me.optSpeditionWeitergeleitet.Size = New System.Drawing.Size(163, 17) Me.optSpeditionWeitergeleitet.TabIndex = 19 @@ -267,7 +476,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFreierText.AutoSize = True Me.optFreierText.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFreierText.Location = New System.Drawing.Point(13, 232) + Me.optFreierText.Location = New System.Drawing.Point(13, 589) Me.optFreierText.Name = "optFreierText" Me.optFreierText.Size = New System.Drawing.Size(105, 17) Me.optFreierText.TabIndex = 27 @@ -278,7 +487,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optATAangefordert.AutoSize = True Me.optATAangefordert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optATAangefordert.Location = New System.Drawing.Point(165, 303) + Me.optATAangefordert.Location = New System.Drawing.Point(165, 660) Me.optATAangefordert.Name = "optATAangefordert" Me.optATAangefordert.Size = New System.Drawing.Size(208, 17) Me.optATAangefordert.TabIndex = 15 @@ -289,7 +498,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.Label3.AutoSize = True Me.Label3.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label3.Location = New System.Drawing.Point(309, 216) + Me.Label3.Location = New System.Drawing.Point(309, 573) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(57, 13) Me.Label3.TabIndex = 22 @@ -299,7 +508,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.lblErr240Zeichen.AutoSize = True Me.lblErr240Zeichen.ForeColor = System.Drawing.Color.Red - Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 332) + Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 689) Me.lblErr240Zeichen.Name = "lblErr240Zeichen" Me.lblErr240Zeichen.Size = New System.Drawing.Size(95, 13) Me.lblErr240Zeichen.TabIndex = 32 @@ -311,7 +520,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, 348) + Me.txtDetail.Location = New System.Drawing.Point(17, 705) Me.txtDetail.MaxLength = 240 Me.txtDetail.Multiline = True Me.txtDetail.Name = "txtDetail" @@ -321,10 +530,109 @@ 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, 331) + Me.lblZustzlFreitext.Location = New System.Drawing.Point(14, 688) Me.lblZustzlFreitext.Name = "lblZustzlFreitext" Me.lblZustzlFreitext.Size = New System.Drawing.Size(142, 13) Me.lblZustzlFreitext.TabIndex = 31 @@ -334,17 +642,28 @@ 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, 234) + Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 591) 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, 348) + Me.btnOK.Location = New System.Drawing.Point(325, 705) Me.btnOK.Name = "btnOK" Me.btnOK.Size = New System.Drawing.Size(125, 41) Me.btnOK.TabIndex = 34 @@ -361,12 +680,23 @@ 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, 257) + Me.Label9.Location = New System.Drawing.Point(355, 614) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(90, 13) Me.Label9.TabIndex = 30 @@ -377,7 +707,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label17.AutoSize = True Me.Label17.BackColor = System.Drawing.Color.WhiteSmoke Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Italic) - Me.Label17.Location = New System.Drawing.Point(145, 257) + Me.Label17.Location = New System.Drawing.Point(145, 614) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(182, 13) Me.Label17.TabIndex = 29 @@ -388,7 +718,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label13.AutoSize = True Me.Label13.BackColor = System.Drawing.Color.WhiteSmoke Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label13.Location = New System.Drawing.Point(10, 196) + Me.Label13.Location = New System.Drawing.Point(10, 553) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(84, 17) Me.Label13.TabIndex = 16 @@ -398,22 +728,45 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtFreierText.BackColor = System.Drawing.Color.WhiteSmoke Me.txtFreierText.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtFreierText.Location = New System.Drawing.Point(123, 230) + Me.txtFreierText.Location = New System.Drawing.Point(123, 587) 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, 190) + Me.PictureBox4.Location = New System.Drawing.Point(-1, 547) 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 @@ -428,7 +781,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 400) + Me.ClientSize = New System.Drawing.Size(474, 750) Me.Controls.Add(Me.pnlMain) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) @@ -440,6 +793,10 @@ 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) @@ -448,6 +805,7 @@ 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 @@ -455,8 +813,10 @@ 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 @@ -464,9 +824,12 @@ 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 @@ -474,5 +837,28 @@ 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 fd6c042..2dc1600 100644 --- a/Aviso/frmAddSendungsvermerkShort.vb +++ b/Aviso/frmAddSendungsvermerkShort.vb @@ -1,4 +1,4 @@ - + Imports System.Configuration Imports System.IO Imports System.Net @@ -15,15 +15,26 @@ 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 @@ -40,7 +51,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() @@ -80,6 +91,19 @@ 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 @@ -93,6 +117,10 @@ 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 @@ -103,9 +131,6 @@ 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 & "" @@ -128,21 +153,52 @@ 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 - ' Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click - ' Me.Close() - ' End Sub + If txtDocumentEditorInfo IsNot Nothing Then + RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + End If + + EnsureAnhangsartenOptionsLoaded() + + If cmbDocumentEditorAnhangsart IsNot Nothing Then + RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + cmbDocumentEditorAnhangsart.BeginUpdate() + cmbDocumentEditorAnhangsart.Items.Clear() + For Each optionItem In _anhangsartenOptions + cmbDocumentEditorAnhangsart.Items.Add(optionItem) + Next + cmbDocumentEditorAnhangsart.EndUpdate() + AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + End If + + ClearDocumentEditor() + End Sub Private Sub SetupDynamicAnforderungCheckboxes() _anforderungCheckboxes.Clear() + _anhangsartIdByCheckbox.Clear() _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],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Try - dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Return End Try @@ -151,7 +207,9 @@ 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 @@ -172,6 +230,28 @@ 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 @@ -179,18 +259,25 @@ Public Class frmAddSendungsvermerkShort End If Catch End Try + _bereichByCodeId(id) = bereich - If bereich = BereichAngefordert Then - Dim cb As New CheckBox() - cb.Text = frontendBezeichnung - cb.Tag = id - cb.Margin = New Padding(0, 0, 4, 0) - + If bereich = BereichDokumentMain Then + cb.BackColor = Color.Transparent + cb.UseVisualStyleBackColor = False + ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) + flpDokumenteFehlenMain.Controls.Add(cb) + Else 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) @@ -201,13 +288,623 @@ Public Class frmAddSendungsvermerkShort Dim cols As Integer = 2 Dim colGap As Integer = 14 - Dim minCbWidth As Integer = 180 + 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 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 @@ -234,7 +931,8 @@ 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) @@ -245,31 +943,42 @@ Public Class frmAddSendungsvermerkShort End If For Each cb In _anforderungCheckboxes - 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() + If cb Is Nothing OrElse Not cb.Checked Then Continue For - Dim sendText = txtSendung.Text.Trim() - If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then - text &= " bei Sendung '" & sendText & "'" - End If + Dim codeId As Integer + Try + codeId = CInt(cb.Tag) + Catch + Continue For + End Try - If text <> "" Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) - End If - End If + 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) 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) @@ -348,6 +1057,7 @@ Public Class frmAddSendungsvermerkShort End Sub Sub showErr(l As Label) + lblErrDokument.Visible = False ' lblErrFach.Visible = False lblErrGrund.Visible = False ' lblErrSendungProbleme.Visible = False @@ -371,11 +1081,12 @@ Public Class frmAddSendungsvermerkShort ' optDokumente.Checked = True 'End Sub - Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) + Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) Handles cbxSonstDok.CheckedChanged, cbxNichtLeserlich.CheckedChanged ' optDokumente.Checked = True End Sub - Private Sub SonstChanged(sender As Object, e As EventArgs) + Private Sub SonstChanged(sender As Object, e As EventArgs) Handles txtSonstigesDokumentFehlt.TextChanged ' 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 @@ -400,6 +1111,8 @@ Public Class frmAddSendungsvermerkShort txtSendung.SelectionLength = 0 txtFreierText.Focus() End Sub + + ' --- Dragging Logic --- Private drag As Boolean Private mouseX As Integer Private mouseY As Integer @@ -429,15 +1142,15 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub btnDokumtanforderung_Click(sender As Object, e As EventArgs) Handles btnDokumtanforderung.Click - 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) + _dokumentanforderungState = BuildDokumentanforderungState() + Using frm As New frmSendungsDokumentanforderung(AvisoID, SendungID, _dokumentanforderungState) If frm.ShowDialog(Me) = DialogResult.OK Then - frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) - Me.Close() + _dokumentanforderungState = frm.BuildState() + ApplyDokumentanforderungState(_dokumentanforderungState) + If InsertNurDokumentVermerk() Then + frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) + Me.Close() + End If End If End Using End Sub @@ -450,4 +1163,601 @@ 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 1277d14..0288998 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -33,13 +33,11 @@ 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(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) + Public Sub New(avisoId As Integer, sendungId As Integer, state As DokumentanforderungState) InitializeComponent() - AvisoID = avisoIdValue - SendungID = sendungIdValue + AvisoID = avisoId + SendungID = sendungId Icon = cMeineFunktionenAVISO.GetProgrammIcon _stateToApply = If(state, New DokumentanforderungState()) End Sub @@ -47,7 +45,6 @@ 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") @@ -65,25 +62,17 @@ 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" @@ -91,13 +80,6 @@ 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" @@ -111,7 +93,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 @@ -133,11 +115,12 @@ Public Class frmSendungsDokumentanforderung End If If AvisoID > 0 Then - Dim aviso = AvisoDAL.LesenAviso(AvisoID, "") - If aviso IsNot Nothing Then - fraechterKdNr = ToIntSafe(aviso.Frächter_KdNr) + Dim dtAviso = AvisoDAL.loadDataTableBySQL("SELECT Frächter_KdNr, Auftraggeber_KdNr FROM tblAviso WHERE AvisoID = " & AvisoID) + If dtAviso IsNot Nothing AndAlso dtAviso.Rows.Count > 0 Then + Dim r = dtAviso.Rows(0) + fraechterKdNr = ToIntSafe(r("Frächter_KdNr")) If auftraggeberKdNr = 0 Then - auftraggeberKdNr = ToIntSafe(aviso.Auftraggeber_KdNr) + auftraggeberKdNr = ToIntSafe(r("Auftraggeber_KdNr")) End If End If End If @@ -151,111 +134,82 @@ 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 - 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) + dgvKontaktEmails.Rows.Add(row.Rolle, row.Art, row.Email) 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 - Dim firma = GetKundenFirma(kundenNr) - + + ' 1. E-Mails aus Kundenstammdaten laden (direkt von Datenbank) Try - Dim sql As String = "SELECT * FROM tblKundenKontakt WHERE kkd_KundenNr = " & kundenNr + Dim sql As String = "SELECT E_Mail, E_Mail2 FROM Adressen WHERE AdressenNr = " & kundenNr + Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) + Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) + Using reader = cmd.ExecuteReader() + If reader.Read() Then + Dim email1 = If(reader("E_Mail") Is DBNull.Value, "", reader("E_Mail").ToString().Trim()) + Dim email2 = If(reader("E_Mail2") Is DBNull.Value, "", reader("E_Mail2").ToString().Trim()) + + If email1 <> "" Then + For Each splitEmail In email1.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key1 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key1) Then + dedupe.Add(key1) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + + If email2 <> "" Then + For Each splitEmail In email2.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key2 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key2) Then + dedupe.Add(key2) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + End If + End Using + End Using + End Using + Catch + End Try + + ' 2. E-Mails aus E-Mail-Benachrichtigungen (Sendungsdetails) laden (direkt von Datenbank) + Try + Dim sql As String = "SELECT eb_ebartId, eb_EMail, eb_cc, eb_bcc FROM tblEmailBenachrichtigung WHERE eb_KundenNr = " & kundenNr Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) Using reader = cmd.ExecuteReader() While reader.Read() - Dim 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 + Dim artId = If(reader("eb_ebartId") Is DBNull.Value, 0, Convert.ToInt32(reader("eb_ebartId"))) + Dim email = If(reader("eb_EMail") Is DBNull.Value, "", reader("eb_EMail").ToString().Trim()) + Dim isCc = If(reader("eb_cc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_cc"))) + Dim isBcc = If(reader("eb_bcc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_bcc"))) + + If email = "" Then Continue While + + Dim empfaengerArt = If(isBcc, "BCC", If(isCc, "CC", "AN")) + Dim artText = ResolveMailArtLabel(artId) & " / " & empfaengerArt + + For Each splitEmail In email.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key = rolle & "|" & kundenNr.ToString() & "|" & artText & "|" & em.ToLowerInvariant() + If Not dedupe.Contains(key) Then + dedupe.Add(key) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = artText, .Email = em}) + End If Next End While End Using @@ -265,57 +219,21 @@ Public Class frmSendungsDokumentanforderung End Try End Sub - 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 + Private Function ResolveMailArtLabel(artId As Integer) As String + Select Case artId + Case 1 + Return "Ankunft" + Case 2 + Return "Freigabe" + Case 3 + Return "Ankunft Export" + Case 4 + Return "Freigabe Export" + Case 5 + Return "Status" + Case Else + Return "Unbekannt" + End Select End Function Private Function ToIntSafe(value As Object) As Integer @@ -1261,7 +1179,6 @@ 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 From 220eee86413fd87bf1f7691e98a9efd3998a0f66 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 26 Mar 2026 09:30:57 +0100 Subject: [PATCH 08/15] vermerke --- Aviso/Aviso.vbproj | 2 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 436 +----- Aviso/frmAddSendungsvermerkShort.vb | 1406 +----------------- Aviso/frmSendungsDokumentanforderung.vb | 267 ++-- 5 files changed, 251 insertions(+), 1864 deletions(-) diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 57e86fa..6491167 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -2239,4 +2239,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 From 0bce92847c92f31ced879cb85d558246e612f4d1 Mon Sep 17 00:00:00 2001 From: murad Date: Thu, 26 Mar 2026 16:43:27 +0100 Subject: [PATCH 09/15] vermerke update --- ...frmSendungsDokumentanforderung.Designer.vb | 142 ++++++++++----- Aviso/frmSendungsDokumentanforderung.vb | 165 +++++++++++++++++- 2 files changed, 254 insertions(+), 53 deletions(-) diff --git a/Aviso/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb index 38a1cd2..7ad328b 100644 --- a/Aviso/frmSendungsDokumentanforderung.Designer.vb +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -42,6 +42,8 @@ Partial Class frmSendungsDokumentanforderung Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() + Me.cmbCustomerUploadEmailTemplate = New System.Windows.Forms.ComboBox() + Me.lblCustomerUploadEmailTemplate = New System.Windows.Forms.Label() Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() Me.btnVermerkSetzen = New System.Windows.Forms.Button() @@ -57,16 +59,18 @@ Partial Class frmSendungsDokumentanforderung ' Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 34) + Me.flpDokumenteFehlenMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(18, 42) Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" - Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(675, 138) Me.flpDokumenteFehlenMain.TabIndex = 0 ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.Location = New System.Drawing.Point(12, 126) + Me.cbxSonstDok.Location = New System.Drawing.Point(18, 191) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 1 @@ -75,16 +79,19 @@ Partial Class frmSendungsDokumentanforderung ' 'txtSonstigesDokumentFehlt ' - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(95, 124) + Me.txtSonstigesDokumentFehlt.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(132, 189) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(336, 20) Me.txtSonstigesDokumentFehlt.TabIndex = 2 ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 126) + Me.cbxNichtLeserlich.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(596, 191) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 3 @@ -95,7 +102,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblErrDokument.AutoSize = True Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(96, 146) + Me.lblErrDokument.Location = New System.Drawing.Point(133, 212) Me.lblErrDokument.Name = "lblErrDokument" Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) Me.lblErrDokument.TabIndex = 4 @@ -115,9 +122,11 @@ Partial Class frmSendungsDokumentanforderung Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) - Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 159) + Me.pnlDocumentEditor.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(9, 226) Me.pnlDocumentEditor.Name = "pnlDocumentEditor" - Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.Size = New System.Drawing.Size(687, 201) Me.pnlDocumentEditor.TabIndex = 5 ' 'flpDocumentTabs @@ -128,7 +137,7 @@ Partial Class frmSendungsDokumentanforderung 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.Size = New System.Drawing.Size(683, 48) Me.flpDocumentTabs.TabIndex = 0 Me.flpDocumentTabs.WrapContents = False ' @@ -136,7 +145,7 @@ Partial Class frmSendungsDokumentanforderung ' 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.Location = New System.Drawing.Point(10, 56) Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) Me.lblDocumentEditorTitle.TabIndex = 1 @@ -145,7 +154,7 @@ Partial Class frmSendungsDokumentanforderung 'lblDocumentEditorName ' Me.lblDocumentEditorName.AutoSize = True - Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Location = New System.Drawing.Point(10, 87) Me.lblDocumentEditorName.Name = "lblDocumentEditorName" Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) Me.lblDocumentEditorName.TabIndex = 2 @@ -153,16 +162,16 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorName ' - Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.Location = New System.Drawing.Point(155, 84) Me.txtDocumentEditorName.MaxLength = 120 Me.txtDocumentEditorName.Name = "txtDocumentEditorName" - Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.Size = New System.Drawing.Size(206, 20) Me.txtDocumentEditorName.TabIndex = 3 ' 'lblDocumentEditorAnhangsart ' Me.lblDocumentEditorAnhangsart.AutoSize = True - Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(377, 87) Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) Me.lblDocumentEditorAnhangsart.TabIndex = 4 @@ -171,15 +180,15 @@ Partial Class frmSendungsDokumentanforderung 'cmbDocumentEditorAnhangsart ' Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(468, 84) Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" - Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(205, 21) Me.cmbDocumentEditorAnhangsart.TabIndex = 5 ' 'lblDocumentEditorInfo ' Me.lblDocumentEditorInfo.AutoSize = True - Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(10, 115) Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) Me.lblDocumentEditorInfo.TabIndex = 6 @@ -187,10 +196,10 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorInfo ' - Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(155, 112) Me.txtDocumentEditorInfo.MaxLength = 500 Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" - Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(518, 20) Me.txtDocumentEditorInfo.TabIndex = 7 Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." ' @@ -198,7 +207,7 @@ Partial Class frmSendungsDokumentanforderung ' 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.Location = New System.Drawing.Point(10, 151) Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) Me.lblDocumentEditorStatus.TabIndex = 8 @@ -208,7 +217,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(6, 298) + Me.Label5.Location = New System.Drawing.Point(9, 438) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 6 @@ -218,7 +227,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label20.AutoSize = True Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.Label20.Location = New System.Drawing.Point(216, 300) + Me.Label20.Location = New System.Drawing.Point(314, 442) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 7 @@ -227,9 +236,10 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 321) + Me.btnCustomerUploadLink.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(553, 466) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" - Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadLink.TabIndex = 11 Me.btnCustomerUploadLink.Text = "Link kopieren" Me.btnCustomerUploadLink.UseVisualStyleBackColor = True @@ -237,25 +247,28 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 346) + Me.btnCustomerUploadEmail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(553, 502) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" - Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadEmail.TabIndex = 13 Me.btnCustomerUploadEmail.Text = "E-Mail senden" Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True ' 'txtCustomerUploadEmail ' - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 348) + Me.txtCustomerUploadEmail.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(132, 507) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" - Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(409, 20) Me.txtCustomerUploadEmail.TabIndex = 12 ' 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 351) + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(9, 510) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 10 @@ -264,7 +277,7 @@ Partial Class frmSendungsDokumentanforderung 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 325) + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 471) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 9 @@ -272,11 +285,11 @@ Partial Class frmSendungsDokumentanforderung ' 'nudCustomerUploadValidityHours ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 323) + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(352, 469) 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.Size = New System.Drawing.Size(110, 20) Me.nudCustomerUploadValidityHours.TabIndex = 10 Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) ' @@ -285,15 +298,15 @@ Partial Class frmSendungsDokumentanforderung Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbCustomerUploadLanguage.FormattingEnabled = True Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) - Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 322) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(132, 469) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" - Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(108, 21) Me.cmbCustomerUploadLanguage.TabIndex = 9 ' 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 325) + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(9, 472) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 8 @@ -301,28 +314,51 @@ Partial Class frmSendungsDokumentanforderung ' 'txtCustomerUploadEmailText ' - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 374) + Me.txtCustomerUploadEmailText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(132, 570) Me.txtCustomerUploadEmailText.MaxLength = 500 Me.txtCustomerUploadEmailText.Multiline = True Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 44) + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(564, 50) Me.txtCustomerUploadEmailText.TabIndex = 14 - Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." - ' + Me.txtCustomerUploadEmailText.Text = "" + ' 'lblCustomerUploadEmailText ' Me.lblCustomerUploadEmailText.AutoSize = True - Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 377) + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(9, 573) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 15 Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" ' + 'cmbCustomerUploadEmailTemplate + ' + Me.cmbCustomerUploadEmailTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbCustomerUploadEmailTemplate.FormattingEnabled = True + Me.cmbCustomerUploadEmailTemplate.Location = New System.Drawing.Point(132, 543) + Me.cmbCustomerUploadEmailTemplate.Name = "cmbCustomerUploadEmailTemplate" + Me.cmbCustomerUploadEmailTemplate.Size = New System.Drawing.Size(564, 21) + Me.cmbCustomerUploadEmailTemplate.TabIndex = 19 + Me.cmbCustomerUploadEmailTemplate.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + ' + 'lblCustomerUploadEmailTemplate + ' + Me.lblCustomerUploadEmailTemplate.AutoSize = True + Me.lblCustomerUploadEmailTemplate.Location = New System.Drawing.Point(9, 546) + Me.lblCustomerUploadEmailTemplate.Name = "lblCustomerUploadEmailTemplate" + Me.lblCustomerUploadEmailTemplate.Size = New System.Drawing.Size(63, 13) + Me.lblCustomerUploadEmailTemplate.TabIndex = 20 + Me.lblCustomerUploadEmailTemplate.Text = "Vorlage:" + ' 'lblKontaktEmails ' Me.lblKontaktEmails.AutoSize = True - Me.lblKontaktEmails.Location = New System.Drawing.Point(6, 427) + Me.lblKontaktEmails.Location = New System.Drawing.Point(9, 628) Me.lblKontaktEmails.Name = "lblKontaktEmails" Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) Me.lblKontaktEmails.TabIndex = 17 @@ -335,21 +371,25 @@ Partial Class frmSendungsDokumentanforderung Me.dgvKontaktEmails.AllowUserToResizeRows = False Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 445) + Me.dgvKontaktEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 647) Me.dgvKontaktEmails.MultiSelect = False Me.dgvKontaktEmails.Name = "dgvKontaktEmails" Me.dgvKontaktEmails.ReadOnly = True Me.dgvKontaktEmails.RowHeadersVisible = False Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvKontaktEmails.Size = New System.Drawing.Size(455, 84) + Me.dgvKontaktEmails.Size = New System.Drawing.Size(687, 170) Me.dgvKontaktEmails.TabIndex = 18 ' 'btnVermerkSetzen ' Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnVermerkSetzen.Location = New System.Drawing.Point(340, 535) + Me.btnVermerkSetzen.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnVermerkSetzen.Location = New System.Drawing.Point(553, 823) Me.btnVermerkSetzen.Name = "btnVermerkSetzen" - Me.btnVermerkSetzen.Size = New System.Drawing.Size(124, 30) + Me.btnVermerkSetzen.Size = New System.Drawing.Size(143, 36) Me.btnVermerkSetzen.TabIndex = 16 Me.btnVermerkSetzen.Text = "Vermerk setzen" Me.btnVermerkSetzen.UseVisualStyleBackColor = True @@ -358,7 +398,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblTitel.AutoSize = True Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTitel.Location = New System.Drawing.Point(9, 9) + Me.lblTitel.Location = New System.Drawing.Point(12, 14) Me.lblTitel.Name = "lblTitel" Me.lblTitel.Size = New System.Drawing.Size(156, 17) Me.lblTitel.TabIndex = 18 @@ -368,12 +408,15 @@ Partial Class frmSendungsDokumentanforderung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 576) + Me.ClientSize = New System.Drawing.Size(711, 864) + Me.Controls.Add(Me.lblCustomerUploadEmailTemplate) + Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.dgvKontaktEmails) Me.Controls.Add(Me.lblKontaktEmails) Me.Controls.Add(Me.lblTitel) Me.Controls.Add(Me.btnVermerkSetzen) Me.Controls.Add(Me.lblCustomerUploadEmailText) + Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.txtCustomerUploadEmailText) Me.Controls.Add(Me.lblCustomerUploadLanguage) Me.Controls.Add(Me.cmbCustomerUploadLanguage) @@ -436,5 +479,8 @@ Partial Class frmSendungsDokumentanforderung Friend WithEvents btnVermerkSetzen As Button Friend WithEvents lblTitel As Label Friend WithEvents lblKontaktEmails As Label + Friend WithEvents cmbCustomerUploadEmailTemplate As ComboBox + Friend WithEvents lblCustomerUploadEmailTemplate As Label Friend WithEvents dgvKontaktEmails As DataGridView + End Class diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb index 1277d14..1ed4c40 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -6,9 +6,11 @@ Imports System.Text Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports VERAG_PROG_ALLGEMEIN +Imports AVISO.AvisoStatusFunctions Public Class frmSendungsDokumentanforderung Private ReadOnly AvisoDAL As New cAvisoDAL + Private ReadOnly _admin As New cADMIN Public Property AvisoID As Integer Public Property SendungID As Integer @@ -35,6 +37,7 @@ Public Class frmSendungsDokumentanforderung Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) Private ReadOnly _kundenFirmaByNr As New Dictionary(Of Integer, String) Private _kontaktRolleTabs As TabControl + Private _emailTemplates As DataTable Public Sub New(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) InitializeComponent() @@ -60,11 +63,78 @@ Public Class frmSendungsDokumentanforderung InitializeDocumentEditor() SetupDynamicAnforderungCheckboxes() + LoadEmailTemplates() ApplyStateToUi(_stateToApply) InitializeKontaktEmailGrid() LoadKontaktEmails() End Sub + Private Sub LoadEmailTemplates() + Try + Dim sql As String = "SELECT [txt_Id], [txt_bezeichnung], [txt_sprache], [txt_text] FROM [tblTextkonserve] WHERE txt_kategorie = 'FRM_DOKUMENTANFORDERUNG_MailText' ORDER BY [txt_bezeichnung], [txt_sprache]" + _emailTemplates = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(sql, "FMZOLL", 1000, True) + + cmbCustomerUploadEmailTemplate.Items.Clear() + If _emailTemplates IsNot Nothing AndAlso _emailTemplates.Rows.Count > 0 Then + Dim bezeichnungen As New HashSet(Of String)() + For Each row As DataRow In _emailTemplates.Rows + Dim bezeichnung As String = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() + If bezeichnung <> "" AndAlso Not bezeichnungen.Contains(bezeichnung) Then + bezeichnungen.Add(bezeichnung) + cmbCustomerUploadEmailTemplate.Items.Add(bezeichnung) + End If + Next + End If + + If cmbCustomerUploadEmailTemplate.Items.Count > 0 Then + cmbCustomerUploadEmailTemplate.SelectedIndex = 0 + End If + Catch ex As Exception + ' Fehler beim Laden ignorieren, Vorlagen bleiben leer + End Try + End Sub + + Private Sub UpdateEmailText() + If _emailTemplates Is Nothing OrElse _emailTemplates.Rows.Count = 0 Then Return + + Dim selectedTemplate = If(cmbCustomerUploadEmailTemplate.SelectedItem, "").ToString() + Dim selectedLang = If(cmbCustomerUploadLanguage.SelectedItem, "").ToString().ToLowerInvariant() + If selectedLang = "" Then selectedLang = "de" + + If selectedTemplate <> "" Then + ' Suche nach passender Vorlage und Sprache + Dim foundText As String = "" + For Each row As DataRow In _emailTemplates.Rows + Dim bezeichnung = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() + Dim sprache = If(IsDBNull(row("txt_sprache")), "", CStr(row("txt_sprache"))).Trim().ToLowerInvariant() + + If String.Equals(bezeichnung, selectedTemplate, StringComparison.OrdinalIgnoreCase) Then + ' Wenn wir die genaue Sprache finden, nimm diese + If String.Equals(sprache, selectedLang, StringComparison.OrdinalIgnoreCase) Then + foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) + Exit For + End If + ' Fallback auf 'de' oder die erste gefundene Sprache, falls die gesuchte nicht existiert + If foundText = "" OrElse String.Equals(sprache, "de", StringComparison.OrdinalIgnoreCase) Then + foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) + End If + End If + Next + + If foundText <> "" Then + txtCustomerUploadEmailText.Text = foundText.Replace("\n", vbCrLf) + End If + End If + End Sub + + Private Sub cmbCustomerUploadEmailTemplate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadEmailTemplate.SelectedIndexChanged + UpdateEmailText() + End Sub + + Private Sub cmbCustomerUploadLanguage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadLanguage.SelectedIndexChanged + UpdateEmailText() + End Sub + Private Sub ResolveContextIds() If AvisoID > 0 AndAlso SendungID <> 0 Then Return @@ -435,10 +505,10 @@ Public Class frmSendungsDokumentanforderung Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) cb.AutoSize = False - cb.Height = 18 - Dim usableWidth = Math.Max(120, container.Width - 20) - Dim cbWidth = CInt(Math.Floor((usableWidth - 4) / 3)) - cb.Width = Math.Max(80, Math.Min(cbWidth, 220)) + cb.Height = 24 + Dim usableWidth = Math.Max(180, container.Width - 24) + Dim cbWidth = CInt(Math.Floor((usableWidth - 12) / 4)) + cb.Width = Math.Max(120, Math.Min(cbWidth, 320)) End Sub Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) @@ -788,10 +858,95 @@ Public Class frmSendungsDokumentanforderung txtSonstigesDokumentFehlt.Focus() Exit Sub End If + If Not SaveSelectedVermerke() Then + Exit Sub + End If DialogResult = DialogResult.OK Close() End Sub + Private Function SaveSelectedVermerke() As Boolean + Try + If AvisoID <= 0 Then + MsgBox("Aviso konnte nicht ermittelt werden.", vbExclamation) + Return False + End If + + Dim sendungsText = GetSendungsAnzeigeText() + + 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 codeId <= 0 Then Continue For + + Dim text = GetBackendVermerkText(codeId, If(cb.Text, "").Trim()) + If text = "" Then Continue For + text = AppendSendungIfMissing(text, sendungsText) + + insertSendungsVermerk(SendungID, AvisoID, text, codeId) + Next + + If cbxSonstDok.Checked Then + Dim customDocName = If(txtSonstigesDokumentFehlt.Text, "").Trim() + If customDocName <> "" Then + Dim text = GetBackendVermerkText(25, "") + If text = "" Then + text = customDocName + Else + text = text.Replace("''", "'" & customDocName & "'") + If InStr(text, customDocName, CompareMethod.Text) = 0 Then + text &= " [" & customDocName & "]" + End If + End If + text = AppendSendungIfMissing(text, sendungsText) + insertSendungsVermerk(SendungID, AvisoID, text, 25) + End If + End If + + If cbxNichtLeserlich.Checked Then + Dim text = GetBackendVermerkText(42, If(cbxNichtLeserlich.Text, "").Trim()) + text = AppendSendungIfMissing(text, sendungsText) + If text <> "" Then + insertSendungsVermerk(SendungID, AvisoID, text, 42) + End If + End If + + Return True + Catch ex As Exception + MsgBox("Vermerk konnte nicht gespeichert werden: " & ex.Message, vbExclamation) + Return False + End Try + End Function + + Private Function GetSendungsAnzeigeText() As String + If SendungID <= 0 Then Return "KOMPLETT" + Try + Return _admin.getValueTxtBySql(" SELECT convert(varchar(2),[tblSnd_PosUnterNr]) +' - ' +isnull([tblSnd_Empfaenger],'') FROM tblSendungen WHERE [tblSnd_SendungID]=" & SendungID, "AVISO").Trim() + Catch + Return SendungID.ToString() + End Try + End Function + + Private Function GetBackendVermerkText(codeId As Integer, fallback As String) As String + If _backendBezeichnungByCodeId.ContainsKey(codeId) Then + Dim value = If(_backendBezeichnungByCodeId(codeId), "").Trim() + If value <> "" Then + Return value + End If + End If + Return If(fallback, "").Trim() + End Function + + Private Function AppendSendungIfMissing(text As String, sendungsText As String) As String + Dim value = If(text, "").Trim() + Dim snd = If(sendungsText, "").Trim() + If value = "" OrElse snd = "" Then Return value + If InStr(value, "sendung", CompareMethod.Text) > 0 Then Return value + Return value & " bei Sendung '" & snd & "'" + End Function + Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) Dim config = GetCustomerPortalApiConfig() @@ -1275,7 +1430,7 @@ Public Class frmSendungsDokumentanforderung Public Property NichtLeserlichChecked As Boolean Public Property CustomerUploadEmail As String Public Property CustomerUploadLanguage As String = "de" - Public Property CustomerUploadEmailText As String = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + Public Property CustomerUploadEmailText As String = "" Public Property CustomerUploadValidityHours As Integer = 168 End Class End Class From cb1a47f5f2b653d19ddcd434b4fc267091ed9eae Mon Sep 17 00:00:00 2001 From: murad Date: Thu, 26 Mar 2026 09:32:59 +0100 Subject: [PATCH 10/15] update --- ...frmSendungsDokumentanforderung.Designer.vb | 142 +++++---------- Aviso/frmSendungsDokumentanforderung.vb | 165 +----------------- 2 files changed, 53 insertions(+), 254 deletions(-) diff --git a/Aviso/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb index 7ad328b..38a1cd2 100644 --- a/Aviso/frmSendungsDokumentanforderung.Designer.vb +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -42,8 +42,6 @@ Partial Class frmSendungsDokumentanforderung Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() - Me.cmbCustomerUploadEmailTemplate = New System.Windows.Forms.ComboBox() - Me.lblCustomerUploadEmailTemplate = New System.Windows.Forms.Label() Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() Me.btnVermerkSetzen = New System.Windows.Forms.Button() @@ -59,18 +57,16 @@ Partial Class frmSendungsDokumentanforderung ' Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpDokumenteFehlenMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(18, 42) + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 34) Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" - Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(675, 138) + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) Me.flpDokumenteFehlenMain.TabIndex = 0 ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.Location = New System.Drawing.Point(18, 191) + Me.cbxSonstDok.Location = New System.Drawing.Point(12, 126) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 1 @@ -79,19 +75,16 @@ Partial Class frmSendungsDokumentanforderung ' 'txtSonstigesDokumentFehlt ' - Me.txtSonstigesDokumentFehlt.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(132, 189) + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(95, 124) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(336, 20) + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) Me.txtSonstigesDokumentFehlt.TabIndex = 2 ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(596, 191) + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 126) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 3 @@ -102,7 +95,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblErrDokument.AutoSize = True Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(133, 212) + Me.lblErrDokument.Location = New System.Drawing.Point(96, 146) Me.lblErrDokument.Name = "lblErrDokument" Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) Me.lblErrDokument.TabIndex = 4 @@ -122,11 +115,9 @@ Partial Class frmSendungsDokumentanforderung Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) - Me.pnlDocumentEditor.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.pnlDocumentEditor.Location = New System.Drawing.Point(9, 226) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 159) Me.pnlDocumentEditor.Name = "pnlDocumentEditor" - Me.pnlDocumentEditor.Size = New System.Drawing.Size(687, 201) + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) Me.pnlDocumentEditor.TabIndex = 5 ' 'flpDocumentTabs @@ -137,7 +128,7 @@ Partial Class frmSendungsDokumentanforderung 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(683, 48) + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) Me.flpDocumentTabs.TabIndex = 0 Me.flpDocumentTabs.WrapContents = False ' @@ -145,7 +136,7 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 56) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) Me.lblDocumentEditorTitle.TabIndex = 1 @@ -154,7 +145,7 @@ Partial Class frmSendungsDokumentanforderung 'lblDocumentEditorName ' Me.lblDocumentEditorName.AutoSize = True - Me.lblDocumentEditorName.Location = New System.Drawing.Point(10, 87) + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) Me.lblDocumentEditorName.Name = "lblDocumentEditorName" Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) Me.lblDocumentEditorName.TabIndex = 2 @@ -162,16 +153,16 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorName ' - Me.txtDocumentEditorName.Location = New System.Drawing.Point(155, 84) + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) Me.txtDocumentEditorName.MaxLength = 120 Me.txtDocumentEditorName.Name = "txtDocumentEditorName" - Me.txtDocumentEditorName.Size = New System.Drawing.Size(206, 20) + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) Me.txtDocumentEditorName.TabIndex = 3 ' 'lblDocumentEditorAnhangsart ' Me.lblDocumentEditorAnhangsart.AutoSize = True - Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(377, 87) + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) Me.lblDocumentEditorAnhangsart.TabIndex = 4 @@ -180,15 +171,15 @@ Partial Class frmSendungsDokumentanforderung 'cmbDocumentEditorAnhangsart ' Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(468, 84) + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" - Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(205, 21) + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) Me.cmbDocumentEditorAnhangsart.TabIndex = 5 ' 'lblDocumentEditorInfo ' Me.lblDocumentEditorInfo.AutoSize = True - Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(10, 115) + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) Me.lblDocumentEditorInfo.TabIndex = 6 @@ -196,10 +187,10 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorInfo ' - Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(155, 112) + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) Me.txtDocumentEditorInfo.MaxLength = 500 Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" - Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(518, 20) + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) Me.txtDocumentEditorInfo.TabIndex = 7 Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." ' @@ -207,7 +198,7 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 151) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) Me.lblDocumentEditorStatus.TabIndex = 8 @@ -217,7 +208,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(9, 438) + Me.Label5.Location = New System.Drawing.Point(6, 298) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 6 @@ -227,7 +218,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label20.AutoSize = True Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.Label20.Location = New System.Drawing.Point(314, 442) + Me.Label20.Location = New System.Drawing.Point(216, 300) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 7 @@ -236,10 +227,9 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(553, 466) + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 321) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" - Me.btnCustomerUploadLink.Size = New System.Drawing.Size(143, 30) + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) Me.btnCustomerUploadLink.TabIndex = 11 Me.btnCustomerUploadLink.Text = "Link kopieren" Me.btnCustomerUploadLink.UseVisualStyleBackColor = True @@ -247,28 +237,25 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(553, 502) + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 346) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" - Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(143, 30) + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) Me.btnCustomerUploadEmail.TabIndex = 13 Me.btnCustomerUploadEmail.Text = "E-Mail senden" Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True ' 'txtCustomerUploadEmail ' - Me.txtCustomerUploadEmail.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(132, 507) + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 348) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" - Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(409, 20) + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) Me.txtCustomerUploadEmail.TabIndex = 12 ' 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(9, 510) + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 351) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 10 @@ -277,7 +264,7 @@ Partial Class frmSendungsDokumentanforderung 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 471) + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 325) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 9 @@ -285,11 +272,11 @@ Partial Class frmSendungsDokumentanforderung ' 'nudCustomerUploadValidityHours ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(352, 469) + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 323) Me.nudCustomerUploadValidityHours.Maximum = New Decimal(New Integer() {168, 0, 0, 0}) Me.nudCustomerUploadValidityHours.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) Me.nudCustomerUploadValidityHours.Name = "nudCustomerUploadValidityHours" - Me.nudCustomerUploadValidityHours.Size = New System.Drawing.Size(110, 20) + Me.nudCustomerUploadValidityHours.Size = New System.Drawing.Size(74, 20) Me.nudCustomerUploadValidityHours.TabIndex = 10 Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) ' @@ -298,15 +285,15 @@ Partial Class frmSendungsDokumentanforderung 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(132, 469) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 322) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" - Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(108, 21) + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) Me.cmbCustomerUploadLanguage.TabIndex = 9 ' 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(9, 472) + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 325) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 8 @@ -314,51 +301,28 @@ Partial Class frmSendungsDokumentanforderung ' 'txtCustomerUploadEmailText ' - Me.txtCustomerUploadEmailText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(132, 570) + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 374) Me.txtCustomerUploadEmailText.MaxLength = 500 Me.txtCustomerUploadEmailText.Multiline = True Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(564, 50) + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 44) Me.txtCustomerUploadEmailText.TabIndex = 14 - Me.txtCustomerUploadEmailText.Text = "" - ' + 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(9, 573) + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 377) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 15 Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" ' - 'cmbCustomerUploadEmailTemplate - ' - Me.cmbCustomerUploadEmailTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbCustomerUploadEmailTemplate.FormattingEnabled = True - Me.cmbCustomerUploadEmailTemplate.Location = New System.Drawing.Point(132, 543) - Me.cmbCustomerUploadEmailTemplate.Name = "cmbCustomerUploadEmailTemplate" - Me.cmbCustomerUploadEmailTemplate.Size = New System.Drawing.Size(564, 21) - Me.cmbCustomerUploadEmailTemplate.TabIndex = 19 - Me.cmbCustomerUploadEmailTemplate.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - ' - 'lblCustomerUploadEmailTemplate - ' - Me.lblCustomerUploadEmailTemplate.AutoSize = True - Me.lblCustomerUploadEmailTemplate.Location = New System.Drawing.Point(9, 546) - Me.lblCustomerUploadEmailTemplate.Name = "lblCustomerUploadEmailTemplate" - Me.lblCustomerUploadEmailTemplate.Size = New System.Drawing.Size(63, 13) - Me.lblCustomerUploadEmailTemplate.TabIndex = 20 - Me.lblCustomerUploadEmailTemplate.Text = "Vorlage:" - ' 'lblKontaktEmails ' Me.lblKontaktEmails.AutoSize = True - Me.lblKontaktEmails.Location = New System.Drawing.Point(9, 628) + Me.lblKontaktEmails.Location = New System.Drawing.Point(6, 427) Me.lblKontaktEmails.Name = "lblKontaktEmails" Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) Me.lblKontaktEmails.TabIndex = 17 @@ -371,25 +335,21 @@ Partial Class frmSendungsDokumentanforderung Me.dgvKontaktEmails.AllowUserToResizeRows = False Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvKontaktEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 647) + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 445) Me.dgvKontaktEmails.MultiSelect = False Me.dgvKontaktEmails.Name = "dgvKontaktEmails" Me.dgvKontaktEmails.ReadOnly = True Me.dgvKontaktEmails.RowHeadersVisible = False Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvKontaktEmails.Size = New System.Drawing.Size(687, 170) + Me.dgvKontaktEmails.Size = New System.Drawing.Size(455, 84) Me.dgvKontaktEmails.TabIndex = 18 ' 'btnVermerkSetzen ' Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnVermerkSetzen.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnVermerkSetzen.Location = New System.Drawing.Point(553, 823) + Me.btnVermerkSetzen.Location = New System.Drawing.Point(340, 535) Me.btnVermerkSetzen.Name = "btnVermerkSetzen" - Me.btnVermerkSetzen.Size = New System.Drawing.Size(143, 36) + Me.btnVermerkSetzen.Size = New System.Drawing.Size(124, 30) Me.btnVermerkSetzen.TabIndex = 16 Me.btnVermerkSetzen.Text = "Vermerk setzen" Me.btnVermerkSetzen.UseVisualStyleBackColor = True @@ -398,7 +358,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblTitel.AutoSize = True Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTitel.Location = New System.Drawing.Point(12, 14) + Me.lblTitel.Location = New System.Drawing.Point(9, 9) Me.lblTitel.Name = "lblTitel" Me.lblTitel.Size = New System.Drawing.Size(156, 17) Me.lblTitel.TabIndex = 18 @@ -408,15 +368,12 @@ Partial Class frmSendungsDokumentanforderung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(711, 864) - Me.Controls.Add(Me.lblCustomerUploadEmailTemplate) - Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) + Me.ClientSize = New System.Drawing.Size(474, 576) Me.Controls.Add(Me.dgvKontaktEmails) Me.Controls.Add(Me.lblKontaktEmails) Me.Controls.Add(Me.lblTitel) Me.Controls.Add(Me.btnVermerkSetzen) Me.Controls.Add(Me.lblCustomerUploadEmailText) - Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.txtCustomerUploadEmailText) Me.Controls.Add(Me.lblCustomerUploadLanguage) Me.Controls.Add(Me.cmbCustomerUploadLanguage) @@ -479,8 +436,5 @@ Partial Class frmSendungsDokumentanforderung Friend WithEvents btnVermerkSetzen As Button Friend WithEvents lblTitel As Label Friend WithEvents lblKontaktEmails As Label - Friend WithEvents cmbCustomerUploadEmailTemplate As ComboBox - Friend WithEvents lblCustomerUploadEmailTemplate As Label Friend WithEvents dgvKontaktEmails As DataGridView - End Class diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb index 1ed4c40..1277d14 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -6,11 +6,9 @@ Imports System.Text Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports VERAG_PROG_ALLGEMEIN -Imports AVISO.AvisoStatusFunctions Public Class frmSendungsDokumentanforderung Private ReadOnly AvisoDAL As New cAvisoDAL - Private ReadOnly _admin As New cADMIN Public Property AvisoID As Integer Public Property SendungID As Integer @@ -37,7 +35,6 @@ Public Class frmSendungsDokumentanforderung Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) Private ReadOnly _kundenFirmaByNr As New Dictionary(Of Integer, String) Private _kontaktRolleTabs As TabControl - Private _emailTemplates As DataTable Public Sub New(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) InitializeComponent() @@ -63,78 +60,11 @@ Public Class frmSendungsDokumentanforderung InitializeDocumentEditor() SetupDynamicAnforderungCheckboxes() - LoadEmailTemplates() ApplyStateToUi(_stateToApply) InitializeKontaktEmailGrid() LoadKontaktEmails() End Sub - Private Sub LoadEmailTemplates() - Try - Dim sql As String = "SELECT [txt_Id], [txt_bezeichnung], [txt_sprache], [txt_text] FROM [tblTextkonserve] WHERE txt_kategorie = 'FRM_DOKUMENTANFORDERUNG_MailText' ORDER BY [txt_bezeichnung], [txt_sprache]" - _emailTemplates = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(sql, "FMZOLL", 1000, True) - - cmbCustomerUploadEmailTemplate.Items.Clear() - If _emailTemplates IsNot Nothing AndAlso _emailTemplates.Rows.Count > 0 Then - Dim bezeichnungen As New HashSet(Of String)() - For Each row As DataRow In _emailTemplates.Rows - Dim bezeichnung As String = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() - If bezeichnung <> "" AndAlso Not bezeichnungen.Contains(bezeichnung) Then - bezeichnungen.Add(bezeichnung) - cmbCustomerUploadEmailTemplate.Items.Add(bezeichnung) - End If - Next - End If - - If cmbCustomerUploadEmailTemplate.Items.Count > 0 Then - cmbCustomerUploadEmailTemplate.SelectedIndex = 0 - End If - Catch ex As Exception - ' Fehler beim Laden ignorieren, Vorlagen bleiben leer - End Try - End Sub - - Private Sub UpdateEmailText() - If _emailTemplates Is Nothing OrElse _emailTemplates.Rows.Count = 0 Then Return - - Dim selectedTemplate = If(cmbCustomerUploadEmailTemplate.SelectedItem, "").ToString() - Dim selectedLang = If(cmbCustomerUploadLanguage.SelectedItem, "").ToString().ToLowerInvariant() - If selectedLang = "" Then selectedLang = "de" - - If selectedTemplate <> "" Then - ' Suche nach passender Vorlage und Sprache - Dim foundText As String = "" - For Each row As DataRow In _emailTemplates.Rows - Dim bezeichnung = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() - Dim sprache = If(IsDBNull(row("txt_sprache")), "", CStr(row("txt_sprache"))).Trim().ToLowerInvariant() - - If String.Equals(bezeichnung, selectedTemplate, StringComparison.OrdinalIgnoreCase) Then - ' Wenn wir die genaue Sprache finden, nimm diese - If String.Equals(sprache, selectedLang, StringComparison.OrdinalIgnoreCase) Then - foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) - Exit For - End If - ' Fallback auf 'de' oder die erste gefundene Sprache, falls die gesuchte nicht existiert - If foundText = "" OrElse String.Equals(sprache, "de", StringComparison.OrdinalIgnoreCase) Then - foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) - End If - End If - Next - - If foundText <> "" Then - txtCustomerUploadEmailText.Text = foundText.Replace("\n", vbCrLf) - End If - End If - End Sub - - Private Sub cmbCustomerUploadEmailTemplate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadEmailTemplate.SelectedIndexChanged - UpdateEmailText() - End Sub - - Private Sub cmbCustomerUploadLanguage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadLanguage.SelectedIndexChanged - UpdateEmailText() - End Sub - Private Sub ResolveContextIds() If AvisoID > 0 AndAlso SendungID <> 0 Then Return @@ -505,10 +435,10 @@ Public Class frmSendungsDokumentanforderung Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) cb.AutoSize = False - cb.Height = 24 - Dim usableWidth = Math.Max(180, container.Width - 24) - Dim cbWidth = CInt(Math.Floor((usableWidth - 12) / 4)) - cb.Width = Math.Max(120, Math.Min(cbWidth, 320)) + cb.Height = 18 + Dim usableWidth = Math.Max(120, container.Width - 20) + Dim cbWidth = CInt(Math.Floor((usableWidth - 4) / 3)) + cb.Width = Math.Max(80, Math.Min(cbWidth, 220)) End Sub Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) @@ -858,95 +788,10 @@ Public Class frmSendungsDokumentanforderung txtSonstigesDokumentFehlt.Focus() Exit Sub End If - If Not SaveSelectedVermerke() Then - Exit Sub - End If DialogResult = DialogResult.OK Close() End Sub - Private Function SaveSelectedVermerke() As Boolean - Try - If AvisoID <= 0 Then - MsgBox("Aviso konnte nicht ermittelt werden.", vbExclamation) - Return False - End If - - Dim sendungsText = GetSendungsAnzeigeText() - - 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 codeId <= 0 Then Continue For - - Dim text = GetBackendVermerkText(codeId, If(cb.Text, "").Trim()) - If text = "" Then Continue For - text = AppendSendungIfMissing(text, sendungsText) - - insertSendungsVermerk(SendungID, AvisoID, text, codeId) - Next - - If cbxSonstDok.Checked Then - Dim customDocName = If(txtSonstigesDokumentFehlt.Text, "").Trim() - If customDocName <> "" Then - Dim text = GetBackendVermerkText(25, "") - If text = "" Then - text = customDocName - Else - text = text.Replace("''", "'" & customDocName & "'") - If InStr(text, customDocName, CompareMethod.Text) = 0 Then - text &= " [" & customDocName & "]" - End If - End If - text = AppendSendungIfMissing(text, sendungsText) - insertSendungsVermerk(SendungID, AvisoID, text, 25) - End If - End If - - If cbxNichtLeserlich.Checked Then - Dim text = GetBackendVermerkText(42, If(cbxNichtLeserlich.Text, "").Trim()) - text = AppendSendungIfMissing(text, sendungsText) - If text <> "" Then - insertSendungsVermerk(SendungID, AvisoID, text, 42) - End If - End If - - Return True - Catch ex As Exception - MsgBox("Vermerk konnte nicht gespeichert werden: " & ex.Message, vbExclamation) - Return False - End Try - End Function - - Private Function GetSendungsAnzeigeText() As String - If SendungID <= 0 Then Return "KOMPLETT" - Try - Return _admin.getValueTxtBySql(" SELECT convert(varchar(2),[tblSnd_PosUnterNr]) +' - ' +isnull([tblSnd_Empfaenger],'') FROM tblSendungen WHERE [tblSnd_SendungID]=" & SendungID, "AVISO").Trim() - Catch - Return SendungID.ToString() - End Try - End Function - - Private Function GetBackendVermerkText(codeId As Integer, fallback As String) As String - If _backendBezeichnungByCodeId.ContainsKey(codeId) Then - Dim value = If(_backendBezeichnungByCodeId(codeId), "").Trim() - If value <> "" Then - Return value - End If - End If - Return If(fallback, "").Trim() - End Function - - Private Function AppendSendungIfMissing(text As String, sendungsText As String) As String - Dim value = If(text, "").Trim() - Dim snd = If(sendungsText, "").Trim() - If value = "" OrElse snd = "" Then Return value - If InStr(value, "sendung", CompareMethod.Text) > 0 Then Return value - Return value & " bei Sendung '" & snd & "'" - End Function - Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) Dim config = GetCustomerPortalApiConfig() @@ -1430,7 +1275,7 @@ Public Class frmSendungsDokumentanforderung Public Property NichtLeserlichChecked As Boolean Public Property CustomerUploadEmail As String Public Property CustomerUploadLanguage As String = "de" - Public Property CustomerUploadEmailText As String = "" + Public Property CustomerUploadEmailText As String = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." Public Property CustomerUploadValidityHours As Integer = 168 End Class End Class From 750ed3fbee979f115b342c0c6dd4d5f0e42505f7 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Tue, 24 Mar 2026 13:41:36 +0100 Subject: [PATCH 11/15] vermerke --- Aviso/Aviso.vbproj | 2 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 436 +++++- Aviso/frmAddSendungsvermerkShort.vb | 1406 +++++++++++++++++- Aviso/frmSendungsDokumentanforderung.vb | 269 ++-- 5 files changed, 1865 insertions(+), 252 deletions(-) diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 6491167..57e86fa 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -2239,4 +2239,4 @@ --> - \ No newline at end of file + diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 5d87ae2..e8298a3 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmAddSendungsvermerkShort.Designer.vb b/Aviso/frmAddSendungsvermerkShort.Designer.vb index 9e37c70..3dfc1f0 100644 --- a/Aviso/frmAddSendungsvermerkShort.Designer.vb +++ b/Aviso/frmAddSendungsvermerkShort.Designer.vb @@ -27,7 +27,22 @@ 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() @@ -45,18 +60,35 @@ 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() ' @@ -72,14 +104,20 @@ 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, 400) + Me.pnlMain.Size = New System.Drawing.Size(474, 790) Me.pnlMain.TabIndex = 0 ' 'pnlSendungsVermker ' Me.pnlSendungsVermker.BackColor = System.Drawing.Color.White Me.pnlSendungsVermker.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlSendungsVermker.Controls.Add(Me.PictureBox1) + Me.pnlSendungsVermker.Controls.Add(Me.pnlDocumentEditor) + Me.pnlSendungsVermker.Controls.Add(Me.flpDokumenteFehlenMain) + Me.pnlSendungsVermker.Controls.Add(Me.lblSonstigeVermerke) Me.pnlSendungsVermker.Controls.Add(Me.flpAngefordert) + Me.pnlSendungsVermker.Controls.Add(Me.Label5) + Me.pnlSendungsVermker.Controls.Add(Me.txtSonstigesDokumentFehlt) Me.pnlSendungsVermker.Controls.Add(Me.Label4) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_ATB) Me.pnlSendungsVermker.Controls.Add(Me.optFremd_SendungAvisiert) @@ -97,37 +135,208 @@ 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, 400) + Me.pnlSendungsVermker.Size = New System.Drawing.Size(474, 750) Me.pnlSendungsVermker.TabIndex = 0 ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke + Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.PictureBox1.Location = New System.Drawing.Point(0, 391) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(474, 1) + Me.PictureBox1.TabIndex = 124 + Me.PictureBox1.TabStop = False + ' + 'pnlDocumentEditor + ' + Me.pnlDocumentEditor.BackColor = System.Drawing.Color.WhiteSmoke + Me.pnlDocumentEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.pnlDocumentEditor.Controls.Add(Me.flpDocumentTabs) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorTitle) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorName) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.cmbDocumentEditorAnhangsart) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) + Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 135) + Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.TabIndex = 123 + ' + 'flpDocumentTabs + ' + Me.flpDocumentTabs.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDocumentTabs.AutoScroll = True + Me.flpDocumentTabs.BackColor = System.Drawing.Color.FromArgb(CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer), CType(CType(220, Byte), Integer)) + Me.flpDocumentTabs.Location = New System.Drawing.Point(1, 0) + Me.flpDocumentTabs.Name = "flpDocumentTabs" + Me.flpDocumentTabs.Size = New System.Drawing.Size(454, 39) + Me.flpDocumentTabs.TabIndex = 124 + Me.flpDocumentTabs.WrapContents = False + ' + 'lblDocumentEditorTitle + ' + Me.lblDocumentEditorTitle.AutoSize = True + Me.lblDocumentEditorTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblDocumentEditorTitle.Location = New System.Drawing.Point(7, 42) + Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" + Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) + Me.lblDocumentEditorTitle.TabIndex = 125 + Me.lblDocumentEditorTitle.Text = "Dokumentdetails" + ' + 'lblDocumentEditorName + ' + Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Name = "lblDocumentEditorName" + Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) + Me.lblDocumentEditorName.TabIndex = 126 + Me.lblDocumentEditorName.Text = "Dokumentname:" + ' + 'txtDocumentEditorName + ' + Me.txtDocumentEditorName.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.MaxLength = 120 + Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.TabIndex = 127 + ' + 'lblDocumentEditorAnhangsart + ' + Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" + Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) + Me.lblDocumentEditorAnhangsart.TabIndex = 128 + Me.lblDocumentEditorAnhangsart.Text = "Anhangsart:" + ' + 'cmbDocumentEditorAnhangsart + ' + Me.cmbDocumentEditorAnhangsart.BackColor = System.Drawing.Color.White + Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.TabIndex = 129 + ' + 'lblDocumentEditorInfo + ' + Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" + Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) + Me.lblDocumentEditorInfo.TabIndex = 130 + Me.lblDocumentEditorInfo.Text = "Dokument Info:" + ' + 'txtDocumentEditorInfo + ' + Me.txtDocumentEditorInfo.BackColor = System.Drawing.Color.White + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.MaxLength = 500 + Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.TabIndex = 131 + Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." + ' + 'lblDocumentEditorStatus + ' + Me.lblDocumentEditorStatus.AutoSize = True + Me.lblDocumentEditorStatus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.lblDocumentEditorStatus.Location = New System.Drawing.Point(7, 112) + Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" + Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) + Me.lblDocumentEditorStatus.TabIndex = 119 + Me.lblDocumentEditorStatus.Text = "Wählen Sie ein Dokument, um Name und Dokument Info anzupassen." + ' + 'flpDokumenteFehlenMain + ' + Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent + Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 23) + Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) + Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.TabIndex = 120 + ' + 'lblSonstigeVermerke + ' + Me.lblSonstigeVermerke.AutoSize = True + Me.lblSonstigeVermerke.BackColor = System.Drawing.Color.White + Me.lblSonstigeVermerke.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold) + Me.lblSonstigeVermerke.Location = New System.Drawing.Point(5, 393) + Me.lblSonstigeVermerke.Name = "lblSonstigeVermerke" + Me.lblSonstigeVermerke.Size = New System.Drawing.Size(150, 17) + Me.lblSonstigeVermerke.TabIndex = 121 + Me.lblSonstigeVermerke.Text = "Sonstige Vermerke:" + ' 'flpAngefordert ' Me.flpAngefordert.BackColor = System.Drawing.Color.White Me.flpAngefordert.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpAngefordert.Location = New System.Drawing.Point(12, 50) + Me.flpAngefordert.Location = New System.Drawing.Point(12, 414) Me.flpAngefordert.Margin = New System.Windows.Forms.Padding(0) Me.flpAngefordert.Name = "flpAngefordert" Me.flpAngefordert.Size = New System.Drawing.Size(450, 131) Me.flpAngefordert.TabIndex = 122 ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.BackColor = System.Drawing.Color.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, 268) + Me.Label4.Location = New System.Drawing.Point(12, 625) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(125, 17) Me.Label4.TabIndex = 96 @@ -137,7 +346,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_ATB.AutoSize = True Me.optFremd_ATB.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_ATB.Location = New System.Drawing.Point(13, 303) + Me.optFremd_ATB.Location = New System.Drawing.Point(13, 660) Me.optFremd_ATB.Name = "optFremd_ATB" Me.optFremd_ATB.Size = New System.Drawing.Size(130, 17) Me.optFremd_ATB.TabIndex = 94 @@ -148,7 +357,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFremd_SendungAvisiert.AutoSize = True Me.optFremd_SendungAvisiert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 286) + Me.optFremd_SendungAvisiert.Location = New System.Drawing.Point(13, 643) Me.optFremd_SendungAvisiert.Name = "optFremd_SendungAvisiert" Me.optFremd_SendungAvisiert.Size = New System.Drawing.Size(193, 17) Me.optFremd_SendungAvisiert.TabIndex = 93 @@ -160,7 +369,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, 194) + Me.lblErrSpedition.Location = New System.Drawing.Point(177, 551) Me.lblErrSpedition.Name = "lblErrSpedition" Me.lblErrSpedition.Size = New System.Drawing.Size(158, 13) Me.lblErrSpedition.TabIndex = 17 @@ -185,7 +394,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, 205) + Me.Label2.Location = New System.Drawing.Point(176, 562) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(57, 13) Me.Label2.TabIndex = 84 @@ -196,7 +405,7 @@ Partial Class frmAddSendungsvermerkShort Me.lblErrGrund.AutoSize = True Me.lblErrGrund.BackColor = System.Drawing.Color.WhiteSmoke Me.lblErrGrund.ForeColor = System.Drawing.Color.Red - Me.lblErrGrund.Location = New System.Drawing.Point(148, 257) + Me.lblErrGrund.Location = New System.Drawing.Point(148, 614) Me.lblErrGrund.Name = "lblErrGrund" Me.lblErrGrund.Size = New System.Drawing.Size(149, 13) Me.lblErrGrund.TabIndex = 26 @@ -235,7 +444,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, 215) + Me.txtSpedition.Location = New System.Drawing.Point(178, 572) Me.txtSpedition.MaxLength = 50 Me.txtSpedition.Name = "txtSpedition" Me.txtSpedition.Size = New System.Drawing.Size(126, 20) @@ -256,7 +465,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optSpeditionWeitergeleitet.AutoSize = True Me.optSpeditionWeitergeleitet.BackColor = System.Drawing.Color.WhiteSmoke - Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 215) + Me.optSpeditionWeitergeleitet.Location = New System.Drawing.Point(13, 572) Me.optSpeditionWeitergeleitet.Name = "optSpeditionWeitergeleitet" Me.optSpeditionWeitergeleitet.Size = New System.Drawing.Size(163, 17) Me.optSpeditionWeitergeleitet.TabIndex = 19 @@ -267,7 +476,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optFreierText.AutoSize = True Me.optFreierText.BackColor = System.Drawing.Color.WhiteSmoke - Me.optFreierText.Location = New System.Drawing.Point(13, 232) + Me.optFreierText.Location = New System.Drawing.Point(13, 589) Me.optFreierText.Name = "optFreierText" Me.optFreierText.Size = New System.Drawing.Size(105, 17) Me.optFreierText.TabIndex = 27 @@ -278,7 +487,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.optATAangefordert.AutoSize = True Me.optATAangefordert.BackColor = System.Drawing.Color.WhiteSmoke - Me.optATAangefordert.Location = New System.Drawing.Point(165, 303) + Me.optATAangefordert.Location = New System.Drawing.Point(165, 660) Me.optATAangefordert.Name = "optATAangefordert" Me.optATAangefordert.Size = New System.Drawing.Size(208, 17) Me.optATAangefordert.TabIndex = 15 @@ -289,7 +498,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.Label3.AutoSize = True Me.Label3.BackColor = System.Drawing.Color.WhiteSmoke - Me.Label3.Location = New System.Drawing.Point(309, 216) + Me.Label3.Location = New System.Drawing.Point(309, 573) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(57, 13) Me.Label3.TabIndex = 22 @@ -299,7 +508,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.lblErr240Zeichen.AutoSize = True Me.lblErr240Zeichen.ForeColor = System.Drawing.Color.Red - Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 332) + Me.lblErr240Zeichen.Location = New System.Drawing.Point(224, 689) Me.lblErr240Zeichen.Name = "lblErr240Zeichen" Me.lblErr240Zeichen.Size = New System.Drawing.Size(95, 13) Me.lblErr240Zeichen.TabIndex = 32 @@ -311,7 +520,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, 348) + Me.txtDetail.Location = New System.Drawing.Point(17, 705) Me.txtDetail.MaxLength = 240 Me.txtDetail.Multiline = True Me.txtDetail.Name = "txtDetail" @@ -321,10 +530,109 @@ 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, 331) + Me.lblZustzlFreitext.Location = New System.Drawing.Point(14, 688) Me.lblZustzlFreitext.Name = "lblZustzlFreitext" Me.lblZustzlFreitext.Size = New System.Drawing.Size(142, 13) Me.lblZustzlFreitext.TabIndex = 31 @@ -334,17 +642,28 @@ 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, 234) + Me.txtSendungSpedition.Location = New System.Drawing.Point(126, 591) 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, 348) + Me.btnOK.Location = New System.Drawing.Point(325, 705) Me.btnOK.Name = "btnOK" Me.btnOK.Size = New System.Drawing.Size(125, 41) Me.btnOK.TabIndex = 34 @@ -361,12 +680,23 @@ 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, 257) + Me.Label9.Location = New System.Drawing.Point(355, 614) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(90, 13) Me.Label9.TabIndex = 30 @@ -377,7 +707,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label17.AutoSize = True Me.Label17.BackColor = System.Drawing.Color.WhiteSmoke Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.0!, System.Drawing.FontStyle.Italic) - Me.Label17.Location = New System.Drawing.Point(145, 257) + Me.Label17.Location = New System.Drawing.Point(145, 614) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(182, 13) Me.Label17.TabIndex = 29 @@ -388,7 +718,7 @@ Partial Class frmAddSendungsvermerkShort Me.Label13.AutoSize = True Me.Label13.BackColor = System.Drawing.Color.WhiteSmoke Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label13.Location = New System.Drawing.Point(10, 196) + Me.Label13.Location = New System.Drawing.Point(10, 553) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(84, 17) Me.Label13.TabIndex = 16 @@ -398,22 +728,45 @@ Partial Class frmAddSendungsvermerkShort ' Me.txtFreierText.BackColor = System.Drawing.Color.WhiteSmoke Me.txtFreierText.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtFreierText.Location = New System.Drawing.Point(123, 230) + Me.txtFreierText.Location = New System.Drawing.Point(123, 587) 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, 190) + Me.PictureBox4.Location = New System.Drawing.Point(-1, 547) 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 @@ -428,7 +781,7 @@ Partial Class frmAddSendungsvermerkShort ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 400) + Me.ClientSize = New System.Drawing.Size(474, 750) Me.Controls.Add(Me.pnlMain) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) @@ -440,6 +793,10 @@ 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) @@ -448,6 +805,7 @@ 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 @@ -455,8 +813,10 @@ 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 @@ -464,9 +824,12 @@ 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 @@ -474,5 +837,28 @@ 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 fd6c042..2dc1600 100644 --- a/Aviso/frmAddSendungsvermerkShort.vb +++ b/Aviso/frmAddSendungsvermerkShort.vb @@ -1,4 +1,4 @@ - + Imports System.Configuration Imports System.IO Imports System.Net @@ -15,15 +15,26 @@ 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 @@ -40,7 +51,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() @@ -80,6 +91,19 @@ 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 @@ -93,6 +117,10 @@ 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 @@ -103,9 +131,6 @@ 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 & "" @@ -128,21 +153,52 @@ 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 - ' Private Sub btnAbbruch_Click(sender As System.Object, e As System.EventArgs) Handles btnAbbruch.Click - ' Me.Close() - ' End Sub + If txtDocumentEditorInfo IsNot Nothing Then + RemoveHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + AddHandler txtDocumentEditorInfo.TextChanged, AddressOf DocumentEditorInputChanged + End If + + EnsureAnhangsartenOptionsLoaded() + + If cmbDocumentEditorAnhangsart IsNot Nothing Then + RemoveHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + cmbDocumentEditorAnhangsart.BeginUpdate() + cmbDocumentEditorAnhangsart.Items.Clear() + For Each optionItem In _anhangsartenOptions + cmbDocumentEditorAnhangsart.Items.Add(optionItem) + Next + cmbDocumentEditorAnhangsart.EndUpdate() + AddHandler cmbDocumentEditorAnhangsart.SelectedIndexChanged, AddressOf DocumentEditorAnhangsartChanged + End If + + ClearDocumentEditor() + End Sub Private Sub SetupDynamicAnforderungCheckboxes() _anforderungCheckboxes.Clear() + _anhangsartIdByCheckbox.Clear() _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],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[FrontendBezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Try - dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") + dt = AvisoDAL.loadDataTableBySQL("SELECT [VermerkCodeId],[Bezeichnung],[AvisoAnhangsartId],[AnforderungBereich] FROM [VermerkeCodes] WHERE [Anforderung]=1 ORDER BY [Bezeichnung]") Catch Return End Try @@ -151,7 +207,9 @@ 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 @@ -172,6 +230,28 @@ 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 @@ -179,18 +259,25 @@ Public Class frmAddSendungsvermerkShort End If Catch End Try + _bereichByCodeId(id) = bereich - If bereich = BereichAngefordert Then - Dim cb As New CheckBox() - cb.Text = frontendBezeichnung - cb.Tag = id - cb.Margin = New Padding(0, 0, 4, 0) - + If bereich = BereichDokumentMain Then + cb.BackColor = Color.Transparent + cb.UseVisualStyleBackColor = False + ConfigureAnforderungCheckbox(cb, flpDokumenteFehlenMain) + flpDokumenteFehlenMain.Controls.Add(cb) + Else 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) @@ -201,13 +288,623 @@ Public Class frmAddSendungsvermerkShort Dim cols As Integer = 2 Dim colGap As Integer = 14 - Dim minCbWidth As Integer = 180 + 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 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 @@ -234,7 +931,8 @@ 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) @@ -245,31 +943,42 @@ Public Class frmAddSendungsvermerkShort End If For Each cb In _anforderungCheckboxes - 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() + If cb Is Nothing OrElse Not cb.Checked Then Continue For - Dim sendText = txtSendung.Text.Trim() - If text <> "" AndAlso sendText <> "" AndAlso InStr(text, "sendung", CompareMethod.Text) = 0 Then - text &= " bei Sendung '" & sendText & "'" - End If + Dim codeId As Integer + Try + codeId = CInt(cb.Tag) + Catch + Continue For + End Try - If text <> "" Then - insertSendungsVermerk(SendungID, myAviso.AvisoID, text, codeId) - End If - End If + 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) 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) @@ -348,6 +1057,7 @@ Public Class frmAddSendungsvermerkShort End Sub Sub showErr(l As Label) + lblErrDokument.Visible = False ' lblErrFach.Visible = False lblErrGrund.Visible = False ' lblErrSendungProbleme.Visible = False @@ -371,11 +1081,12 @@ Public Class frmAddSendungsvermerkShort ' optDokumente.Checked = True 'End Sub - Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) + Private Sub cbxAuftrag_CheckedChanged(sender As Object, e As EventArgs) Handles cbxSonstDok.CheckedChanged, cbxNichtLeserlich.CheckedChanged ' optDokumente.Checked = True End Sub - Private Sub SonstChanged(sender As Object, e As EventArgs) + Private Sub SonstChanged(sender As Object, e As EventArgs) Handles txtSonstigesDokumentFehlt.TextChanged ' 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 @@ -400,6 +1111,8 @@ Public Class frmAddSendungsvermerkShort txtSendung.SelectionLength = 0 txtFreierText.Focus() End Sub + + ' --- Dragging Logic --- Private drag As Boolean Private mouseX As Integer Private mouseY As Integer @@ -429,15 +1142,15 @@ Public Class frmAddSendungsvermerkShort End Sub Private Sub btnDokumtanforderung_Click(sender As Object, e As EventArgs) Handles btnDokumtanforderung.Click - 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) + _dokumentanforderungState = BuildDokumentanforderungState() + Using frm As New frmSendungsDokumentanforderung(AvisoID, SendungID, _dokumentanforderungState) If frm.ShowDialog(Me) = DialogResult.OK Then - frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) - Me.Close() + _dokumentanforderungState = frm.BuildState() + ApplyDokumentanforderungState(_dokumentanforderungState) + If InsertNurDokumentVermerk() Then + frmHauptfenster.avisoAktualisierenAktiveIdBehalten(myAviso.AvisoID) + Me.Close() + End If End If End Using End Sub @@ -450,4 +1163,601 @@ 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 1277d14..0288998 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -33,13 +33,11 @@ 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(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) + Public Sub New(avisoId As Integer, sendungId As Integer, state As DokumentanforderungState) InitializeComponent() - AvisoID = avisoIdValue - SendungID = sendungIdValue + AvisoID = avisoId + SendungID = sendungId Icon = cMeineFunktionenAVISO.GetProgrammIcon _stateToApply = If(state, New DokumentanforderungState()) End Sub @@ -47,7 +45,6 @@ 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") @@ -65,25 +62,17 @@ 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" @@ -91,13 +80,6 @@ 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" @@ -111,7 +93,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 @@ -133,11 +115,12 @@ Public Class frmSendungsDokumentanforderung End If If AvisoID > 0 Then - Dim aviso = AvisoDAL.LesenAviso(AvisoID, "") - If aviso IsNot Nothing Then - fraechterKdNr = ToIntSafe(aviso.Frächter_KdNr) + Dim dtAviso = AvisoDAL.loadDataTableBySQL("SELECT Frächter_KdNr, Auftraggeber_KdNr FROM tblAviso WHERE AvisoID = " & AvisoID) + If dtAviso IsNot Nothing AndAlso dtAviso.Rows.Count > 0 Then + Dim r = dtAviso.Rows(0) + fraechterKdNr = ToIntSafe(r("Frächter_KdNr")) If auftraggeberKdNr = 0 Then - auftraggeberKdNr = ToIntSafe(aviso.Auftraggeber_KdNr) + auftraggeberKdNr = ToIntSafe(r("Auftraggeber_KdNr")) End If End If End If @@ -151,111 +134,82 @@ 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 - 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) + dgvKontaktEmails.Rows.Add(row.Rolle, row.Art, row.Email) 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 - Dim firma = GetKundenFirma(kundenNr) - + + ' 1. E-Mails aus Kundenstammdaten laden (direkt von Datenbank) Try - Dim sql As String = "SELECT * FROM tblKundenKontakt WHERE kkd_KundenNr = " & kundenNr + Dim sql As String = "SELECT E_Mail, E_Mail2 FROM Adressen WHERE AdressenNr = " & kundenNr + Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) + Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) + Using reader = cmd.ExecuteReader() + If reader.Read() Then + Dim email1 = If(reader("E_Mail") Is DBNull.Value, "", reader("E_Mail").ToString().Trim()) + Dim email2 = If(reader("E_Mail2") Is DBNull.Value, "", reader("E_Mail2").ToString().Trim()) + + If email1 <> "" Then + For Each splitEmail In email1.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key1 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key1) Then + dedupe.Add(key1) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + + If email2 <> "" Then + For Each splitEmail In email2.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key2 = rolle & "|" & kundenNr.ToString() & "|Stammdaten|" & em.ToLowerInvariant() + If Not dedupe.Contains(key2) Then + dedupe.Add(key2) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = "Stammdaten", .Email = em}) + End If + Next + End If + End If + End Using + End Using + End Using + Catch + End Try + + ' 2. E-Mails aus E-Mail-Benachrichtigungen (Sendungsdetails) laden (direkt von Datenbank) + Try + Dim sql As String = "SELECT eb_ebartId, eb_EMail, eb_cc, eb_bcc FROM tblEmailBenachrichtigung WHERE eb_KundenNr = " & kundenNr Using conn As System.Data.SqlClient.SqlConnection = VERAG_PROG_ALLGEMEIN.cSqlDb.GetNewOpenConnectionFMZOLL(False) Using cmd As New System.Data.SqlClient.SqlCommand(sql, conn) Using reader = cmd.ExecuteReader() While reader.Read() - Dim 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 + Dim artId = If(reader("eb_ebartId") Is DBNull.Value, 0, Convert.ToInt32(reader("eb_ebartId"))) + Dim email = If(reader("eb_EMail") Is DBNull.Value, "", reader("eb_EMail").ToString().Trim()) + Dim isCc = If(reader("eb_cc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_cc"))) + Dim isBcc = If(reader("eb_bcc") Is DBNull.Value, False, Convert.ToBoolean(reader("eb_bcc"))) + + If email = "" Then Continue While + + Dim empfaengerArt = If(isBcc, "BCC", If(isCc, "CC", "AN")) + Dim artText = ResolveMailArtLabel(artId) & " / " & empfaengerArt + + For Each splitEmail In email.Split({";"c, ","c}, StringSplitOptions.RemoveEmptyEntries) + Dim em = splitEmail.Trim() + If em = "" Then Continue For + Dim key = rolle & "|" & kundenNr.ToString() & "|" & artText & "|" & em.ToLowerInvariant() + If Not dedupe.Contains(key) Then + dedupe.Add(key) + _kontaktEmailRows.Add(New KontaktEmailRow With {.Rolle = rolle, .Art = artText, .Email = em}) + End If Next End While End Using @@ -265,57 +219,21 @@ Public Class frmSendungsDokumentanforderung End Try End Sub - 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 + Private Function ResolveMailArtLabel(artId As Integer) As String + Select Case artId + Case 1 + Return "Ankunft" + Case 2 + Return "Freigabe" + Case 3 + Return "Ankunft Export" + Case 4 + Return "Freigabe Export" + Case 5 + Return "Status" + Case Else + Return "Unbekannt" + End Select End Function Private Function ToIntSafe(value As Object) As Integer @@ -1261,7 +1179,6 @@ 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 From df3c94aa95368df1535a1e9a2d299a26873093e1 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 26 Mar 2026 09:30:57 +0100 Subject: [PATCH 12/15] vermerke --- Aviso/Aviso.vbproj | 2 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmAddSendungsvermerkShort.Designer.vb | 436 +----- Aviso/frmAddSendungsvermerkShort.vb | 1406 +----------------- Aviso/frmSendungsDokumentanforderung.vb | 267 ++-- 5 files changed, 251 insertions(+), 1864 deletions(-) diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 57e86fa..6491167 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -2239,4 +2239,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 From 542f1fb144321f4672331fb585794aeb46534cba Mon Sep 17 00:00:00 2001 From: murad Date: Thu, 26 Mar 2026 16:43:27 +0100 Subject: [PATCH 13/15] vermerke update --- ...frmSendungsDokumentanforderung.Designer.vb | 142 ++++++++++----- Aviso/frmSendungsDokumentanforderung.vb | 165 +++++++++++++++++- 2 files changed, 254 insertions(+), 53 deletions(-) diff --git a/Aviso/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb index 38a1cd2..7ad328b 100644 --- a/Aviso/frmSendungsDokumentanforderung.Designer.vb +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -42,6 +42,8 @@ Partial Class frmSendungsDokumentanforderung Me.nudCustomerUploadValidityHours = New System.Windows.Forms.NumericUpDown() Me.cmbCustomerUploadLanguage = New System.Windows.Forms.ComboBox() Me.lblCustomerUploadLanguage = New System.Windows.Forms.Label() + Me.cmbCustomerUploadEmailTemplate = New System.Windows.Forms.ComboBox() + Me.lblCustomerUploadEmailTemplate = New System.Windows.Forms.Label() Me.txtCustomerUploadEmailText = New System.Windows.Forms.TextBox() Me.lblCustomerUploadEmailText = New System.Windows.Forms.Label() Me.btnVermerkSetzen = New System.Windows.Forms.Button() @@ -57,16 +59,18 @@ Partial Class frmSendungsDokumentanforderung ' Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(12, 34) + Me.flpDokumenteFehlenMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(18, 42) Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" - Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(450, 90) + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(675, 138) Me.flpDokumenteFehlenMain.TabIndex = 0 ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.Location = New System.Drawing.Point(12, 126) + Me.cbxSonstDok.Location = New System.Drawing.Point(18, 191) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 1 @@ -75,16 +79,19 @@ Partial Class frmSendungsDokumentanforderung ' 'txtSonstigesDokumentFehlt ' - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(95, 124) + Me.txtSonstigesDokumentFehlt.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(132, 189) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(198, 20) + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(336, 20) Me.txtSonstigesDokumentFehlt.TabIndex = 2 ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(308, 126) + Me.cbxNichtLeserlich.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(596, 191) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 3 @@ -95,7 +102,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblErrDokument.AutoSize = True Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(96, 146) + Me.lblErrDokument.Location = New System.Drawing.Point(133, 212) Me.lblErrDokument.Name = "lblErrDokument" Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) Me.lblErrDokument.TabIndex = 4 @@ -115,9 +122,11 @@ Partial Class frmSendungsDokumentanforderung Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) - Me.pnlDocumentEditor.Location = New System.Drawing.Point(6, 159) + Me.pnlDocumentEditor.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(9, 226) Me.pnlDocumentEditor.Name = "pnlDocumentEditor" - Me.pnlDocumentEditor.Size = New System.Drawing.Size(458, 134) + Me.pnlDocumentEditor.Size = New System.Drawing.Size(687, 201) Me.pnlDocumentEditor.TabIndex = 5 ' 'flpDocumentTabs @@ -128,7 +137,7 @@ Partial Class frmSendungsDokumentanforderung 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.Size = New System.Drawing.Size(683, 48) Me.flpDocumentTabs.TabIndex = 0 Me.flpDocumentTabs.WrapContents = False ' @@ -136,7 +145,7 @@ Partial Class frmSendungsDokumentanforderung ' 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.Location = New System.Drawing.Point(10, 56) Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) Me.lblDocumentEditorTitle.TabIndex = 1 @@ -145,7 +154,7 @@ Partial Class frmSendungsDokumentanforderung 'lblDocumentEditorName ' Me.lblDocumentEditorName.AutoSize = True - Me.lblDocumentEditorName.Location = New System.Drawing.Point(7, 64) + Me.lblDocumentEditorName.Location = New System.Drawing.Point(10, 87) Me.lblDocumentEditorName.Name = "lblDocumentEditorName" Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) Me.lblDocumentEditorName.TabIndex = 2 @@ -153,16 +162,16 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorName ' - Me.txtDocumentEditorName.Location = New System.Drawing.Point(109, 61) + Me.txtDocumentEditorName.Location = New System.Drawing.Point(155, 84) Me.txtDocumentEditorName.MaxLength = 120 Me.txtDocumentEditorName.Name = "txtDocumentEditorName" - Me.txtDocumentEditorName.Size = New System.Drawing.Size(128, 20) + Me.txtDocumentEditorName.Size = New System.Drawing.Size(206, 20) Me.txtDocumentEditorName.TabIndex = 3 ' 'lblDocumentEditorAnhangsart ' Me.lblDocumentEditorAnhangsart.AutoSize = True - Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(247, 64) + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(377, 87) Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) Me.lblDocumentEditorAnhangsart.TabIndex = 4 @@ -171,15 +180,15 @@ Partial Class frmSendungsDokumentanforderung 'cmbDocumentEditorAnhangsart ' Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(319, 61) + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(468, 84) Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" - Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(124, 21) + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(205, 21) Me.cmbDocumentEditorAnhangsart.TabIndex = 5 ' 'lblDocumentEditorInfo ' Me.lblDocumentEditorInfo.AutoSize = True - Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(7, 88) + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(10, 115) Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) Me.lblDocumentEditorInfo.TabIndex = 6 @@ -187,10 +196,10 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorInfo ' - Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(109, 85) + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(155, 112) Me.txtDocumentEditorInfo.MaxLength = 500 Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" - Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(334, 20) + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(518, 20) Me.txtDocumentEditorInfo.TabIndex = 7 Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." ' @@ -198,7 +207,7 @@ Partial Class frmSendungsDokumentanforderung ' 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.Location = New System.Drawing.Point(10, 151) Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) Me.lblDocumentEditorStatus.TabIndex = 8 @@ -208,7 +217,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(6, 298) + Me.Label5.Location = New System.Drawing.Point(9, 438) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 6 @@ -218,7 +227,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label20.AutoSize = True Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.Label20.Location = New System.Drawing.Point(216, 300) + Me.Label20.Location = New System.Drawing.Point(314, 442) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 7 @@ -227,9 +236,10 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(340, 321) + Me.btnCustomerUploadLink.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(553, 466) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" - Me.btnCustomerUploadLink.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadLink.TabIndex = 11 Me.btnCustomerUploadLink.Text = "Link kopieren" Me.btnCustomerUploadLink.UseVisualStyleBackColor = True @@ -237,25 +247,28 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(340, 346) + Me.btnCustomerUploadEmail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(553, 502) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" - Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(124, 23) + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadEmail.TabIndex = 13 Me.btnCustomerUploadEmail.Text = "E-Mail senden" Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True ' 'txtCustomerUploadEmail ' - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(82, 348) + Me.txtCustomerUploadEmail.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(132, 507) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" - Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(254, 20) + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(409, 20) Me.txtCustomerUploadEmail.TabIndex = 12 ' 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(6, 351) + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(9, 510) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 10 @@ -264,7 +277,7 @@ Partial Class frmSendungsDokumentanforderung 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(178, 325) + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 471) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 9 @@ -272,11 +285,11 @@ Partial Class frmSendungsDokumentanforderung ' 'nudCustomerUploadValidityHours ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 323) + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(352, 469) 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.Size = New System.Drawing.Size(110, 20) Me.nudCustomerUploadValidityHours.TabIndex = 10 Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) ' @@ -285,15 +298,15 @@ Partial Class frmSendungsDokumentanforderung Me.cmbCustomerUploadLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbCustomerUploadLanguage.FormattingEnabled = True Me.cmbCustomerUploadLanguage.Items.AddRange(New Object() {"de", "en", "tr", "sr", "bg"}) - Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(82, 322) + Me.cmbCustomerUploadLanguage.Location = New System.Drawing.Point(132, 469) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" - Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(80, 21) + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(108, 21) Me.cmbCustomerUploadLanguage.TabIndex = 9 ' 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(6, 325) + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(9, 472) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 8 @@ -301,28 +314,51 @@ Partial Class frmSendungsDokumentanforderung ' 'txtCustomerUploadEmailText ' - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(82, 374) + Me.txtCustomerUploadEmailText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(132, 570) Me.txtCustomerUploadEmailText.MaxLength = 500 Me.txtCustomerUploadEmailText.Multiline = True Me.txtCustomerUploadEmailText.Name = "txtCustomerUploadEmailText" Me.txtCustomerUploadEmailText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(254, 44) + Me.txtCustomerUploadEmailText.Size = New System.Drawing.Size(564, 50) Me.txtCustomerUploadEmailText.TabIndex = 14 - Me.txtCustomerUploadEmailText.Text = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." - ' + Me.txtCustomerUploadEmailText.Text = "" + ' 'lblCustomerUploadEmailText ' Me.lblCustomerUploadEmailText.AutoSize = True - Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(6, 377) + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(9, 573) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 15 Me.lblCustomerUploadEmailText.Text = "E-Mail Text:" ' + 'cmbCustomerUploadEmailTemplate + ' + Me.cmbCustomerUploadEmailTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbCustomerUploadEmailTemplate.FormattingEnabled = True + Me.cmbCustomerUploadEmailTemplate.Location = New System.Drawing.Point(132, 543) + Me.cmbCustomerUploadEmailTemplate.Name = "cmbCustomerUploadEmailTemplate" + Me.cmbCustomerUploadEmailTemplate.Size = New System.Drawing.Size(564, 21) + Me.cmbCustomerUploadEmailTemplate.TabIndex = 19 + Me.cmbCustomerUploadEmailTemplate.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + ' + 'lblCustomerUploadEmailTemplate + ' + Me.lblCustomerUploadEmailTemplate.AutoSize = True + Me.lblCustomerUploadEmailTemplate.Location = New System.Drawing.Point(9, 546) + Me.lblCustomerUploadEmailTemplate.Name = "lblCustomerUploadEmailTemplate" + Me.lblCustomerUploadEmailTemplate.Size = New System.Drawing.Size(63, 13) + Me.lblCustomerUploadEmailTemplate.TabIndex = 20 + Me.lblCustomerUploadEmailTemplate.Text = "Vorlage:" + ' 'lblKontaktEmails ' Me.lblKontaktEmails.AutoSize = True - Me.lblKontaktEmails.Location = New System.Drawing.Point(6, 427) + Me.lblKontaktEmails.Location = New System.Drawing.Point(9, 628) Me.lblKontaktEmails.Name = "lblKontaktEmails" Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) Me.lblKontaktEmails.TabIndex = 17 @@ -335,21 +371,25 @@ Partial Class frmSendungsDokumentanforderung Me.dgvKontaktEmails.AllowUserToResizeRows = False Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 445) + Me.dgvKontaktEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 647) Me.dgvKontaktEmails.MultiSelect = False Me.dgvKontaktEmails.Name = "dgvKontaktEmails" Me.dgvKontaktEmails.ReadOnly = True Me.dgvKontaktEmails.RowHeadersVisible = False Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvKontaktEmails.Size = New System.Drawing.Size(455, 84) + Me.dgvKontaktEmails.Size = New System.Drawing.Size(687, 170) Me.dgvKontaktEmails.TabIndex = 18 ' 'btnVermerkSetzen ' Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnVermerkSetzen.Location = New System.Drawing.Point(340, 535) + Me.btnVermerkSetzen.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnVermerkSetzen.Location = New System.Drawing.Point(553, 823) Me.btnVermerkSetzen.Name = "btnVermerkSetzen" - Me.btnVermerkSetzen.Size = New System.Drawing.Size(124, 30) + Me.btnVermerkSetzen.Size = New System.Drawing.Size(143, 36) Me.btnVermerkSetzen.TabIndex = 16 Me.btnVermerkSetzen.Text = "Vermerk setzen" Me.btnVermerkSetzen.UseVisualStyleBackColor = True @@ -358,7 +398,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblTitel.AutoSize = True Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTitel.Location = New System.Drawing.Point(9, 9) + Me.lblTitel.Location = New System.Drawing.Point(12, 14) Me.lblTitel.Name = "lblTitel" Me.lblTitel.Size = New System.Drawing.Size(156, 17) Me.lblTitel.TabIndex = 18 @@ -368,12 +408,15 @@ Partial Class frmSendungsDokumentanforderung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(474, 576) + Me.ClientSize = New System.Drawing.Size(711, 864) + Me.Controls.Add(Me.lblCustomerUploadEmailTemplate) + Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.dgvKontaktEmails) Me.Controls.Add(Me.lblKontaktEmails) Me.Controls.Add(Me.lblTitel) Me.Controls.Add(Me.btnVermerkSetzen) Me.Controls.Add(Me.lblCustomerUploadEmailText) + Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.txtCustomerUploadEmailText) Me.Controls.Add(Me.lblCustomerUploadLanguage) Me.Controls.Add(Me.cmbCustomerUploadLanguage) @@ -436,5 +479,8 @@ Partial Class frmSendungsDokumentanforderung Friend WithEvents btnVermerkSetzen As Button Friend WithEvents lblTitel As Label Friend WithEvents lblKontaktEmails As Label + Friend WithEvents cmbCustomerUploadEmailTemplate As ComboBox + Friend WithEvents lblCustomerUploadEmailTemplate As Label Friend WithEvents dgvKontaktEmails As DataGridView + End Class diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb index 1277d14..1ed4c40 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -6,9 +6,11 @@ Imports System.Text Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports VERAG_PROG_ALLGEMEIN +Imports AVISO.AvisoStatusFunctions Public Class frmSendungsDokumentanforderung Private ReadOnly AvisoDAL As New cAvisoDAL + Private ReadOnly _admin As New cADMIN Public Property AvisoID As Integer Public Property SendungID As Integer @@ -35,6 +37,7 @@ Public Class frmSendungsDokumentanforderung Private ReadOnly _kontaktEmailRows As New List(Of KontaktEmailRow) Private ReadOnly _kundenFirmaByNr As New Dictionary(Of Integer, String) Private _kontaktRolleTabs As TabControl + Private _emailTemplates As DataTable Public Sub New(ByVal avisoIdValue As Integer, ByVal sendungIdValue As Integer, state As DokumentanforderungState) InitializeComponent() @@ -60,11 +63,78 @@ Public Class frmSendungsDokumentanforderung InitializeDocumentEditor() SetupDynamicAnforderungCheckboxes() + LoadEmailTemplates() ApplyStateToUi(_stateToApply) InitializeKontaktEmailGrid() LoadKontaktEmails() End Sub + Private Sub LoadEmailTemplates() + Try + Dim sql As String = "SELECT [txt_Id], [txt_bezeichnung], [txt_sprache], [txt_text] FROM [tblTextkonserve] WHERE txt_kategorie = 'FRM_DOKUMENTANFORDERUNG_MailText' ORDER BY [txt_bezeichnung], [txt_sprache]" + _emailTemplates = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(sql, "FMZOLL", 1000, True) + + cmbCustomerUploadEmailTemplate.Items.Clear() + If _emailTemplates IsNot Nothing AndAlso _emailTemplates.Rows.Count > 0 Then + Dim bezeichnungen As New HashSet(Of String)() + For Each row As DataRow In _emailTemplates.Rows + Dim bezeichnung As String = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() + If bezeichnung <> "" AndAlso Not bezeichnungen.Contains(bezeichnung) Then + bezeichnungen.Add(bezeichnung) + cmbCustomerUploadEmailTemplate.Items.Add(bezeichnung) + End If + Next + End If + + If cmbCustomerUploadEmailTemplate.Items.Count > 0 Then + cmbCustomerUploadEmailTemplate.SelectedIndex = 0 + End If + Catch ex As Exception + ' Fehler beim Laden ignorieren, Vorlagen bleiben leer + End Try + End Sub + + Private Sub UpdateEmailText() + If _emailTemplates Is Nothing OrElse _emailTemplates.Rows.Count = 0 Then Return + + Dim selectedTemplate = If(cmbCustomerUploadEmailTemplate.SelectedItem, "").ToString() + Dim selectedLang = If(cmbCustomerUploadLanguage.SelectedItem, "").ToString().ToLowerInvariant() + If selectedLang = "" Then selectedLang = "de" + + If selectedTemplate <> "" Then + ' Suche nach passender Vorlage und Sprache + Dim foundText As String = "" + For Each row As DataRow In _emailTemplates.Rows + Dim bezeichnung = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() + Dim sprache = If(IsDBNull(row("txt_sprache")), "", CStr(row("txt_sprache"))).Trim().ToLowerInvariant() + + If String.Equals(bezeichnung, selectedTemplate, StringComparison.OrdinalIgnoreCase) Then + ' Wenn wir die genaue Sprache finden, nimm diese + If String.Equals(sprache, selectedLang, StringComparison.OrdinalIgnoreCase) Then + foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) + Exit For + End If + ' Fallback auf 'de' oder die erste gefundene Sprache, falls die gesuchte nicht existiert + If foundText = "" OrElse String.Equals(sprache, "de", StringComparison.OrdinalIgnoreCase) Then + foundText = If(IsDBNull(row("txt_text")), "", CStr(row("txt_text"))) + End If + End If + Next + + If foundText <> "" Then + txtCustomerUploadEmailText.Text = foundText.Replace("\n", vbCrLf) + End If + End If + End Sub + + Private Sub cmbCustomerUploadEmailTemplate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadEmailTemplate.SelectedIndexChanged + UpdateEmailText() + End Sub + + Private Sub cmbCustomerUploadLanguage_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCustomerUploadLanguage.SelectedIndexChanged + UpdateEmailText() + End Sub + Private Sub ResolveContextIds() If AvisoID > 0 AndAlso SendungID <> 0 Then Return @@ -435,10 +505,10 @@ Public Class frmSendungsDokumentanforderung Private Sub ConfigureAnforderungCheckbox(cb As CheckBox, container As Control) cb.AutoSize = False - cb.Height = 18 - Dim usableWidth = Math.Max(120, container.Width - 20) - Dim cbWidth = CInt(Math.Floor((usableWidth - 4) / 3)) - cb.Width = Math.Max(80, Math.Min(cbWidth, 220)) + cb.Height = 24 + Dim usableWidth = Math.Max(180, container.Width - 24) + Dim cbWidth = CInt(Math.Floor((usableWidth - 12) / 4)) + cb.Width = Math.Max(120, Math.Min(cbWidth, 320)) End Sub Private Sub DocumentEditorInputChanged(sender As Object, e As EventArgs) @@ -788,10 +858,95 @@ Public Class frmSendungsDokumentanforderung txtSonstigesDokumentFehlt.Focus() Exit Sub End If + If Not SaveSelectedVermerke() Then + Exit Sub + End If DialogResult = DialogResult.OK Close() End Sub + Private Function SaveSelectedVermerke() As Boolean + Try + If AvisoID <= 0 Then + MsgBox("Aviso konnte nicht ermittelt werden.", vbExclamation) + Return False + End If + + Dim sendungsText = GetSendungsAnzeigeText() + + 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 codeId <= 0 Then Continue For + + Dim text = GetBackendVermerkText(codeId, If(cb.Text, "").Trim()) + If text = "" Then Continue For + text = AppendSendungIfMissing(text, sendungsText) + + insertSendungsVermerk(SendungID, AvisoID, text, codeId) + Next + + If cbxSonstDok.Checked Then + Dim customDocName = If(txtSonstigesDokumentFehlt.Text, "").Trim() + If customDocName <> "" Then + Dim text = GetBackendVermerkText(25, "") + If text = "" Then + text = customDocName + Else + text = text.Replace("''", "'" & customDocName & "'") + If InStr(text, customDocName, CompareMethod.Text) = 0 Then + text &= " [" & customDocName & "]" + End If + End If + text = AppendSendungIfMissing(text, sendungsText) + insertSendungsVermerk(SendungID, AvisoID, text, 25) + End If + End If + + If cbxNichtLeserlich.Checked Then + Dim text = GetBackendVermerkText(42, If(cbxNichtLeserlich.Text, "").Trim()) + text = AppendSendungIfMissing(text, sendungsText) + If text <> "" Then + insertSendungsVermerk(SendungID, AvisoID, text, 42) + End If + End If + + Return True + Catch ex As Exception + MsgBox("Vermerk konnte nicht gespeichert werden: " & ex.Message, vbExclamation) + Return False + End Try + End Function + + Private Function GetSendungsAnzeigeText() As String + If SendungID <= 0 Then Return "KOMPLETT" + Try + Return _admin.getValueTxtBySql(" SELECT convert(varchar(2),[tblSnd_PosUnterNr]) +' - ' +isnull([tblSnd_Empfaenger],'') FROM tblSendungen WHERE [tblSnd_SendungID]=" & SendungID, "AVISO").Trim() + Catch + Return SendungID.ToString() + End Try + End Function + + Private Function GetBackendVermerkText(codeId As Integer, fallback As String) As String + If _backendBezeichnungByCodeId.ContainsKey(codeId) Then + Dim value = If(_backendBezeichnungByCodeId(codeId), "").Trim() + If value <> "" Then + Return value + End If + End If + Return If(fallback, "").Trim() + End Function + + Private Function AppendSendungIfMissing(text As String, sendungsText As String) As String + Dim value = If(text, "").Trim() + Dim snd = If(sendungsText, "").Trim() + If value = "" OrElse snd = "" Then Return value + If InStr(value, "sendung", CompareMethod.Text) > 0 Then Return value + Return value & " bei Sendung '" & snd & "'" + End Function + Private Sub btnCustomerUploadLink_Click(sender As Object, e As EventArgs) Handles btnCustomerUploadLink.Click Dim validityHours = CInt(nudCustomerUploadValidityHours.Value) Dim config = GetCustomerPortalApiConfig() @@ -1275,7 +1430,7 @@ Public Class frmSendungsDokumentanforderung Public Property NichtLeserlichChecked As Boolean Public Property CustomerUploadEmail As String Public Property CustomerUploadLanguage As String = "de" - Public Property CustomerUploadEmailText As String = "Bitte laden Sie die angeforderten Dokumente über den Link hoch." + Public Property CustomerUploadEmailText As String = "" Public Property CustomerUploadValidityHours As Integer = 168 End Class End Class From e6df74906bb9699b3be55bf9c78cb44291adaf9a Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 30 Apr 2026 09:09:06 +0200 Subject: [PATCH 14/15] vermerke --- Aviso/My Project/AssemblyInfo.vb | 4 +- ...frmSendungsDokumentanforderung.Designer.vb | 69 +------------------ 2 files changed, 3 insertions(+), 70 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 5d87ae2..b036dad 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/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb index 7ad328b..c12db1d 100644 --- a/Aviso/frmSendungsDokumentanforderung.Designer.vb +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -59,18 +59,13 @@ Partial Class frmSendungsDokumentanforderung ' Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown - Me.flpDokumenteFehlenMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(18, 42) Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" - Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(675, 138) Me.flpDokumenteFehlenMain.TabIndex = 0 ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True - Me.cbxSonstDok.Location = New System.Drawing.Point(18, 191) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 1 @@ -79,19 +74,13 @@ Partial Class frmSendungsDokumentanforderung ' 'txtSonstigesDokumentFehlt ' - Me.txtSonstigesDokumentFehlt.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(132, 189) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" - Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(336, 20) Me.txtSonstigesDokumentFehlt.TabIndex = 2 ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True - Me.cbxNichtLeserlich.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.cbxNichtLeserlich.Location = New System.Drawing.Point(596, 191) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 3 @@ -102,7 +91,6 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblErrDokument.AutoSize = True Me.lblErrDokument.ForeColor = System.Drawing.Color.Red - Me.lblErrDokument.Location = New System.Drawing.Point(133, 212) Me.lblErrDokument.Name = "lblErrDokument" Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) Me.lblErrDokument.TabIndex = 4 @@ -122,11 +110,7 @@ Partial Class frmSendungsDokumentanforderung Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) - Me.pnlDocumentEditor.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.pnlDocumentEditor.Location = New System.Drawing.Point(9, 226) Me.pnlDocumentEditor.Name = "pnlDocumentEditor" - Me.pnlDocumentEditor.Size = New System.Drawing.Size(687, 201) Me.pnlDocumentEditor.TabIndex = 5 ' 'flpDocumentTabs @@ -137,7 +121,6 @@ Partial Class frmSendungsDokumentanforderung 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(683, 48) Me.flpDocumentTabs.TabIndex = 0 Me.flpDocumentTabs.WrapContents = False ' @@ -145,7 +128,6 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 56) Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) Me.lblDocumentEditorTitle.TabIndex = 1 @@ -154,7 +136,6 @@ Partial Class frmSendungsDokumentanforderung 'lblDocumentEditorName ' Me.lblDocumentEditorName.AutoSize = True - Me.lblDocumentEditorName.Location = New System.Drawing.Point(10, 87) Me.lblDocumentEditorName.Name = "lblDocumentEditorName" Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) Me.lblDocumentEditorName.TabIndex = 2 @@ -162,16 +143,13 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorName ' - Me.txtDocumentEditorName.Location = New System.Drawing.Point(155, 84) Me.txtDocumentEditorName.MaxLength = 120 Me.txtDocumentEditorName.Name = "txtDocumentEditorName" - Me.txtDocumentEditorName.Size = New System.Drawing.Size(206, 20) Me.txtDocumentEditorName.TabIndex = 3 ' 'lblDocumentEditorAnhangsart ' Me.lblDocumentEditorAnhangsart.AutoSize = True - Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(377, 87) Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) Me.lblDocumentEditorAnhangsart.TabIndex = 4 @@ -180,15 +158,12 @@ Partial Class frmSendungsDokumentanforderung 'cmbDocumentEditorAnhangsart ' Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(468, 84) Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" - Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(205, 21) Me.cmbDocumentEditorAnhangsart.TabIndex = 5 ' 'lblDocumentEditorInfo ' Me.lblDocumentEditorInfo.AutoSize = True - Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(10, 115) Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) Me.lblDocumentEditorInfo.TabIndex = 6 @@ -196,10 +171,8 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorInfo ' - Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(155, 112) Me.txtDocumentEditorInfo.MaxLength = 500 Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" - Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(518, 20) Me.txtDocumentEditorInfo.TabIndex = 7 Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." ' @@ -207,7 +180,6 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 151) Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) Me.lblDocumentEditorStatus.TabIndex = 8 @@ -217,7 +189,6 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label5.Location = New System.Drawing.Point(9, 438) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 6 @@ -227,7 +198,6 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label20.AutoSize = True Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) - Me.Label20.Location = New System.Drawing.Point(314, 442) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 7 @@ -236,10 +206,7 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadLink.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCustomerUploadLink.Location = New System.Drawing.Point(553, 466) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" - Me.btnCustomerUploadLink.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadLink.TabIndex = 11 Me.btnCustomerUploadLink.Text = "Link kopieren" Me.btnCustomerUploadLink.UseVisualStyleBackColor = True @@ -247,28 +214,20 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnCustomerUploadEmail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(553, 502) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" - Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadEmail.TabIndex = 13 Me.btnCustomerUploadEmail.Text = "E-Mail senden" Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True ' 'txtCustomerUploadEmail ' - Me.txtCustomerUploadEmail.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(132, 507) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" - Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(409, 20) Me.txtCustomerUploadEmail.TabIndex = 12 ' 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True - Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(9, 510) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 10 @@ -277,7 +236,6 @@ Partial Class frmSendungsDokumentanforderung 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True - Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 471) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 9 @@ -285,11 +243,9 @@ Partial Class frmSendungsDokumentanforderung ' 'nudCustomerUploadValidityHours ' - Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(352, 469) 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(110, 20) Me.nudCustomerUploadValidityHours.TabIndex = 10 Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) ' @@ -298,15 +254,12 @@ Partial Class frmSendungsDokumentanforderung 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(132, 469) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" - Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(108, 21) Me.cmbCustomerUploadLanguage.TabIndex = 9 ' 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True - Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(9, 472) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 8 @@ -314,22 +267,15 @@ Partial Class frmSendungsDokumentanforderung ' 'txtCustomerUploadEmailText ' - Me.txtCustomerUploadEmailText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(132, 570) 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(564, 50) Me.txtCustomerUploadEmailText.TabIndex = 14 - Me.txtCustomerUploadEmailText.Text = "" - ' + ' 'lblCustomerUploadEmailText ' Me.lblCustomerUploadEmailText.AutoSize = True - Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(9, 573) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 15 @@ -358,7 +304,6 @@ Partial Class frmSendungsDokumentanforderung 'lblKontaktEmails ' Me.lblKontaktEmails.AutoSize = True - Me.lblKontaktEmails.Location = New System.Drawing.Point(9, 628) Me.lblKontaktEmails.Name = "lblKontaktEmails" Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) Me.lblKontaktEmails.TabIndex = 17 @@ -371,25 +316,17 @@ Partial Class frmSendungsDokumentanforderung Me.dgvKontaktEmails.AllowUserToResizeRows = False Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvKontaktEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 647) Me.dgvKontaktEmails.MultiSelect = False Me.dgvKontaktEmails.Name = "dgvKontaktEmails" Me.dgvKontaktEmails.ReadOnly = True Me.dgvKontaktEmails.RowHeadersVisible = False Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvKontaktEmails.Size = New System.Drawing.Size(687, 170) Me.dgvKontaktEmails.TabIndex = 18 ' 'btnVermerkSetzen ' Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnVermerkSetzen.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnVermerkSetzen.Location = New System.Drawing.Point(553, 823) Me.btnVermerkSetzen.Name = "btnVermerkSetzen" - Me.btnVermerkSetzen.Size = New System.Drawing.Size(143, 36) Me.btnVermerkSetzen.TabIndex = 16 Me.btnVermerkSetzen.Text = "Vermerk setzen" Me.btnVermerkSetzen.UseVisualStyleBackColor = True @@ -398,7 +335,6 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblTitel.AutoSize = True Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblTitel.Location = New System.Drawing.Point(12, 14) Me.lblTitel.Name = "lblTitel" Me.lblTitel.Size = New System.Drawing.Size(156, 17) Me.lblTitel.TabIndex = 18 @@ -408,9 +344,6 @@ Partial Class frmSendungsDokumentanforderung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(711, 864) - Me.Controls.Add(Me.lblCustomerUploadEmailTemplate) - Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.dgvKontaktEmails) Me.Controls.Add(Me.lblKontaktEmails) Me.Controls.Add(Me.lblTitel) From 222153f19eb78a274e084ed9cb56474a2a17d445 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 30 Apr 2026 09:26:04 +0200 Subject: [PATCH 15/15] update vermerke --- Aviso/My Project/AssemblyInfo.vb | 4 +- ...frmSendungsDokumentanforderung.Designer.vb | 69 ++++++++++++++++++- Aviso/frmSendungsDokumentanforderung.vb | 4 +- 3 files changed, 72 insertions(+), 5 deletions(-) diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index b036dad..0b15f2d 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/frmSendungsDokumentanforderung.Designer.vb b/Aviso/frmSendungsDokumentanforderung.Designer.vb index c12db1d..7ad328b 100644 --- a/Aviso/frmSendungsDokumentanforderung.Designer.vb +++ b/Aviso/frmSendungsDokumentanforderung.Designer.vb @@ -59,13 +59,18 @@ Partial Class frmSendungsDokumentanforderung ' Me.flpDokumenteFehlenMain.BackColor = System.Drawing.Color.Transparent Me.flpDokumenteFehlenMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.flpDokumenteFehlenMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.flpDokumenteFehlenMain.Location = New System.Drawing.Point(18, 42) Me.flpDokumenteFehlenMain.Margin = New System.Windows.Forms.Padding(0) Me.flpDokumenteFehlenMain.Name = "flpDokumenteFehlenMain" + Me.flpDokumenteFehlenMain.Size = New System.Drawing.Size(675, 138) Me.flpDokumenteFehlenMain.TabIndex = 0 ' 'cbxSonstDok ' Me.cbxSonstDok.AutoSize = True + Me.cbxSonstDok.Location = New System.Drawing.Point(18, 191) Me.cbxSonstDok.Name = "cbxSonstDok" Me.cbxSonstDok.Size = New System.Drawing.Size(83, 17) Me.cbxSonstDok.TabIndex = 1 @@ -74,13 +79,19 @@ Partial Class frmSendungsDokumentanforderung ' 'txtSonstigesDokumentFehlt ' + Me.txtSonstigesDokumentFehlt.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtSonstigesDokumentFehlt.Location = New System.Drawing.Point(132, 189) Me.txtSonstigesDokumentFehlt.MaxLength = 80 Me.txtSonstigesDokumentFehlt.Name = "txtSonstigesDokumentFehlt" + Me.txtSonstigesDokumentFehlt.Size = New System.Drawing.Size(336, 20) Me.txtSonstigesDokumentFehlt.TabIndex = 2 ' 'cbxNichtLeserlich ' Me.cbxNichtLeserlich.AutoSize = True + Me.cbxNichtLeserlich.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.cbxNichtLeserlich.Location = New System.Drawing.Point(596, 191) Me.cbxNichtLeserlich.Name = "cbxNichtLeserlich" Me.cbxNichtLeserlich.Size = New System.Drawing.Size(90, 17) Me.cbxNichtLeserlich.TabIndex = 3 @@ -91,6 +102,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblErrDokument.AutoSize = True Me.lblErrDokument.ForeColor = System.Drawing.Color.Red + Me.lblErrDokument.Location = New System.Drawing.Point(133, 212) Me.lblErrDokument.Name = "lblErrDokument" Me.lblErrDokument.Size = New System.Drawing.Size(157, 13) Me.lblErrDokument.TabIndex = 4 @@ -110,7 +122,11 @@ Partial Class frmSendungsDokumentanforderung Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.txtDocumentEditorInfo) Me.pnlDocumentEditor.Controls.Add(Me.lblDocumentEditorStatus) + Me.pnlDocumentEditor.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.pnlDocumentEditor.Location = New System.Drawing.Point(9, 226) Me.pnlDocumentEditor.Name = "pnlDocumentEditor" + Me.pnlDocumentEditor.Size = New System.Drawing.Size(687, 201) Me.pnlDocumentEditor.TabIndex = 5 ' 'flpDocumentTabs @@ -121,6 +137,7 @@ Partial Class frmSendungsDokumentanforderung 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(683, 48) Me.flpDocumentTabs.TabIndex = 0 Me.flpDocumentTabs.WrapContents = False ' @@ -128,6 +145,7 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 56) Me.lblDocumentEditorTitle.Name = "lblDocumentEditorTitle" Me.lblDocumentEditorTitle.Size = New System.Drawing.Size(101, 13) Me.lblDocumentEditorTitle.TabIndex = 1 @@ -136,6 +154,7 @@ Partial Class frmSendungsDokumentanforderung 'lblDocumentEditorName ' Me.lblDocumentEditorName.AutoSize = True + Me.lblDocumentEditorName.Location = New System.Drawing.Point(10, 87) Me.lblDocumentEditorName.Name = "lblDocumentEditorName" Me.lblDocumentEditorName.Size = New System.Drawing.Size(85, 13) Me.lblDocumentEditorName.TabIndex = 2 @@ -143,13 +162,16 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorName ' + Me.txtDocumentEditorName.Location = New System.Drawing.Point(155, 84) Me.txtDocumentEditorName.MaxLength = 120 Me.txtDocumentEditorName.Name = "txtDocumentEditorName" + Me.txtDocumentEditorName.Size = New System.Drawing.Size(206, 20) Me.txtDocumentEditorName.TabIndex = 3 ' 'lblDocumentEditorAnhangsart ' Me.lblDocumentEditorAnhangsart.AutoSize = True + Me.lblDocumentEditorAnhangsart.Location = New System.Drawing.Point(377, 87) Me.lblDocumentEditorAnhangsart.Name = "lblDocumentEditorAnhangsart" Me.lblDocumentEditorAnhangsart.Size = New System.Drawing.Size(64, 13) Me.lblDocumentEditorAnhangsart.TabIndex = 4 @@ -158,12 +180,15 @@ Partial Class frmSendungsDokumentanforderung 'cmbDocumentEditorAnhangsart ' Me.cmbDocumentEditorAnhangsart.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbDocumentEditorAnhangsart.Location = New System.Drawing.Point(468, 84) Me.cmbDocumentEditorAnhangsart.Name = "cmbDocumentEditorAnhangsart" + Me.cmbDocumentEditorAnhangsart.Size = New System.Drawing.Size(205, 21) Me.cmbDocumentEditorAnhangsart.TabIndex = 5 ' 'lblDocumentEditorInfo ' Me.lblDocumentEditorInfo.AutoSize = True + Me.lblDocumentEditorInfo.Location = New System.Drawing.Point(10, 115) Me.lblDocumentEditorInfo.Name = "lblDocumentEditorInfo" Me.lblDocumentEditorInfo.Size = New System.Drawing.Size(80, 13) Me.lblDocumentEditorInfo.TabIndex = 6 @@ -171,8 +196,10 @@ Partial Class frmSendungsDokumentanforderung ' 'txtDocumentEditorInfo ' + Me.txtDocumentEditorInfo.Location = New System.Drawing.Point(155, 112) Me.txtDocumentEditorInfo.MaxLength = 500 Me.txtDocumentEditorInfo.Name = "txtDocumentEditorInfo" + Me.txtDocumentEditorInfo.Size = New System.Drawing.Size(518, 20) Me.txtDocumentEditorInfo.TabIndex = 7 Me.txtDocumentEditorInfo.Text = "Bitte das Dokument hochladen." ' @@ -180,6 +207,7 @@ Partial Class frmSendungsDokumentanforderung ' 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(10, 151) Me.lblDocumentEditorStatus.Name = "lblDocumentEditorStatus" Me.lblDocumentEditorStatus.Size = New System.Drawing.Size(339, 13) Me.lblDocumentEditorStatus.TabIndex = 8 @@ -189,6 +217,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label5.AutoSize = True Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label5.Location = New System.Drawing.Point(9, 438) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(202, 17) Me.Label5.TabIndex = 6 @@ -198,6 +227,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.Label20.AutoSize = True Me.Label20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(102, Byte), Integer), CType(CType(153, Byte), Integer)) + Me.Label20.Location = New System.Drawing.Point(314, 442) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(207, 13) Me.Label20.TabIndex = 7 @@ -206,7 +236,10 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadLink ' Me.btnCustomerUploadLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadLink.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadLink.Location = New System.Drawing.Point(553, 466) Me.btnCustomerUploadLink.Name = "btnCustomerUploadLink" + Me.btnCustomerUploadLink.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadLink.TabIndex = 11 Me.btnCustomerUploadLink.Text = "Link kopieren" Me.btnCustomerUploadLink.UseVisualStyleBackColor = True @@ -214,20 +247,28 @@ Partial Class frmSendungsDokumentanforderung 'btnCustomerUploadEmail ' Me.btnCustomerUploadEmail.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCustomerUploadEmail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCustomerUploadEmail.Location = New System.Drawing.Point(553, 502) Me.btnCustomerUploadEmail.Name = "btnCustomerUploadEmail" + Me.btnCustomerUploadEmail.Size = New System.Drawing.Size(143, 30) Me.btnCustomerUploadEmail.TabIndex = 13 Me.btnCustomerUploadEmail.Text = "E-Mail senden" Me.btnCustomerUploadEmail.UseVisualStyleBackColor = True ' 'txtCustomerUploadEmail ' + Me.txtCustomerUploadEmail.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmail.Location = New System.Drawing.Point(132, 507) Me.txtCustomerUploadEmail.MaxLength = 255 Me.txtCustomerUploadEmail.Name = "txtCustomerUploadEmail" + Me.txtCustomerUploadEmail.Size = New System.Drawing.Size(409, 20) Me.txtCustomerUploadEmail.TabIndex = 12 ' 'lblCustomerUploadEmail ' Me.lblCustomerUploadEmail.AutoSize = True + Me.lblCustomerUploadEmail.Location = New System.Drawing.Point(9, 510) Me.lblCustomerUploadEmail.Name = "lblCustomerUploadEmail" Me.lblCustomerUploadEmail.Size = New System.Drawing.Size(54, 13) Me.lblCustomerUploadEmail.TabIndex = 10 @@ -236,6 +277,7 @@ Partial Class frmSendungsDokumentanforderung 'lblCustomerUploadValidityHours ' Me.lblCustomerUploadValidityHours.AutoSize = True + Me.lblCustomerUploadValidityHours.Location = New System.Drawing.Point(262, 471) Me.lblCustomerUploadValidityHours.Name = "lblCustomerUploadValidityHours" Me.lblCustomerUploadValidityHours.Size = New System.Drawing.Size(66, 13) Me.lblCustomerUploadValidityHours.TabIndex = 9 @@ -243,9 +285,11 @@ Partial Class frmSendungsDokumentanforderung ' 'nudCustomerUploadValidityHours ' + Me.nudCustomerUploadValidityHours.Location = New System.Drawing.Point(352, 469) 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(110, 20) Me.nudCustomerUploadValidityHours.TabIndex = 10 Me.nudCustomerUploadValidityHours.Value = New Decimal(New Integer() {168, 0, 0, 0}) ' @@ -254,12 +298,15 @@ Partial Class frmSendungsDokumentanforderung 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(132, 469) Me.cmbCustomerUploadLanguage.Name = "cmbCustomerUploadLanguage" + Me.cmbCustomerUploadLanguage.Size = New System.Drawing.Size(108, 21) Me.cmbCustomerUploadLanguage.TabIndex = 9 ' 'lblCustomerUploadLanguage ' Me.lblCustomerUploadLanguage.AutoSize = True + Me.lblCustomerUploadLanguage.Location = New System.Drawing.Point(9, 472) Me.lblCustomerUploadLanguage.Name = "lblCustomerUploadLanguage" Me.lblCustomerUploadLanguage.Size = New System.Drawing.Size(72, 13) Me.lblCustomerUploadLanguage.TabIndex = 8 @@ -267,15 +314,22 @@ Partial Class frmSendungsDokumentanforderung ' 'txtCustomerUploadEmailText ' + Me.txtCustomerUploadEmailText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtCustomerUploadEmailText.Location = New System.Drawing.Point(132, 570) 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(564, 50) Me.txtCustomerUploadEmailText.TabIndex = 14 - ' + Me.txtCustomerUploadEmailText.Text = "" + ' 'lblCustomerUploadEmailText ' Me.lblCustomerUploadEmailText.AutoSize = True + Me.lblCustomerUploadEmailText.Location = New System.Drawing.Point(9, 573) Me.lblCustomerUploadEmailText.Name = "lblCustomerUploadEmailText" Me.lblCustomerUploadEmailText.Size = New System.Drawing.Size(63, 13) Me.lblCustomerUploadEmailText.TabIndex = 15 @@ -304,6 +358,7 @@ Partial Class frmSendungsDokumentanforderung 'lblKontaktEmails ' Me.lblKontaktEmails.AutoSize = True + Me.lblKontaktEmails.Location = New System.Drawing.Point(9, 628) Me.lblKontaktEmails.Name = "lblKontaktEmails" Me.lblKontaktEmails.Size = New System.Drawing.Size(245, 13) Me.lblKontaktEmails.TabIndex = 17 @@ -316,17 +371,25 @@ Partial Class frmSendungsDokumentanforderung Me.dgvKontaktEmails.AllowUserToResizeRows = False Me.dgvKontaktEmails.BackgroundColor = System.Drawing.Color.White Me.dgvKontaktEmails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvKontaktEmails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dgvKontaktEmails.Location = New System.Drawing.Point(9, 647) Me.dgvKontaktEmails.MultiSelect = False Me.dgvKontaktEmails.Name = "dgvKontaktEmails" Me.dgvKontaktEmails.ReadOnly = True Me.dgvKontaktEmails.RowHeadersVisible = False Me.dgvKontaktEmails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgvKontaktEmails.Size = New System.Drawing.Size(687, 170) Me.dgvKontaktEmails.TabIndex = 18 ' 'btnVermerkSetzen ' Me.btnVermerkSetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnVermerkSetzen.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnVermerkSetzen.Location = New System.Drawing.Point(553, 823) Me.btnVermerkSetzen.Name = "btnVermerkSetzen" + Me.btnVermerkSetzen.Size = New System.Drawing.Size(143, 36) Me.btnVermerkSetzen.TabIndex = 16 Me.btnVermerkSetzen.Text = "Vermerk setzen" Me.btnVermerkSetzen.UseVisualStyleBackColor = True @@ -335,6 +398,7 @@ Partial Class frmSendungsDokumentanforderung ' Me.lblTitel.AutoSize = True Me.lblTitel.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblTitel.Location = New System.Drawing.Point(12, 14) Me.lblTitel.Name = "lblTitel" Me.lblTitel.Size = New System.Drawing.Size(156, 17) Me.lblTitel.TabIndex = 18 @@ -344,6 +408,9 @@ Partial Class frmSendungsDokumentanforderung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(711, 864) + Me.Controls.Add(Me.lblCustomerUploadEmailTemplate) + Me.Controls.Add(Me.cmbCustomerUploadEmailTemplate) Me.Controls.Add(Me.dgvKontaktEmails) Me.Controls.Add(Me.lblKontaktEmails) Me.Controls.Add(Me.lblTitel) diff --git a/Aviso/frmSendungsDokumentanforderung.vb b/Aviso/frmSendungsDokumentanforderung.vb index 1ed4c40..97dbee4 100644 --- a/Aviso/frmSendungsDokumentanforderung.vb +++ b/Aviso/frmSendungsDokumentanforderung.vb @@ -85,7 +85,7 @@ Public Class frmSendungsDokumentanforderung End If Next End If - + If cmbCustomerUploadEmailTemplate.Items.Count > 0 Then cmbCustomerUploadEmailTemplate.SelectedIndex = 0 End If @@ -107,7 +107,7 @@ Public Class frmSendungsDokumentanforderung For Each row As DataRow In _emailTemplates.Rows Dim bezeichnung = If(IsDBNull(row("txt_bezeichnung")), "", CStr(row("txt_bezeichnung"))).Trim() Dim sprache = If(IsDBNull(row("txt_sprache")), "", CStr(row("txt_sprache"))).Trim().ToLowerInvariant() - + If String.Equals(bezeichnung, selectedTemplate, StringComparison.OrdinalIgnoreCase) Then ' Wenn wir die genaue Sprache finden, nimm diese If String.Equals(sprache, selectedLang, StringComparison.OrdinalIgnoreCase) Then