This commit is contained in:
2023-02-22 09:58:13 +01:00
parent f80edd789b
commit 152312175f
21 changed files with 1048 additions and 670 deletions

View File

@@ -1,500 +0,0 @@
Imports System.Net
Imports System.Web.Http
Imports Microsoft.Web.Http
Imports Newtonsoft.Json
Namespace ApiController.Controllers
<ApiVersion("001")>
<System.Web.Http.Route("api/V001/TR_NCTS")>
Public Class TR_NCTSV001Controller
Inherits System.Web.Http.ApiController
'Public Function GetValues() As VERAG_PROG_ALLGEMEIN.cVERAG_out_ncts
' Dim NCTS As New VERAG_PROG_ALLGEMEIN.cVERAG_out_ncts
' NCTS.ncts_WARENPOS.Add(New VERAG_PROG_ALLGEMEIN.cDakosy_NCTSOut_Warenposition)
' NCTS.ncts_SICHERHEITSANGABEN.Add(New VERAG_PROG_ALLGEMEIN.cDakosy_NCTSOut_Sicherheitsangaben)
' NCTS.ncts_WARENPOS(0).nctsWP_PACKSTUECKE.Add(New VERAG_PROG_ALLGEMEIN.cDakosy_NCTSOut_WarenpositionPackstuecke)
' NCTS.ncts_WARENPOS(0).nctsWP_UNTERLAGEN.Add(New VERAG_PROG_ALLGEMEIN.cDakosy_NCTSOut_WarenpositionVorgelegteUnterlagen)
' 'NCTS.ADDRESS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_Adressen)
' Return NCTS
'End Function
'Public Function PostValue(ByVal value As String) As String
' 'Dim file As System.IO.StreamWriter
' 'file = My.Computer.FileSystem.OpenTextFileWriter("G:\test.txt", True)
' 'file.WriteLine(value)
' 'file.Close()
' VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
' Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
' SQL.doSQL("insert into tbltest (test) Values('000')", "FMZOLL")
' Return "asd" & value
'End Function
Public Function PostValue(ByVal NCTS_ATEZ As VERAG_PROG_ALLGEMEIN.cATEZ_NCTS) As String
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cREST_Options.isTESTSSTEM(Request)
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim ip = Request.Properties("MS_HttpContext").Request.UserHostAddress()
SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_NCTS_START " & Now.ToShortDateString & "-" & Now.ToShortTimeString & "','" & ip & "')", "FMZOLL")
Try
Dim resultJson2 = jsonString.FromClass(NCTS_ATEZ)
SQL.doSQL("insert into tbltest (test) Values('NCTS_" & resultJson2 & "')", "FMZOLL")
Catch ex As Exception
End Try
PostValue = "NCTS_ERR"
Try
If NCTS_ATEZ Is Nothing OrElse NCTS_ATEZ.CC015B Is Nothing Then Return NCTS_Exceptions.ERR_01_Wrong_Format
If NCTS_ATEZ.CC015B.MRNNumber Is Nothing OrElse NCTS_ATEZ.CC015B.MRNNumber = "" Then Return NCTS_Exceptions.ERR_02_Missing_MRN
Dim MRN = If(NCTS_ATEZ.CC015B.MRNNumber, "")
Dim NCTS_TR = VERAG_PROG_ALLGEMEIN.cNCTS_TR.LOADByMRN(MRN, True,, "ATEZ")
If NCTS_TR Is Nothing Then
NCTS_TR = New VERAG_PROG_ALLGEMEIN.cNCTS_TR
End If
NCTS_TR.ncts_Partnersystem = "ATEZ"
NCTS_TR.ncts_Status = 5
NCTS_TR.ncts_Status_KEWILL_Equivalent = 5
NCTS_TR.ncts_MRN = NCTS_ATEZ.CC015B.MRNNumber
'NCTS_TR.ncts_ObjectName = NCTS_ATEZ.CC015B.RefId
'NCTS_TR.ncts_ObjectAlias = NCTS_ATEZ.CC015B.RefId
If NCTS_ATEZ.CC015B.HEAHEA IsNot Nothing Then
NCTS_TR.ncts_dyaArt = NCTS_ATEZ.CC015B.HEAHEA.TypOfDecHEA24
NCTS_TR.ncts_Befoerderungsmittel_KennzeichenGrenzueberschreitend = NCTS_ATEZ.CC015B.HEAHEA.IdeOfMeaOfTraCroHEA85
NCTS_TR.ncts_Befoerderungsmittel_StaatszugehoerigkeitGrenzueberschreitendCode = NCTS_ATEZ.CC015B.HEAHEA.NatOfMeaOfTraCroHEA87
NCTS_TR.ncts_Befoerderungsmittel_KennzeichenAbgang = NCTS_ATEZ.CC015B.HEAHEA.IdeOfMeaOfTraAtDHEA78
End If
If NCTS_ATEZ.CC015B.CARTRA100 IsNot Nothing Then
NCTS_TR.ncts_SumA_Befoerderer_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.NamCARTRA121, 35)
NCTS_TR.ncts_SumA_Befoerderer_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.StrAndNumCARTRA254, 35)
NCTS_TR.ncts_SumA_Befoerderer_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.PosCodCARTRA121, 9)
NCTS_TR.ncts_SumA_Befoerderer_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.CitCARTRA789, 35)
NCTS_TR.ncts_SumA_Befoerderer_Land = NCTS_ATEZ.CC015B.CARTRA100.CouCodCARTRA587
'If NCTS_ATEZ.CC015B.CARTRA100.TINCARTRA254 IsNot Nothing And NCTS_ATEZ.CC015B.CARTRA100.NADCARTRA121 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.CARTRA100.TINCARTRA254 & NCTS_ATEZ.CC015B.CARTRA100.NADCARTRA121
'End If
End If
If NCTS_ATEZ.CC015B.TRACORSEC037 IsNot Nothing Then
NCTS_TR.ncts_SumA_Versender_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.NamTRACORSEC041, 35)
NCTS_TR.ncts_SumA_Versender_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.StrNumTRACORSEC043, 35)
NCTS_TR.ncts_SumA_Versender_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.PosCodTRACORSEC042, 9)
NCTS_TR.ncts_SumA_Versender_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.CitTRACORSEC038, 35)
NCTS_TR.ncts_SumA_Versender_Land = NCTS_ATEZ.CC015B.TRACORSEC037.CouCodTRACORSEC039
'If NCTS_ATEZ.CC015B.TRACORSEC037.TRACORSEC037LNG IsNot Nothing And NCTS_ATEZ.CC015B.TRACORSEC037.TINTRACORSEC044 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.TRACORSEC037.TRACORSEC037LNG & NCTS_ATEZ.CC015B.TRACORSEC037.TINTRACORSEC044
'End If
End If
If NCTS_ATEZ.CC015B.TRACONSEC029 IsNot Nothing Then
NCTS_TR.ncts_SumA_Versender_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.NameTRACONSEC033, 35)
NCTS_TR.ncts_SumA_Versender_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.StrNumTRACONSEC035, 35)
NCTS_TR.ncts_SumA_Versender_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.PosCodTRACONSEC034, 9)
NCTS_TR.ncts_SumA_Versender_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.CitTRACONSEC030, 35)
NCTS_TR.ncts_SumA_Versender_Land = NCTS_ATEZ.CC015B.TRACONSEC029.CouCodTRACONSEC031
'If NCTS_ATEZ.CC015B.TRACONSEC029.TRACONSEC029LNG IsNot Nothing And NCTS_ATEZ.CC015B.TRACONSEC029.TINTRACONSEC036 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.TRACONSEC029.TRACONSEC029LNG & NCTS_ATEZ.CC015B.TRACONSEC029.TINTRACONSEC036
'End If
End If
'Dim cnt = 1
'If NCTS_ATEZ.CC015B.ITI IsNot Nothing Then
' For Each R In NCTS_ATEZ.CC015B.ITI
' Select Case cnt
' Case 1 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand1 = R
' Case 2 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand2 = R
' Case 3 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand3 = R
' Case 4 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand4 = R
' Case 5 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand5 = R
' Case 6 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand6 = R
' Case 7 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand7 = R
' Case 8 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand8 = R
' Case 9 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand9 = R
' Case 10 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand10 = R
' Case 11 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand11 = R
' Case 12 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand12 = R
' End Select
' cnt += 1
' Next
'End If
If NCTS_ATEZ.CC015B.GOOITEGDS IsNot Nothing Then
For Each ITEM In NCTS_ATEZ.CC015B.GOOITEGDS
Dim POS As New VERAG_PROG_ALLGEMEIN.cNCTS_TR_Warenposition
POS.nctsWP_PositionsNummer = ITEM.IteNumGDS7
POS.nctsWP_Warenbezeichnung = ITEM.GooDesGDS23
POS.nctsWP_Rohmasse = ITEM.GroMasGDS46
POS.nctsWP_Eigenmasse = ITEM.NetMasGDS48
If ITEM.ComCodTarCodGDS10 IsNot Nothing Then
If ITEM.ComCodTarCodGDS10.ToString.Length > 10 Then
POS.nctsWP_Warennummer = ITEM.ComCodTarCodGDS10.Substring(0, 10)
Else
POS.nctsWP_Warennummer = ITEM.ComCodTarCodGDS10
End If
End If
If ITEM.PACGS2 IsNot Nothing Then
For Each PAC In ITEM.PACGS2
Dim PACK As New VERAG_PROG_ALLGEMEIN.cNCTS_TR_WarenpositionPackstuecke
PACK.nctsWpPk_PackstueckeAnzahl = PAC.NumOfPacGS24
PACK.nctsWpPk_Verpackungsart = PAC.KinOfPacGS23
POS.nctsWP_PACKSTUECKE.Add(PACK)
If PACK.nctsWpPk_PackstueckeAnzahl Is Nothing Then Return NCTS_Exceptions.ERR_05_Missing_Colli
Next
Else
Return NCTS_Exceptions.ERR_05_Missing_Colli
End If
' For Each PACGS In ITEM.PACGS2
' Dim PACK As New cNCTSPartnerWorker.cNCTS_TR_WarenpositionPackstuecke
' PACK.nctsWpPk_PackstueckeAnzahl = PACGS.NumOfPacGS24
' PACK.nctsWpPk_Verpackungsart = PACGS.KinOfPacGS23
'' PACK.nctsWpPk_ZeichenNummern = PACGS.MarNumOfPacGS21
' POS.nctsWP_PACKSTUECKE.Add(PACK)
' Next
NCTS_TR.ncts_WARENPOS.Add(POS)
If POS.nctsWP_Rohmasse Is Nothing Then Return NCTS_Exceptions.ERR_06_Missing_Gewicht
If POS.nctsWP_Rohmasse Is Nothing Then Return NCTS_Exceptions.ERR_06_Missing_Gewicht
If POS.nctsWP_PACKSTUECKE.Count = 0 Then Return NCTS_Exceptions.ERR_05_Missing_Colli
Next
End If
If NCTS_TR.ncts_Befoerderungsmittel_KennzeichenAbgang Is Nothing Then Return NCTS_Exceptions.ERR_07_Missing_PlateNr
If NCTS_TR.SAVE_ALL Then
'PostValue = "NCTS_OK " & Now.ToShortDateString & "-" & Now.ToShortTimeString
'SQL.doSQL("insert into tbltest (test) Values('ATEZ_NCTS_TEST: " & NCTS_ATEZ.CC015B.MRNNumber & "')", "FMZOLL")
SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_NCTS_OK - ID: " & NCTS_TR.ncts_Id & "','" & ip & "')", "FMZOLL")
Return "OK"
Else
PostValue = NCTS_Exceptions.ERR_04_InternalSave
End If
' Return "TEST3"
'SQL.doSQL("insert into tbltest (test) Values('" & "OK " & Now.ToShortDateString & "-" & Now.ToShortTimeString & "')", "FMZOLL")
'MsgBox(resultJson)
'Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("INTERFACE", "ATEZ", "IN", "NCTS_ATEZ")
'DS.uploadDataToDATENSERVER_fromBytes()
'Dim client = New RestClient(_baseURI)
'Dim request = New RestRequest("/datasources/{identifier}/data", Method.GET)
'request.AddUrlSegment("identifier", _identifier)
'request.AddHeader("Authorization", "Basic " + _token)
'Dim jstr = client.Execute(request).Content
'Dim allDATA As List(Of GeneralInfo) = JsonConvert.DeserializeObject(Of List(Of GeneralInfo))(jstr)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & NCTS_Exceptions.ERR_03_InternalVerarb, System.Reflection.MethodInfo.GetCurrentMethod.Name)
SQL.doSQL("insert into tbltest (test) Values('" & NCTS_Exceptions.ERR_03_InternalVerarb & ex.Message & "')", "FMZOLL")
Return NCTS_Exceptions.ERR_03_InternalVerarb
End Try
' SQL.doSQL("insert into tbltest (test) Values('" & PostValue & "')", "FMZOLL")
Return PostValue
End Function
'' POST api/CustomsDeclaration_V001/
'Public Sub PostValue(<FromBody()> ByVal value As String)
'End Sub
'' PUT api/CustomsDeclaration_V001//5
'Public Sub PutValue(ByVal id As Integer, <FromBody()> ByVal value As String)
'End Sub
'' DELETE api/CustomsDeclaration_V001//5
'Public Sub DeleteValue(ByVal id As Integer)
'End Sub
End Class
'------------------------------------------------------------------------
'----------------------------------TEST----------------------------------
'------------------------------------------------------------------------
<ApiVersion("001")>
<System.Web.Http.Route("api/V001/TEST/TR_NCTS")>
Public Class TR_NCTSV001TESTController
Inherits System.Web.Http.ApiController
Public Function PostValue(ByVal NCTS_ATEZ As VERAG_PROG_ALLGEMEIN.cATEZ_NCTS) As String
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Try
Dim ip = Request.Properties("MS_HttpContext").Request.UserHostAddress()
SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_NCTS_START " & Now.ToShortDateString & "-" & Now.ToShortTimeString & "','" & ip & "')", "FMZOLL")
Try
Dim resultJson2 = jsonString.FromClass(NCTS_ATEZ)
SQL.doSQL("insert into tbltest (test) Values('NCTS_" & resultJson2 & "')", "FMZOLL")
Catch ex As Exception
End Try
PostValue = "NCTS_ERR"
If NCTS_ATEZ Is Nothing OrElse NCTS_ATEZ.CC015B Is Nothing Then Return NCTS_Exceptions.ERR_01_Wrong_Format
If NCTS_ATEZ.CC015B.MRNNumber Is Nothing OrElse NCTS_ATEZ.CC015B.MRNNumber = "" Then Return NCTS_Exceptions.ERR_02_Missing_MRN
Dim MRN = If(NCTS_ATEZ.CC015B.MRNNumber, "")
Dim NCTS_TR = VERAG_PROG_ALLGEMEIN.cNCTS_TR.LOADByMRN(MRN, True,, "ATEZ")
If NCTS_TR Is Nothing Then
NCTS_TR = New VERAG_PROG_ALLGEMEIN.cNCTS_TR
End If
NCTS_TR.ncts_Partnersystem = "ATEZ"
NCTS_TR.ncts_Status = 5
NCTS_TR.ncts_Status_KEWILL_Equivalent = 5
NCTS_TR.ncts_MRN = NCTS_ATEZ.CC015B.MRNNumber
'NCTS_TR.ncts_ObjectName = NCTS_ATEZ.CC015B.RefId
'NCTS_TR.ncts_ObjectAlias = NCTS_ATEZ.CC015B.RefId
If NCTS_ATEZ.CC015B.HEAHEA IsNot Nothing Then
NCTS_TR.ncts_dyaArt = NCTS_ATEZ.CC015B.HEAHEA.TypOfDecHEA24
NCTS_TR.ncts_Befoerderungsmittel_KennzeichenGrenzueberschreitend = NCTS_ATEZ.CC015B.HEAHEA.IdeOfMeaOfTraCroHEA85
NCTS_TR.ncts_Befoerderungsmittel_StaatszugehoerigkeitGrenzueberschreitendCode = NCTS_ATEZ.CC015B.HEAHEA.NatOfMeaOfTraCroHEA87
NCTS_TR.ncts_Befoerderungsmittel_KennzeichenAbgang = NCTS_ATEZ.CC015B.HEAHEA.IdeOfMeaOfTraAtDHEA78
End If
If NCTS_ATEZ.CC015B.CARTRA100 IsNot Nothing Then
NCTS_TR.ncts_SumA_Befoerderer_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.NamCARTRA121, 35)
NCTS_TR.ncts_SumA_Befoerderer_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.StrAndNumCARTRA254, 35)
NCTS_TR.ncts_SumA_Befoerderer_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.PosCodCARTRA121, 9)
NCTS_TR.ncts_SumA_Befoerderer_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.CARTRA100.CitCARTRA789, 35)
NCTS_TR.ncts_SumA_Befoerderer_Land = NCTS_ATEZ.CC015B.CARTRA100.CouCodCARTRA587
'If NCTS_ATEZ.CC015B.CARTRA100.TINCARTRA254 IsNot Nothing And NCTS_ATEZ.CC015B.CARTRA100.NADCARTRA121 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.CARTRA100.TINCARTRA254 & NCTS_ATEZ.CC015B.CARTRA100.NADCARTRA121
'End If
End If
If NCTS_ATEZ.CC015B.TRACORSEC037 IsNot Nothing Then
NCTS_TR.ncts_SumA_Versender_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.NamTRACORSEC041, 35)
NCTS_TR.ncts_SumA_Versender_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.StrNumTRACORSEC043, 35)
NCTS_TR.ncts_SumA_Versender_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.PosCodTRACORSEC042, 9)
NCTS_TR.ncts_SumA_Versender_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACORSEC037.CitTRACORSEC038, 35)
NCTS_TR.ncts_SumA_Versender_Land = NCTS_ATEZ.CC015B.TRACORSEC037.CouCodTRACORSEC039
'If NCTS_ATEZ.CC015B.TRACORSEC037.TRACORSEC037LNG IsNot Nothing And NCTS_ATEZ.CC015B.TRACORSEC037.TINTRACORSEC044 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.TRACORSEC037.TRACORSEC037LNG & NCTS_ATEZ.CC015B.TRACORSEC037.TINTRACORSEC044
'End If
End If
If NCTS_ATEZ.CC015B.TRACONSEC029 IsNot Nothing Then
NCTS_TR.ncts_SumA_Versender_Name = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.NameTRACONSEC033, 35)
NCTS_TR.ncts_SumA_Versender_StrasseHausnummer = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.StrNumTRACONSEC035, 35)
NCTS_TR.ncts_SumA_Versender_PLZ = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.PosCodTRACONSEC034, 9)
NCTS_TR.ncts_SumA_Versender_Ort = NCTS_Functions.cutlength(NCTS_ATEZ.CC015B.TRACONSEC029.CitTRACONSEC030, 35)
NCTS_TR.ncts_SumA_Versender_Land = NCTS_ATEZ.CC015B.TRACONSEC029.CouCodTRACONSEC031
'If NCTS_ATEZ.CC015B.TRACONSEC029.TRACONSEC029LNG IsNot Nothing And NCTS_ATEZ.CC015B.TRACONSEC029.TINTRACONSEC036 IsNot Nothing Then
' NCTS_TR.ncts_SumA_Befoerderer_EORI = NCTS_ATEZ.CC015B.TRACONSEC029.TRACONSEC029LNG & NCTS_ATEZ.CC015B.TRACONSEC029.TINTRACONSEC036
'End If
End If
'Dim cnt = 1
'If NCTS_ATEZ.CC015B.ITI IsNot Nothing Then
' For Each R In NCTS_ATEZ.CC015B.ITI
' Select Case cnt
' Case 1 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand1 = R
' Case 2 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand2 = R
' Case 3 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand3 = R
' Case 4 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand4 = R
' Case 5 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand5 = R
' Case 6 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand6 = R
' Case 7 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand7 = R
' Case 8 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand8 = R
' Case 9 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand9 = R
' Case 10 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand10 = R
' Case 11 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand11 = R
' Case 12 : NCTS_TR.ncts_SumA_BefoerderungsrouteLand12 = R
' End Select
' cnt += 1
' Next
'End If
If NCTS_ATEZ.CC015B.GOOITEGDS IsNot Nothing Then
For Each ITEM In NCTS_ATEZ.CC015B.GOOITEGDS
Dim POS As New VERAG_PROG_ALLGEMEIN.cNCTS_TR_Warenposition
POS.nctsWP_PositionsNummer = ITEM.IteNumGDS7
POS.nctsWP_Warenbezeichnung = ITEM.GooDesGDS23
POS.nctsWP_Rohmasse = ITEM.GroMasGDS46
POS.nctsWP_Eigenmasse = ITEM.NetMasGDS48
If ITEM.ComCodTarCodGDS10 IsNot Nothing Then
If ITEM.ComCodTarCodGDS10.ToString.Length > 10 Then
POS.nctsWP_Warennummer = ITEM.ComCodTarCodGDS10.Substring(0, 10)
Else
POS.nctsWP_Warennummer = ITEM.ComCodTarCodGDS10
End If
End If
If ITEM.PACGS2 IsNot Nothing Then
For Each PAC In ITEM.PACGS2
Dim PACK As New VERAG_PROG_ALLGEMEIN.cNCTS_TR_WarenpositionPackstuecke
PACK.nctsWpPk_PackstueckeAnzahl = PAC.NumOfPacGS24
PACK.nctsWpPk_Verpackungsart = PAC.KinOfPacGS23
POS.nctsWP_PACKSTUECKE.Add(PACK)
If PACK.nctsWpPk_PackstueckeAnzahl Is Nothing Then Return NCTS_Exceptions.ERR_05_Missing_Colli
Next
Else
Return NCTS_Exceptions.ERR_05_Missing_Colli
End If
' For Each PACGS In ITEM.PACGS2
' Dim PACK As New cNCTSPartnerWorker.cNCTS_TR_WarenpositionPackstuecke
' PACK.nctsWpPk_PackstueckeAnzahl = PACGS.NumOfPacGS24
' PACK.nctsWpPk_Verpackungsart = PACGS.KinOfPacGS23
'' PACK.nctsWpPk_ZeichenNummern = PACGS.MarNumOfPacGS21
' POS.nctsWP_PACKSTUECKE.Add(PACK)
' Next
NCTS_TR.ncts_WARENPOS.Add(POS)
If POS.nctsWP_Rohmasse Is Nothing Then Return NCTS_Exceptions.ERR_06_Missing_Gewicht
If POS.nctsWP_Rohmasse Is Nothing Then Return NCTS_Exceptions.ERR_06_Missing_Gewicht
If POS.nctsWP_PACKSTUECKE.Count = 0 Then Return NCTS_Exceptions.ERR_05_Missing_Colli
Next
End If
If NCTS_TR.ncts_Befoerderungsmittel_KennzeichenAbgang Is Nothing Then Return NCTS_Exceptions.ERR_07_Missing_PlateNr
If NCTS_TR.SAVE_ALL Then
'PostValue = "NCTS_OK " & Now.ToShortDateString & "-" & Now.ToShortTimeString
'SQL.doSQL("insert into tbltest (test) Values('ATEZ_NCTS_TEST: " & NCTS_ATEZ.CC015B.MRNNumber & "')", "FMZOLL")
SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_NCTS_OK - ID: " & NCTS_TR.ncts_Id & "','" & ip & "')", "FMZOLL")
Return "OK"
Else
PostValue = NCTS_Exceptions.ERR_04_InternalSave
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & NCTS_Exceptions.ERR_03_InternalVerarb, System.Reflection.MethodInfo.GetCurrentMethod.Name)
SQL.doSQL("insert into tbltest (test) Values('" & NCTS_Exceptions.ERR_03_InternalVerarb & ex.Message & "')", "FMZOLL")
Return NCTS_Exceptions.ERR_03_InternalVerarb
End Try
' SQL.doSQL("insert into tbltest (test) Values('" & PostValue & "')", "FMZOLL")
Return PostValue
End Function
End Class
End Namespace
Class NCTS_Exceptions
Public Const ERR_01_Wrong_Format As String = "ERR_01"
Public Const ERR_02_Missing_MRN As String = "ERR_02"
Public Const ERR_03_InternalVerarb As String = "ERR_03"
Public Const ERR_04_InternalSave As String = "ERR_04"
Public Const ERR_05_Missing_Colli As String = "ERR_05"
Public Const ERR_06_Missing_Gewicht As String = "ERR_06"
Public Const ERR_07_Missing_PlateNr As String = "ERR_07"
Public Const ERR_08_Missing_Reference As String = "ERR_08"
End Class
Class NCTS_Functions
Public Shared Function cutlength(o, l) As Object
Try
If o IsNot Nothing Then
If o.ToString.Length > l Then
Return o.ToString.Substring(0, l)
End If
End If
Return o
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Return o
End Try
End Function
End Class
'Enum NCTS_ERR_CODES
' ERR_01
'End Enum