frmRoutenBerechnung im frmEintragAvios eingebaut, inkl. Berechnungslogik
This commit is contained in:
@@ -522,7 +522,7 @@ Public Class frmEintragAviso
|
||||
dtpAvisoEingangZeit.Enabled = bearb
|
||||
End If
|
||||
|
||||
cbxEintreffenAus.fillWithSQL("SELECT [nctsr_dauer_in_tagen], [nctsr_von] FROM [tblNTCSRouten] ", False, "FMZOLL", False)
|
||||
'cbxEintreffenAus.fillWithSQL("SELECT [nctsr_dauer_in_tagen], [nctsr_von] FROM [tblNTCSRouten] ", False, "FMZOLL", False)
|
||||
|
||||
initAttachment()
|
||||
|
||||
@@ -1831,36 +1831,30 @@ Public Class frmEintragAviso
|
||||
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()
|
||||
Private Sub Button5_Click_1(sender As Object, e As EventArgs) Handles btnStreckendauerBerechnen.Click
|
||||
|
||||
Dim destination As String
|
||||
Dim departure As String
|
||||
Dim destination As String = ""
|
||||
|
||||
If cboGrenzstelle._value = "???" Then
|
||||
If cboGrenzstelle._value = "???" AndAlso txtBestimmungszollstelle._value IsNot Nothing Then
|
||||
destination = txtBestimmungszollstelle._value
|
||||
Else
|
||||
destination = cboGrenzstelle._value
|
||||
End If
|
||||
|
||||
departure = cbxEintreffenAus.Text
|
||||
If destination Is "" Or destination Is Nothing Then
|
||||
MsgBox("Zur Berechnung muss vorher eine Grenzstelle/Zollstelle ausgewählt werden!")
|
||||
Else
|
||||
Dim frmGrayOut = VERAG_PROG_ALLGEMEIN.cMeineFunktionenAVISO.grayoutForm()
|
||||
Dim frmRouteBerechnen = New frmRoutendauerBerechnen(destination)
|
||||
|
||||
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
|
||||
If frmRouteBerechnen.ShowDialog(frmGrayOut) = DialogResult.OK Then
|
||||
datVoraussichtlichesEintreffen.Value = frmRouteBerechnen.calculatedDate
|
||||
End If
|
||||
|
||||
End Function
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user