Sendungsdetails, AVISOTV

This commit is contained in:
2024-04-24 11:10:29 +02:00
parent 62b35fb9f1
commit e44cd63d74
3 changed files with 336 additions and 110 deletions

View File

@@ -22,6 +22,7 @@ Partial Class frmEintragTV
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.btnOK = New System.Windows.Forms.Button()
Me.btnAbbruch = New System.Windows.Forms.Button()
Me.Label7 = New System.Windows.Forms.Label()
@@ -31,11 +32,23 @@ Partial Class frmEintragTV
Me.txtZeile2 = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.btnAdd = New System.Windows.Forms.Button()
Me.btnDelete = New System.Windows.Forms.Button()
Me.pnlTop = New System.Windows.Forms.Panel()
Me.txtSuche = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label18 = New System.Windows.Forms.Label()
Me.lblWarning = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.cbxStandort = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.dgvAVISOTV = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.pnlTop.SuspendLayout()
CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(152, 142)
Me.btnOK.Location = New System.Drawing.Point(326, 555)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(80, 40)
Me.btnOK.TabIndex = 2
@@ -44,7 +57,7 @@ Partial Class frmEintragTV
'
'btnAbbruch
'
Me.btnAbbruch.Location = New System.Drawing.Point(260, 142)
Me.btnAbbruch.Location = New System.Drawing.Point(434, 555)
Me.btnAbbruch.Name = "btnAbbruch"
Me.btnAbbruch.Size = New System.Drawing.Size(80, 40)
Me.btnAbbruch.TabIndex = 3
@@ -54,7 +67,7 @@ Partial Class frmEintragTV
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(14, 66)
Me.Label7.Location = New System.Drawing.Point(188, 479)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(42, 13)
Me.Label7.TabIndex = 20
@@ -62,7 +75,7 @@ Partial Class frmEintragTV
'
'txtZeile1
'
Me.txtZeile1.Location = New System.Drawing.Point(62, 63)
Me.txtZeile1.Location = New System.Drawing.Point(236, 476)
Me.txtZeile1.MaxLength = 40
Me.txtZeile1.Name = "txtZeile1"
Me.txtZeile1.Size = New System.Drawing.Size(321, 20)
@@ -72,7 +85,7 @@ Partial Class frmEintragTV
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(14, 24)
Me.Label1.Location = New System.Drawing.Point(188, 437)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(349, 13)
Me.Label1.TabIndex = 20
@@ -81,7 +94,7 @@ Partial Class frmEintragTV
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(14, 89)
Me.Label4.Location = New System.Drawing.Point(188, 502)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(42, 13)
Me.Label4.TabIndex = 20
@@ -89,7 +102,7 @@ Partial Class frmEintragTV
'
'txtZeile2
'
Me.txtZeile2.Location = New System.Drawing.Point(62, 86)
Me.txtZeile2.Location = New System.Drawing.Point(236, 499)
Me.txtZeile2.MaxLength = 40
Me.txtZeile2.Name = "txtZeile2"
Me.txtZeile2.Size = New System.Drawing.Size(321, 20)
@@ -98,7 +111,7 @@ Partial Class frmEintragTV
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(389, 66)
Me.Label2.Location = New System.Drawing.Point(563, 479)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(92, 13)
Me.Label2.TabIndex = 20
@@ -107,19 +120,149 @@ Partial Class frmEintragTV
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(388, 89)
Me.Label3.Location = New System.Drawing.Point(562, 502)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(92, 13)
Me.Label3.TabIndex = 20
Me.Label3.Text = "(max. 40 Zeichen)"
'
'btnAdd
'
Me.btnAdd.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAdd.Location = New System.Drawing.Point(815, 390)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(10, 20)
Me.btnAdd.TabIndex = 107
Me.btnAdd.UseVisualStyleBackColor = True
'
'btnDelete
'
Me.btnDelete.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnDelete.Location = New System.Drawing.Point(838, 390)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(10, 20)
Me.btnDelete.TabIndex = 106
Me.btnDelete.UseVisualStyleBackColor = True
'
'pnlTop
'
Me.pnlTop.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.pnlTop.Controls.Add(Me.txtSuche)
Me.pnlTop.Controls.Add(Me.Label18)
Me.pnlTop.Controls.Add(Me.lblWarning)
Me.pnlTop.Controls.Add(Me.Label5)
Me.pnlTop.Controls.Add(Me.Label6)
Me.pnlTop.Controls.Add(Me.cbxStandort)
Me.pnlTop.Dock = System.Windows.Forms.DockStyle.Top
Me.pnlTop.Location = New System.Drawing.Point(0, 0)
Me.pnlTop.Name = "pnlTop"
Me.pnlTop.Size = New System.Drawing.Size(855, 48)
Me.pnlTop.TabIndex = 105
'
'txtSuche
'
Me.txtSuche._DateTimeOnly = False
Me.txtSuche._numbersOnly = False
Me.txtSuche._numbersOnlyKommastellen = ""
Me.txtSuche._numbersOnlyTrennzeichen = True
Me.txtSuche._Prozent = False
Me.txtSuche._ShortDateNew = False
Me.txtSuche._ShortDateOnly = False
Me.txtSuche._TimeOnly = False
Me.txtSuche._TimeOnly_Seconds = False
Me.txtSuche._value = Nothing
Me.txtSuche._Waehrung = False
Me.txtSuche._WaehrungZeichen = False
Me.txtSuche.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtSuche.ForeColor = System.Drawing.Color.Black
Me.txtSuche.Location = New System.Drawing.Point(380, 18)
Me.txtSuche.MaxLineLength = -1
Me.txtSuche.MaxLines_Warning = ""
Me.txtSuche.MaxLines_Warning_Label = Nothing
Me.txtSuche.Name = "txtSuche"
Me.txtSuche.Size = New System.Drawing.Size(314, 20)
Me.txtSuche.TabIndex = 34
'
'Label18
'
Me.Label18.AutoSize = True
Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label18.ForeColor = System.Drawing.Color.White
Me.Label18.Location = New System.Drawing.Point(377, 3)
Me.Label18.Name = "Label18"
Me.Label18.Size = New System.Drawing.Size(43, 13)
Me.Label18.TabIndex = 33
Me.Label18.Text = "Suche"
'
'lblWarning
'
Me.lblWarning.AutoSize = True
Me.lblWarning.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblWarning.ForeColor = System.Drawing.Color.Red
Me.lblWarning.Location = New System.Drawing.Point(166, 13)
Me.lblWarning.Name = "lblWarning"
Me.lblWarning.Size = New System.Drawing.Size(0, 13)
Me.lblWarning.TabIndex = 14
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 16.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.ForeColor = System.Drawing.Color.White
Me.Label5.Location = New System.Drawing.Point(10, 13)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(121, 26)
Me.Label5.TabIndex = 0
Me.Label5.Text = "AVISO TV"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.ForeColor = System.Drawing.Color.White
Me.Label6.Location = New System.Drawing.Point(717, 2)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(55, 13)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Standort"
'
'cbxStandort
'
Me.cbxStandort._allowedValuesFreiText = Nothing
Me.cbxStandort._allowFreiText = False
Me.cbxStandort._value = ""
Me.cbxStandort.DropDownWidth = 150
Me.cbxStandort.FormattingEnabled = True
Me.cbxStandort.Location = New System.Drawing.Point(720, 18)
Me.cbxStandort.Name = "cbxStandort"
Me.cbxStandort.Size = New System.Drawing.Size(128, 21)
Me.cbxStandort.TabIndex = 13
'
'dgvAVISOTV
'
Me.dgvAVISOTV.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvAVISOTV.AllowUserToAddRows = False
Me.dgvAVISOTV.AllowUserToDeleteRows = False
Me.dgvAVISOTV.BackgroundColor = System.Drawing.Color.White
Me.dgvAVISOTV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvAVISOTV.Location = New System.Drawing.Point(3, 45)
Me.dgvAVISOTV.Name = "dgvAVISOTV"
Me.dgvAVISOTV.Size = New System.Drawing.Size(852, 365)
Me.dgvAVISOTV.TabIndex = 108
'
'frmEintragTV
'
Me.AcceptButton = Me.btnOK
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(202, Byte), Integer), CType(CType(225, Byte), Integer), CType(CType(255, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(492, 208)
Me.ClientSize = New System.Drawing.Size(855, 612)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.btnDelete)
Me.Controls.Add(Me.pnlTop)
Me.Controls.Add(Me.dgvAVISOTV)
Me.Controls.Add(Me.txtZeile2)
Me.Controls.Add(Me.btnAbbruch)
Me.Controls.Add(Me.txtZeile1)
@@ -136,6 +279,9 @@ Partial Class frmEintragTV
Me.Name = "frmEintragTV"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Hinweistext für TV-Anzeige"
Me.pnlTop.ResumeLayout(False)
Me.pnlTop.PerformLayout()
CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
@@ -149,4 +295,14 @@ Partial Class frmEintragTV
Friend WithEvents txtZeile2 As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents btnAdd As Button
Friend WithEvents btnDelete As Button
Friend WithEvents pnlTop As Panel
Friend WithEvents txtSuche As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents Label18 As Label
Friend WithEvents lblWarning As Label
Friend WithEvents Label5 As Label
Friend WithEvents Label6 As Label
Friend WithEvents cbxStandort As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents dgvAVISOTV As VERAG_PROG_ALLGEMEIN.MyDatagridview
End Class

View File

@@ -8,6 +8,7 @@ Public Class frmEintragTV
Dim myAvisoTV As New cAvisoTV
Dim hÄnderung As Boolean = False
Dim Neuanlage As Boolean = False
Dim list As New List(Of cAvisoTV)
Public Sub New()
@@ -25,32 +26,17 @@ Public Class frmEintragTV
Private Sub frmEintragTV_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.CenterToParent()
'cGlobal.Aktive_ID = 1 'standardmäßig ist der Wert 1
list.Clear()
cbxStandort.Items.Clear()
myAvisoTV = AvisoTVDAL.LesenAvisoTV(0, "", "", "", list)
'If cGlobal.Aktive_ID = 0 Then
' 'es erfolgt eine Neuanlage
'
'
'Else
' Me.Text = "Änderung Text für TV-Anzeige"
'ausgewählter Datensatz wird geladen
myAvisoTV = AvisoTVDAL.LesenAvisoTV(0, "", VERAG_PROG_ALLGEMEIN.cAllgemein.NIEDERLASSUNG, "")
If myAvisoTV IsNot Nothing Then
'Werte(zuweisen)
txtZeile1.Text = myAvisoTV.FixeZeile1
txtZeile2.Text = myAvisoTV.FixeZeile2
Me.Text = "Änderung Text für TV-Anzeige"
Else
myAvisoTV = New cAvisoTV
myAvisoTV.Standort = VERAG_PROG_ALLGEMEIN.cAllgemein.NIEDERLASSUNG
myAvisoTV.Art = "INFO"
'Werte(zuweisen)
Neuanlage = True
txtZeile1.Text = ""
txtZeile2.Text = ""
Me.Text = "Neuanlage TV-Text"
End If
If list.Count < 1 Then Exit Sub
For Each s In list.Where(Function(x) x.Standort <> "").Select(Function(x) x.Standort).Distinct.ToList
cbxStandort.Items.Add(s)
Next
initdgv(cbxStandort._value)
End Sub
@@ -115,4 +101,53 @@ Public Class frmEintragTV
Me.Close()
End Sub
Private Sub cbxStandort_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxStandort.SelectedValueChanged
initdgv(cbxStandort._value)
End Sub
Private Sub initdgv(standort As String)
Try
myAvisoTV = AvisoTVDAL.LesenAvisoTV(0, "", "", standort, list)
If list Is Nothing Or list.Count = 0 Then
dgvAVISOTV.Rows.Clear()
Exit Sub
Else
dgvAVISOTV.DataSource = list
End If
'For Each row As DataGridViewRow In dgvAVISOTV.Rows
' If row.Cells("Special").Value IsNot DBNull.Value AndAlso (row.Cells("Special").Value.ToString.ToLower.Contains("xx")) Then row.DefaultCellStyle.ForeColor = Color.Gray
'Next
If myAvisoTV IsNot Nothing Then
'Werte(zuweisen)
txtZeile1.Text = myAvisoTV.FixeZeile1
txtZeile2.Text = myAvisoTV.FixeZeile2
Me.Text = "Änderung Text für TV-Anzeige"
Else
myAvisoTV = New cAvisoTV
myAvisoTV.Standort = VERAG_PROG_ALLGEMEIN.cAllgemein.NIEDERLASSUNG
myAvisoTV.Art = "INFO"
'Werte(zuweisen)
Neuanlage = True
txtZeile1.Text = ""
txtZeile2.Text = ""
Me.Text = "Neuanlage TV-Text"
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
End Class

View File

@@ -704,13 +704,14 @@ Public Class frmSendungsdetailsNEU
End If
loadContextMenudynMailvorlagen()
If VERAG_PROG_ALLGEMEIN.cAllgemein.AUTO_ABF_NR Then btnNeueAbfertigungNrVergeben.Visible = True
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
Case "AMBAR"
AMBARZollbeschauToolStripMenuItem.Visible = True
AMBARZollbeschauNEUToolStripMenuItem.Visible = True
dynMailsToolStripMenuItem.Visible = True
End Select
initDataBinding()
@@ -4320,21 +4321,7 @@ Public Class frmSendungsdetailsNEU
Private Sub Button22_Click(sender As Object, e As EventArgs) Handles btnMailVorlage.Click
listOfTextconserven = New cTextkonserve_LIST("FRM_MNGR_MailText", "DE", VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
If listOfTextconserven.LIST.Count = 0 Then
ContextMenuStrip1.Show(Cursor.Position)
Else
For Each r In listOfTextconserven.LIST
If Not dynMailsToolStripMenuItem.DropDownItems.ContainsKey(r.txt_id) Then
Dim menuItem = New ToolStripMenuItem() With {.Text = r.txt_bezeichnung, .Name = r.txt_id}
dynMailsToolStripMenuItem.DropDownItems.Add(menuItem)
AddHandler menuItem.Click, AddressOf mnuItem_Clicked
End If
Next
ContextMenuStrip1.Show(Cursor.Position)
End If
End Sub
@@ -5573,8 +5560,6 @@ Public Class frmSendungsdetailsNEU
AvisoStatusFunctions.insertSendungsVermerk(SENDUNG_LIST(CURRENT_INDEX).tblSnd_SendungID, AvisoId, "Doks an Fremdspedition (SUBEN) weitergeleitet.", 46)
Mail.Display()
Catch ex As Exception
@@ -6762,10 +6747,42 @@ Public Class frmSendungsdetailsNEU
Private Sub mnuItem_Clicked(sender As Object, e As EventArgs)
Private Sub mnuItem_MouseHover(sender As Object, e As EventArgs)
'ContextMenuStrip1.Hide()
Dim item As ToolStripMenuItem = TryCast(sender, ToolStripMenuItem)
If item IsNot Nothing Then
listOfTextconserven = New cTextkonserve_LIST("FRM_MNGR_MailText", item.Name, VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
If listOfTextconserven.LIST.Count = 0 Then
'ContextMenuStrip1.Show(Cursor.Position)
Else
For Each r In listOfTextconserven.LIST
If Not item.DropDownItems.ContainsKey(r.txt_id) Then
Dim menuItem = New ToolStripMenuItem() With {.Text = r.txt_bezeichnung, .Name = r.txt_id}
item.DropDownItems.Add(menuItem)
AddHandler menuItem.Click, AddressOf mnusubItem_Click
End If
Next
'ContextMenuStrip1.Show()
'item.ShowDropDown()
End If
End If
End Sub
Private Sub mnusubItem_Click(sender As Object, e As EventArgs)
ContextMenuStrip1.Hide()
Dim item As ToolStripMenuItem = TryCast(sender, ToolStripMenuItem)
Try
If item IsNot Nothing Then
For Each r As cTextkonserve In listOfTextconserven.LIST
@@ -6777,13 +6794,9 @@ Public Class frmSendungsdetailsNEU
Mail = outl.CreateItem(0)
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "AMBAR" Then
Try
Mail.SentOnBehalfOfName = SDL.cFakturierung.getDefaultMail("AMBAR")
Mail.HTMLBody &= cFakturierung.getSignature(r.txt_sprache, 24, True, True)
Catch ex2 As Exception
MsgBox(ex2.Message)
End Try
End If
@@ -6826,15 +6839,12 @@ Public Class frmSendungsdetailsNEU
For Each anh As DataGridViewRow In dgvAnhang.SelectedRows
Mail.Attachments.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(anh.Cells("anh_docId").Value), Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
Next
Mail.Display()
If False Then
AvisoStatusFunctions.insertSendungsVermerk(SENDUNG_LIST(CURRENT_INDEX).tblSnd_SendungID, AvisoId, "An Fremdspediteur avisiert (Warenort)", 98)
If r.txt_sendungsvermerk AndAlso Not r.txt_sendungsvermerkText.ToLower.Contains("test") AndAlso SENDUNG_LIST(CURRENT_INDEX).tblSnd_SendungID > 0 Then
AvisoStatusFunctions.insertSendungsVermerk(SENDUNG_LIST(CURRENT_INDEX).tblSnd_SendungID, AvisoId, r.txt_sendungsvermerkText, r.txt_sendungsvermerkId)
End If
Exit For
End If
@@ -6844,11 +6854,36 @@ Public Class frmSendungsdetailsNEU
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Private Sub loadContextMenudynMailvorlagen()
Dim Sprachen = New cTextkonserve_LIST(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
If Sprachen.SPRACHENLIST.Count = 0 Then
'ContextMenuStrip1.Show(Cursor.Position)
Else
For Each r In Sprachen.SPRACHENLIST
If Not dynMailsToolStripMenuItem.DropDownItems.ContainsKey(r.ToString) Then
Dim menuItem = New ToolStripMenuItem() With {.Text = r.ToString, .Name = r.ToString}
dynMailsToolStripMenuItem.DropDownItems.Add(menuItem)
AddHandler menuItem.MouseHover, AddressOf mnuItem_MouseHover
End If
Next
'ContextMenuStrip1.Show(Cursor.Position)
End If
End Sub
End Class