From 834ef647d045143956f31ee3ed8cbf6b1efcacf1 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Mon, 3 Apr 2023 14:36:37 +0200 Subject: [PATCH] =?UTF-8?q?Bei=20mehreren=20Anh=C3=A4ngen=20in=20VM=20kann?= =?UTF-8?q?=20nun=20derjenige,=20die=20"direkt"=20verkn=C3=BCpft=20werden?= =?UTF-8?q?=20soll,=20markiert=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERAGAddIn/VERAGAddIn.vbproj | 6 +- VERAGAddIn/app.config | 24 +- .../frmAvisoFormularAnfügen.Designer.vb | 233 +++++++++++------- VERAGAddIn/frmAvisoFormularAnfügen.vb | 91 ++++++- VERAGAddIn/rbnVERAG.vb | 3 +- 5 files changed, 241 insertions(+), 116 deletions(-) diff --git a/VERAGAddIn/VERAGAddIn.vbproj b/VERAGAddIn/VERAGAddIn.vbproj index 6f2c7d6..76f1e9c 100644 --- a/VERAGAddIn/VERAGAddIn.vbproj +++ b/VERAGAddIn/VERAGAddIn.vbproj @@ -36,7 +36,7 @@ \\ftps.verag.ag\g\ftp\programme\VERAGAddin\ http://ftps.verag.ag/VERAGAddin/ de - 1.0.1.97 + 1.0.1.98 true true 0 @@ -271,6 +271,7 @@ rbnVERAG.vb + Always @@ -387,6 +388,9 @@ false + + Ich habe keine Ahnung, was ich hier mache.pfx + diff --git a/VERAGAddIn/app.config b/VERAGAddIn/app.config index b430818..6321ee1 100644 --- a/VERAGAddIn/app.config +++ b/VERAGAddIn/app.config @@ -1,23 +1,27 @@ - + - - + + - - + + - - + + - - + + + + + + - + diff --git a/VERAGAddIn/frmAvisoFormularAnfügen.Designer.vb b/VERAGAddIn/frmAvisoFormularAnfügen.Designer.vb index 9a01e0c..1c3aa0b 100644 --- a/VERAGAddIn/frmAvisoFormularAnfügen.Designer.vb +++ b/VERAGAddIn/frmAvisoFormularAnfügen.Designer.vb @@ -26,24 +26,109 @@ Partial Class frmAvisoFormularAnfuegen Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAvisoFormularAnfuegen)) - Me.lblKunden = New System.Windows.Forms.Label() - Me.btnOK = New System.Windows.Forms.Button() - Me.KdSearchBox = New VERAG_PROG_ALLGEMEIN.KdSearchBox() - Me.btnCancel = New System.Windows.Forms.Button() - Me.cbVMTypen = New VERAG_PROG_ALLGEMEIN.MyComboBox() - Me.MyPanel1 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) - Me.MyPanel2 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) - Me.lblVMId = New System.Windows.Forms.Label() - Me.UsrCntlKundenZollVollmachten1 = New SDL.usrCntlKundenZollVollmachten() + Me.lblMultiAttachements = New System.Windows.Forms.Label() Me.dgvAnhaenge = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.columnName = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.UsrCntlKundenZollVollmachten1 = New SDL.usrCntlKundenZollVollmachten() + Me.MyPanel2 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) + Me.lblWarning = New System.Windows.Forms.Label() + Me.lblVMId = New System.Windows.Forms.Label() + Me.lblKunden = New System.Windows.Forms.Label() + Me.KdSearchBox = New VERAG_PROG_ALLGEMEIN.KdSearchBox() + Me.cbVMTypen = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.MyPanel1 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) Me.pbAnhaenge = New System.Windows.Forms.PictureBox() - Me.MyPanel1.SuspendLayout() - Me.MyPanel2.SuspendLayout() + Me.btnOK = New System.Windows.Forms.Button() + Me.btnCancel = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).BeginInit() + Me.MyPanel2.SuspendLayout() + Me.MyPanel1.SuspendLayout() CType(Me.pbAnhaenge, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' + 'lblMultiAttachements + ' + Me.lblMultiAttachements.AutoSize = True + Me.lblMultiAttachements.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblMultiAttachements.ForeColor = System.Drawing.Color.Red + Me.lblMultiAttachements.Location = New System.Drawing.Point(9, 465) + Me.lblMultiAttachements.Name = "lblMultiAttachements" + Me.lblMultiAttachements.Size = New System.Drawing.Size(342, 13) + Me.lblMultiAttachements.TabIndex = 38 + Me.lblMultiAttachements.Text = "Anhang markieren, der explizit als PDF-Anhang gespeichert werden soll" + ' + 'dgvAnhaenge + ' + Me.dgvAnhaenge.AKTUALISIERUNGS_INTERVALL = -1 + Me.dgvAnhaenge.AllowUserToAddRows = False + Me.dgvAnhaenge.AllowUserToDeleteRows = False + Me.dgvAnhaenge.AllowUserToResizeColumns = False + Me.dgvAnhaenge.AllowUserToResizeRows = False + Me.dgvAnhaenge.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.dgvAnhaenge.BackgroundColor = System.Drawing.Color.White + Me.dgvAnhaenge.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvAnhaenge.ColumnHeadersVisible = False + Me.dgvAnhaenge.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.columnName}) + Me.dgvAnhaenge.Location = New System.Drawing.Point(0, 483) + Me.dgvAnhaenge.Name = "dgvAnhaenge" + Me.dgvAnhaenge.ReadOnly = True + Me.dgvAnhaenge.RowHeadersVisible = False + Me.dgvAnhaenge.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgvAnhaenge.Size = New System.Drawing.Size(514, 36) + Me.dgvAnhaenge.TabIndex = 39 + Me.dgvAnhaenge.Visible = False + ' + 'columnName + ' + Me.columnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.columnName.HeaderText = "Name" + Me.columnName.Name = "columnName" + Me.columnName.ReadOnly = True + ' + 'UsrCntlKundenZollVollmachten1 + ' + Me.UsrCntlKundenZollVollmachten1.Location = New System.Drawing.Point(0, 120) + Me.UsrCntlKundenZollVollmachten1.Name = "UsrCntlKundenZollVollmachten1" + Me.UsrCntlKundenZollVollmachten1.Size = New System.Drawing.Size(514, 342) + Me.UsrCntlKundenZollVollmachten1.TabIndex = 38 + ' + 'MyPanel2 + ' + Me.MyPanel2.Controls.Add(Me.Label1) + Me.MyPanel2.Controls.Add(Me.lblWarning) + Me.MyPanel2.Controls.Add(Me.lblVMId) + Me.MyPanel2.Controls.Add(Me.lblKunden) + Me.MyPanel2.Controls.Add(Me.KdSearchBox) + Me.MyPanel2.Controls.Add(Me.cbVMTypen) + Me.MyPanel2.Dock = System.Windows.Forms.DockStyle.Top + Me.MyPanel2.Location = New System.Drawing.Point(0, 0) + Me.MyPanel2.Name = "MyPanel2" + Me.MyPanel2.Size = New System.Drawing.Size(521, 114) + Me.MyPanel2.TabIndex = 37 + ' + 'lblWarning + ' + Me.lblWarning.AutoSize = True + Me.lblWarning.ForeColor = System.Drawing.Color.Red + Me.lblWarning.Location = New System.Drawing.Point(80, 9) + Me.lblWarning.Name = "lblWarning" + Me.lblWarning.Size = New System.Drawing.Size(0, 13) + Me.lblWarning.TabIndex = 37 + ' + 'lblVMId + ' + Me.lblVMId.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.lblVMId.AutoSize = True + Me.lblVMId.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblVMId.Location = New System.Drawing.Point(12, 61) + Me.lblVMId.Name = "lblVMId" + Me.lblVMId.Size = New System.Drawing.Size(69, 13) + Me.lblVMId.TabIndex = 36 + Me.lblVMId.Text = "Vollmacht-Art" + ' 'lblKunden ' Me.lblKunden.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -55,17 +140,6 @@ Partial Class frmAvisoFormularAnfuegen Me.lblKunden.TabIndex = 2 Me.lblKunden.Text = "Kunden" ' - 'btnOK - ' - Me.btnOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK - Me.btnOK.Location = New System.Drawing.Point(409, 65) - Me.btnOK.Name = "btnOK" - Me.btnOK.Size = New System.Drawing.Size(105, 40) - Me.btnOK.TabIndex = 3 - Me.btnOK.Text = "Ok" - Me.btnOK.UseVisualStyleBackColor = True - ' 'KdSearchBox ' Me.KdSearchBox._AlleFirmenCLUSTER = False @@ -77,6 +151,7 @@ Partial Class frmAvisoFormularAnfuegen Me.KdSearchBox._displayWoelflKd = False Me.KdSearchBox._hideIfListEmpty = True Me.KdSearchBox._loadKdData = True + Me.KdSearchBox._searchName1 = True Me.KdSearchBox._UseFIRMA = "" Me.KdSearchBox._ValueKdAndName = True Me.KdSearchBox.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -96,17 +171,6 @@ Partial Class frmAvisoFormularAnfuegen Me.KdSearchBox.TIMER_SEARCH = True Me.KdSearchBox.usrcntl = Nothing ' - 'btnCancel - ' - Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(3, 67) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(116, 40) - Me.btnCancel.TabIndex = 31 - Me.btnCancel.Text = "Abbrechen" - Me.btnCancel.UseVisualStyleBackColor = True - ' 'cbVMTypen ' Me.cbVMTypen._allowedValuesFreiText = Nothing @@ -131,65 +195,6 @@ Partial Class frmAvisoFormularAnfuegen Me.MyPanel1.Size = New System.Drawing.Size(521, 108) Me.MyPanel1.TabIndex = 36 ' - 'MyPanel2 - ' - Me.MyPanel2.Controls.Add(Me.lblVMId) - Me.MyPanel2.Controls.Add(Me.lblKunden) - Me.MyPanel2.Controls.Add(Me.KdSearchBox) - Me.MyPanel2.Controls.Add(Me.cbVMTypen) - Me.MyPanel2.Dock = System.Windows.Forms.DockStyle.Top - Me.MyPanel2.Location = New System.Drawing.Point(0, 0) - Me.MyPanel2.Name = "MyPanel2" - Me.MyPanel2.Size = New System.Drawing.Size(521, 114) - Me.MyPanel2.TabIndex = 37 - ' - 'lblVMId - ' - Me.lblVMId.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.lblVMId.AutoSize = True - Me.lblVMId.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblVMId.Location = New System.Drawing.Point(12, 61) - Me.lblVMId.Name = "lblVMId" - Me.lblVMId.Size = New System.Drawing.Size(69, 13) - Me.lblVMId.TabIndex = 36 - Me.lblVMId.Text = "Vollmacht-Art" - ' - 'UsrCntlKundenZollVollmachten1 - ' - Me.UsrCntlKundenZollVollmachten1.Location = New System.Drawing.Point(0, 120) - Me.UsrCntlKundenZollVollmachten1.Name = "UsrCntlKundenZollVollmachten1" - Me.UsrCntlKundenZollVollmachten1.Size = New System.Drawing.Size(514, 355) - Me.UsrCntlKundenZollVollmachten1.TabIndex = 38 - ' - 'dgvAnhaenge - ' - Me.dgvAnhaenge.AKTUALISIERUNGS_INTERVALL = -1 - Me.dgvAnhaenge.AllowUserToAddRows = False - Me.dgvAnhaenge.AllowUserToDeleteRows = False - Me.dgvAnhaenge.AllowUserToResizeColumns = False - Me.dgvAnhaenge.AllowUserToResizeRows = False - Me.dgvAnhaenge.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.dgvAnhaenge.BackgroundColor = System.Drawing.Color.White - Me.dgvAnhaenge.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvAnhaenge.ColumnHeadersVisible = False - Me.dgvAnhaenge.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.columnName}) - Me.dgvAnhaenge.Location = New System.Drawing.Point(0, 483) - Me.dgvAnhaenge.Name = "dgvAnhaenge" - Me.dgvAnhaenge.ReadOnly = True - Me.dgvAnhaenge.RowHeadersVisible = False - Me.dgvAnhaenge.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvAnhaenge.Size = New System.Drawing.Size(514, 36) - Me.dgvAnhaenge.TabIndex = 39 - Me.dgvAnhaenge.Visible = False - ' - 'columnName - ' - Me.columnName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.columnName.HeaderText = "Name" - Me.columnName.Name = "columnName" - Me.columnName.ReadOnly = True - ' 'pbAnhaenge ' Me.pbAnhaenge.Enabled = False @@ -201,12 +206,46 @@ Partial Class frmAvisoFormularAnfuegen Me.pbAnhaenge.TabIndex = 32 Me.pbAnhaenge.TabStop = False ' + 'btnOK + ' + Me.btnOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK + Me.btnOK.Location = New System.Drawing.Point(409, 65) + Me.btnOK.Name = "btnOK" + Me.btnOK.Size = New System.Drawing.Size(105, 40) + Me.btnOK.TabIndex = 3 + Me.btnOK.Text = "Ok" + Me.btnOK.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(3, 67) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(116, 40) + Me.btnCancel.TabIndex = 31 + Me.btnCancel.Text = "Abbrechen" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label1.ForeColor = System.Drawing.Color.Red + Me.Label1.Location = New System.Drawing.Point(407, 4) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(100, 20) + Me.Label1.TabIndex = 38 + Me.Label1.Text = "Testsystem" + ' 'frmAvisoFormularAnfuegen ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.White Me.ClientSize = New System.Drawing.Size(521, 631) + Me.Controls.Add(Me.lblMultiAttachements) Me.Controls.Add(Me.dgvAnhaenge) Me.Controls.Add(Me.UsrCntlKundenZollVollmachten1) Me.Controls.Add(Me.MyPanel2) @@ -214,13 +253,14 @@ Partial Class frmAvisoFormularAnfuegen Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "frmAvisoFormularAnfuegen" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Formular anfügen" - Me.MyPanel1.ResumeLayout(False) + Me.Text = "Vollmacht anfügen" + CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).EndInit() Me.MyPanel2.ResumeLayout(False) Me.MyPanel2.PerformLayout() - CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).EndInit() + Me.MyPanel1.ResumeLayout(False) CType(Me.pbAnhaenge, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) + Me.PerformLayout() End Sub Friend WithEvents lblKunden As Windows.Forms.Label @@ -235,4 +275,7 @@ Partial Class frmAvisoFormularAnfuegen Friend WithEvents UsrCntlKundenZollVollmachten1 As SDL.usrCntlKundenZollVollmachten Friend WithEvents dgvAnhaenge As VERAG_PROG_ALLGEMEIN.MyDatagridview Friend WithEvents columnName As Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents lblWarning As Windows.Forms.Label + Friend WithEvents lblMultiAttachements As Windows.Forms.Label + Friend WithEvents Label1 As Windows.Forms.Label End Class diff --git a/VERAGAddIn/frmAvisoFormularAnfügen.vb b/VERAGAddIn/frmAvisoFormularAnfügen.vb index 61e4fb9..1c971d5 100644 --- a/VERAGAddIn/frmAvisoFormularAnfügen.vb +++ b/VERAGAddIn/frmAvisoFormularAnfügen.vb @@ -1,4 +1,5 @@ -Imports System.Data +Imports System.Collections +Imports System.Data Imports System.Drawing Imports System.Windows.Forms Imports System.Windows.Forms.VisualStyles.VisualStyleElement.Button @@ -30,11 +31,13 @@ Public Class frmAvisoFormularAnfuegen InitializeComponent() Me.Bezeichnung = Bezeichnung + End Sub Private Sub frmAvisoFormularAnfuegen_Load(sender As Object, e As EventArgs) Handles MyBase.Load + KdSearchBox.initKdBox(Me) initAttachment() If hasAnhaenge Then pbAnhaenge.Image = My.Resources.pdf @@ -61,7 +64,7 @@ Public Class frmAvisoFormularAnfuegen End Sub Sub initVollmachtarten(kdNr As Integer) - cbVMTypen.fillWithSQL("SELECT DISTINCT(art.kdvma_Id), art.kdvma_Bezeichnung FROM [tblKundenVollmachtenArt] as art LEFT JOIN (select * from [tblKundenVollmachten] where [kdvm_KundenNr]='" & kdNr & "' ) as abf on art.[kdvma_Id]=abf.[kdvm_kdvmaId] WHERE art.kdvma_visible=1 AND art.kdvma_Firma='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "'", False, "FMZOLL", False) + cbVMTypen.fillWithSQL("SELECT DISTINCT(art.kdvma_Id), art.kdvma_Bezeichnung FROM [tblKundenVollmachtenArt] as art LEFT JOIN (select * from [tblKundenVollmachten] where [kdvm_KundenNr]='" & kdNr & "' ) as abf on art.[kdvma_Id]=abf.[kdvm_kdvmaId] WHERE art.kdvma_visible=1 AND art.kdvma_Firma='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "'", False, "FMZOLL", True) End Sub @@ -82,16 +85,21 @@ Public Class frmAvisoFormularAnfuegen End If End Sub - Private Sub cbVMTypen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbVMTypen.SelectedIndexChanged - - vollmachtartId = cbVMTypen._value - initUsrCntrlKundenvollmachten(vollmachtartId) - + Private Sub cbVMTypen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbVMTypen.SelectedValueChanged + If cbVMTypen._value <> "" Then + vollmachtartId = cbVMTypen._value + initUsrCntrlKundenvollmachten(vollmachtartId) + End If End Sub Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click + If Not checkMandatoryFields() Then + DialogResult = DialogResult.None + Exit Sub + End If + If Not hasAnhaenge Then If Not vbYes = MsgBox("Diese Email besitzt keinen Anhang!" & vbCrLf & "Soll die Email denoch gespeichert werden?", vbYesNoCancel) Then @@ -100,6 +108,16 @@ Public Class frmAvisoFormularAnfuegen Exit Sub End If End If + + + Dim i = dgvAnhaenge.SelectedCells.Item(0).RowIndex + If i > 0 Then + + AddAttachmentOnLastIndex(ATT, i) + + End If + + UsrCntlKundenZollVollmachten1.btnNeu_Click(sender, e) vollmachtId = UsrCntlKundenZollVollmachten1.vmId @@ -107,6 +125,19 @@ Public Class frmAvisoFormularAnfuegen End Sub + + Private Sub AddAttachmentOnLastIndex(ByRef a As List(Of String), tmpIndex As Integer) + If (a IsNot Nothing) AndAlso (a.Count > 1) Then + Dim list As New List(Of String) + list = a + Dim selectedItem As Object = list.Item(tmpIndex) + list.Add(selectedItem) + list.RemoveAt(tmpIndex) 'immer die letzte PDF-DatenarchivID wird als PDF-Verknüpfung angezeigt!!!!! + + a = list + End If + End Sub + Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click Close() End Sub @@ -119,6 +150,7 @@ Public Class frmAvisoFormularAnfuegen Else hasAnhaenge = True PDF_MAIL = "PDF_DATENSERVER" + For Each a In ATT Dim display = a If a.Contains("\") Then @@ -128,10 +160,53 @@ Public Class frmAvisoFormularAnfuegen dgvAnhaenge.Rows.Add({display}) Next End If + + If dgvAnhaenge.Rows.Count >= 2 Then + + dgvAnhaenge.Visible = True + lblMultiAttachements.Visible = True + Me.Size = New Size(537, 720) + dgvAnhaenge.Size = New Size(514, 86) + Else + dgvAnhaenge.Visible = False + lblMultiAttachements.Visible = False + dgvAnhaenge.Size = New Size(514, 36) + Me.Size = New Size(537, 670) + End If + dgvAnhaenge.ClearSelection() End Sub - Private Sub pbMail_Click(sender As Object, e As EventArgs) + Private Function checkMandatoryFields() As Boolean + + + Dim valid = False + + If KdSearchBox.KdNr_value = -1 Then + lblWarning.Text = "Kunde auswählen!" + Return valid + End If + + If cbVMTypen._value = "" Then + lblWarning.Text = "Vollmachttyp auswählen" + Return valid + End If + + If UsrCntlKundenZollVollmachten1.txtGueltigVon.Text = "" Then + lblWarning.Text = "Gültig von-Datum hinterlegen!" + Return valid + End If + + + lblWarning.Text = "" + valid = True + Return valid + + End Function + + Private Sub frmAvisoFormularAnfuegen_Shown(sender As Object, e As EventArgs) Handles Me.Shown + KdSearchBox.Focus() + Label1.Visible = cAllgemein.TESTSYSTEM End Sub End Class \ No newline at end of file diff --git a/VERAGAddIn/rbnVERAG.vb b/VERAGAddIn/rbnVERAG.vb index 9d862cc..88cba67 100644 --- a/VERAGAddIn/rbnVERAG.vb +++ b/VERAGAddIn/rbnVERAG.vb @@ -35,8 +35,7 @@ Public Class VERAGRibbon Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load - 'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False - VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True + cAllgemein.TESTSYSTEM = False LOGIN_OK = AVISO_Mail_Functions.initFirmaUser() End Sub