@@ -1,4 +1,5 @@
Imports GrapeCity . ActiveReports . Design . DdrDesigner . Designers
Imports DocumentFormat . OpenXml . Vml . Presentation
Imports GrapeCity . ActiveReports . Design . DdrDesigner . Designers
Imports GrapeCity . ActiveReports . ReportsCore . Tools
Imports Newtonsoft . Json . Linq
Imports SDL
@@ -72,96 +73,111 @@ Public Class frmATEZ_NCTS
End Sub
Private Sub Button1_Click ( sender As Object , e As EventArgs ) Handles Button1 . Click
Try
Me . Cursor = Cursors . WaitCursor
If id > 0 Then
If id > 0 Then
Dim atezData = New cATEZ_NCTS_DATA ( id )
If atezData . json <> " " And atezData . status <> " Draft " Then
MsgBox ( atezData . json )
Else
Dim atez As New cATEZ_NCTS_IN
sendAtezData ( atezData , atez )
End If
Dim atezData = New cATEZ_NCTS_DATA ( id )
If atezData . json <> " " And atezData . status <> " Draft " Then
MsgBox ( atezData . json )
Else
lblInfo . Text = " "
Dim selectedDocuments As Boolean = False
For Each Row In dgvAnhaenge . Rows
selectedDocuments = IIf ( DBNull . Value Is Row . Cells ( " anh_selekt " ) . Value , False , Row . Cells ( " anh_selekt " ) . Value )
If selectedDocuments Then Exit For
Next
If Not selectedDocuments Then
lblInfo . Text = " kein Anhang selektiert "
Cursor = Cursors . Default
Exit Sub
End If
Dim atezData As New cATEZ_NCTS_DATA
Dim atez As New cATEZ_NCTS_IN
With atezData
. AvisoId = AVISO . AvisoID
. SendungsId = SENDUNG . tblSnd_SendungID
. VERAG_LRN = lblBezugsnummer . Text
. LicensePlateContainerNo = txtLKWId . Text
. DAKOSY_TemplateCode = cboStammreferenz . _value
. DAKOSY_IOPartner = txtDyMandant . Text
. DAKOSY_Division3 = txtDyNiederlassung . Text
. DepartureCustomsOffice = sbAbgangZollstelle . _value
. DestinationCustomsOffice = sbBestimmungsZollstelle . _value
. DatDeterminationLimit = txtDat . Text
. CoolingTemperature = IIf ( cbxTemperatur . Checked , txtTransporttemp . Text , " " )
. Carrier_Name = usrCntl_Carrier . kdFirma . Text
. Carrier_Adress_City = usrCntl_Carrier . txtOrt . Text
. Carrier_Adress_Country = usrCntl_Carrier . sbLand . _value
. Carrier_Adress_Postcode = usrCntl_Carrier . txtPlz . Text
. Carrier_Adress_Street = usrCntl_Carrier . txtStrasse . Text
. Carrier_EORI = usrCntl_Carrier . txtEORI . Text
. Guarantee_GRN = " " 'leer
Select Case SENDUNG . tblSnd_Abfertigungsart_ID
Case 5 , 45 : . DAKOSY_Procedure = " T1 "
Case 6 : . DAKOSY_Procedure = " T2 "
Case 8 : . DAKOSY_Procedure = " TIR "
Case Else : . DAKOSY_Procedure = " T2 "
End Select
For Each doc As DataGridViewRow In dgvAnhaenge . Rows
Dim isSelected = IIf ( DBNull . Value Is doc . Cells ( " anh_selekt " ) . Value , False , doc . Cells ( " anh_selekt " ) . Value )
If isSelected Then
. selectedDocuments &= doc . Cells ( " anh_docId " ) . Value & " , "
End If
Next
. SAVE ( )
End With
If sbDurchgangszollstelle1 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle1 . _value )
If sbDurchgangszollstelle2 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle2 . _value )
If sbDurchgangszollstelle3 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle3 . _value )
If sbDurchgangszollstelle4 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle4 . _value )
If sbDurchgangszollstelle5 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle5 . _value )
If sbDurchgangszollstelle6 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle6 . _value )
If sbDurchgangszollstelle7 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle7 . _value )
If sbDurchgangszollstelle8 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle8 . _value )
If sbDurchgangszollstelle9 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle9 . _value )
If sbRoute1 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute1 . _value )
If sbRoute2 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute2 . _value )
If sbRoute3 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute3 . _value )
If sbRoute4 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute4 . _value )
If sbRoute5 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute5 . _value )
If sbRoute6 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute6 . _value )
If sbRoute7 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute7 . _value )
If sbRoute8 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute8 . _value )
If sbRoute9 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute9 . _value )
sendAtezData ( atezData , atez )
End If
Me . Cursor = Cursors . Default
Else
lblInfo . Text = " "
Dim selectedDocuments As Boolean = False
For Each Row In dgvAnhaenge . Rows
selectedDocuments = IIf ( DBNull . Value Is Row . Cells ( " anh_selekt " ) . Value , False , Row . Cells ( " anh_selekt " ) . Value )
If selectedDocuments Then Exit For
Next
If Not selectedDocuments Then
lblInfo . Text = " kein Anhang selektiert "
Cursor = Cursors . Default
Exit Sub
End If
Dim atezData As New cATEZ_NCTS_DATA
Dim atez As New cATEZ_NCTS_IN
With atezData
. AvisoId = AVISO . AvisoID
. SendungsId = SENDUNG . tblSnd_SendungID
. VERAG_LRN = lblBezugsnummer . Text
. LicensePlateContainerNo = txtLKWId . Text
. DAKOSY_TemplateCode = cboStammreferenz . _value
. DAKOSY_IOPartner = txtDyMandant . Text
. DAKOSY_Division3 = txtDyNiederlassung . Text
. DepartureCustomsOffice = sbAbgangZollstelle . _value
. DestinationCustomsOffice = sbBestimmungsZollstelle . _value
. DatDeterminationLimit = txtDat . Text
. CoolingTemperature = IIf ( cbxTemperatur . Checked , txtTransporttemp . Text , " " )
. Carrier_Name = usrCntl_Carrier . kdFirma . Text
. Carrier_Adress_City = usrCntl_Carrier . txtOrt . Text
. Carrier_Adress_Country = usrCntl_Carrier . sbLand . _value
. Carrier_Adress_Postcode = usrCntl_Carrier . txtPlz . Text
. Carrier_Adress_Street = usrCntl_Carrier . txtStrasse . Text
. Carrier_EORI = usrCntl_Carrier . txtEORI . Text
. Guarantee_GRN = " " 'leer
Select Case SENDUNG . tblSnd_Abfertigungsart_ID
Case 5 , 45 : . DAKOSY_Procedure = " T1 "
Case 6 : . DAKOSY_Procedure = " T2 "
Case 8 : . DAKOSY_Procedure = " TIR "
Case Else : . DAKOSY_Procedure = " T2 "
End Select
. SAVE ( )
End With
If sbDurchgangszollstelle1 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle1 . _value )
If sbDurchgangszollstelle2 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle2 . _value )
If sbDurchgangszollstelle3 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle3 . _value )
If sbDurchgangszollstelle4 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle4 . _value )
If sbDurchgangszollstelle5 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle5 . _value )
If sbDurchgangszollstelle6 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle6 . _value )
If sbDurchgangszollstelle7 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle7 . _value )
If sbDurchgangszollstelle8 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle8 . _value )
If sbDurchgangszollstelle9 . _value <> " " Then Dim TCO As New cATEZ_NCTS_TransitCustomsOffice ( atezData . Id , sbDurchgangszollstelle9 . _value )
If sbRoute1 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute1 . _value )
If sbRoute2 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute2 . _value )
If sbRoute3 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute3 . _value )
If sbRoute4 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute4 . _value )
If sbRoute5 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute5 . _value )
If sbRoute6 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute6 . _value )
If sbRoute7 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute7 . _value )
If sbRoute8 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute8 . _value )
If sbRoute9 . _value <> " " Then Dim route As New cATEZ_NCTS_Routen ( atezData . Id , sbRoute9 . _value )
sendAtezData ( atezData , atez )
End If
Catch ex As Exception
Me . Cursor = Cursors . Default
End Try
End Sub
@@ -208,7 +224,8 @@ Public Class frmATEZ_NCTS
BezugsNr = BezugsNrTmp
zusatz = " A "
If dgv IsNot Nothing Then
If dgv IsNot Nothing And dgv . Rows . Count > 0 Then
BezugsNr = BezugsNrTmp & " / " & zusatz
For Each r As DataGridViewRow In dgv . Rows
If r . Cells ( " BezugsNr " ) . Value = BezugsNr Then
@@ -277,7 +294,9 @@ Public Class frmATEZ_NCTS
lblBezugsnummer . Text = atez_data . VERAG_LRN
cboStammreferenz . _value = atez_data . SendungsId
cboStammreferenz . fillWithSQL ( " SELECT [dySr_Stammreferenz],[dySr_Bezeichnung] FROM [tblDakosy_Stammreferenzen] WHERE dySr_Land='DE' AND dySr_Verfahren='NCTS' and dySr_dy_Mandant=' " & txtDyMandant . Text & " ' and dySr_dy_Niederlassung IN ('',' " & txtDyNiederlassung . Text & " ') and dySr_visible=1 " , False , " FMZOLL " , True )
cboStammreferenz . changeItem ( atez_data . DAKOSY_TemplateCode )
txtLKWId . Text = atez_data . LicensePlateContainerNo