20200108
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
Public Class usrCntlSND_Handling
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class usrCntlSND_Handling
|
||||
Public SendungsID As Integer
|
||||
Public Event HandlingWerte(colli, gewicht)
|
||||
|
||||
Sub New(SendungsID)
|
||||
|
||||
@@ -31,19 +34,36 @@
|
||||
If SENDUNG IsNot Nothing Then
|
||||
SENDUNG.LOAD_HANDLING()
|
||||
For Each h In SENDUNG.HANDLING
|
||||
MyDatagridview1.Rows.Add(h.sndhdg_abrArt, h.sndhdg_nr)
|
||||
MyDatagridview1.Rows.Add(h.sndhdg_abrArt, h.sndhdg_nr, h.sndhdg_colli, h.sndhdg_gewicht)
|
||||
Next
|
||||
|
||||
If SENDUNG.HANDLING.Count = 0 And txtATAold.Text <> "" Then
|
||||
MyDatagridview1.Rows.Add("ATA", txtATAold.Text, 0, 0)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub MyDatagridview1_Validating(sender As Object, e As CancelEventArgs) Handles MyDatagridview1.Validating
|
||||
' Try
|
||||
' If MyDatagridview1.CurrentRow.Cells("clmnATA").Value <> "" Then
|
||||
' If MyDatagridview1.CurrentRow.Cells("clmnColli").Value IsNot Nothing AndAlso IsNumeric(MyDatagridview1.CurrentRow.Cells("clmnColli").Value) Then MsgBox("Daten unvollständig") : e.Cancel = True : Exit Sub
|
||||
' If MyDatagridview1.CurrentRow.Cells("clmnGewicht").Value IsNot Nothing AndAlso IsNumeric(MyDatagridview1.CurrentRow.Cells("clmnGewicht").Value) Then MsgBox("Daten unvollständig") : e.Cancel = True : Exit Sub
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' MsgBox(ex.Message & ex.StackTrace)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Public Function GET_HANDLING() As List(Of VERAG_PROG_ALLGEMEIN.cSendHandling)
|
||||
Dim LIST As New List(Of VERAG_PROG_ALLGEMEIN.cSendHandling)
|
||||
For Each r As DataGridViewRow In MyDatagridview1.Rows
|
||||
If r.Cells(1).Value <> "" Then
|
||||
Dim art = r.Cells(0).Value
|
||||
Dim Colli = CDbl(If(IsNumeric(r.Cells("clmnColli").Value), r.Cells("clmnColli").Value, 0))
|
||||
Dim Gewicht = CDbl(If(IsNumeric(r.Cells("clmnGewicht").Value), r.Cells("clmnGewicht").Value, 0))
|
||||
If art = "" Then art = "ATA"
|
||||
LIST.Add(New VERAG_PROG_ALLGEMEIN.cSendHandling(SendungsID, art, r.Cells(1).Value))
|
||||
LIST.Add(New VERAG_PROG_ALLGEMEIN.cSendHandling(SendungsID, art, r.Cells("clmnATA").Value, Colli, Gewicht))
|
||||
End If
|
||||
Next
|
||||
Return LIST
|
||||
@@ -58,4 +78,17 @@
|
||||
demitter = ", "
|
||||
Next
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub lkl_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lkl.LinkClicked
|
||||
Dim Colli As Double = 0
|
||||
Dim Gewicht As Double = 0
|
||||
For Each r As DataGridViewRow In MyDatagridview1.Rows
|
||||
If r.Cells(1).Value <> "" Then
|
||||
Colli += CDbl(If(IsNumeric(r.Cells("clmnColli").Value), r.Cells("clmnColli").Value, 0))
|
||||
Gewicht += CDbl(If(IsNumeric(r.Cells("clmnGewicht").Value), r.Cells("clmnGewicht").Value, 0))
|
||||
End If
|
||||
Next
|
||||
RaiseEvent HandlingWerte(Colli, Gewicht)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user