Feature: frmEintragAviso Berechnung für Transportwegdauer
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN.cMeineFunktionenAVISO
|
||||
Imports System.Data.OleDb
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Drawing.Printing
|
||||
Imports System.Drawing.Printing
|
||||
Imports System.Linq.Expressions
|
||||
|
||||
Public Class frmEintragAviso
|
||||
' Public frmHilf As frmMain
|
||||
@@ -521,6 +522,7 @@ Public Class frmEintragAviso
|
||||
dtpAvisoEingangZeit.Enabled = bearb
|
||||
End If
|
||||
|
||||
cbxEintreffenAus.fillWithSQL("SELECT [nctsr_dauer_in_tagen], [nctsr_von] FROM [tblNTCSRouten] ", False, "FMZOLL", False)
|
||||
|
||||
initAttachment()
|
||||
|
||||
@@ -1828,4 +1830,37 @@ Public Class frmEintragAviso
|
||||
lblAtrAvis_Click(lblAtrAvis, New EventArgs)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub cbxEintreffenAus_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxEintreffenAus.SelectedValueChanged
|
||||
|
||||
|
||||
Dim days = calculateTripDuration()
|
||||
|
||||
If days < 0 Then Exit Sub
|
||||
|
||||
datVoraussichtlichesEintreffen.Enabled = False
|
||||
datVoraussichtlichesEintreffen.Value = DateTime.Now.AddDays(days)
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Function calculateTripDuration()
|
||||
|
||||
Dim destination As String
|
||||
Dim departure As String
|
||||
|
||||
If cboGrenzstelle._value = "???" Then
|
||||
destination = txtBestimmungszollstelle._value
|
||||
Else
|
||||
destination = cboGrenzstelle._value
|
||||
End If
|
||||
|
||||
departure = cbxEintreffenAus.Text
|
||||
|
||||
Dim days As Integer = SQL.DLookup("nctsr_dauer_in_tagen", "tblNTCSRouten", "[nctsr_von]='" & departure & "' AND [nctsr_nach]= '" & destination & "'", "VERAG", "")
|
||||
If days > 0 Then Return days
|
||||
Return -1
|
||||
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user