REST
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports System.Web.Http.Description
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace api_CustomsDeclaration.Controllers
|
||||
|
||||
<ApiVersion("1")>
|
||||
<ApiExplorerSettings(IgnoreApi:=True)> 'hide controller
|
||||
<ApiVersion("001")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/CustomsDeclaration")>
|
||||
Public Class CustomsDeclaration1Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
@@ -21,78 +23,78 @@ Namespace api_CustomsDeclaration.Controllers
|
||||
Return EZA
|
||||
End Function
|
||||
|
||||
Public Function PostValue(ByVal EZA_FREMD As VERAG_PROG_ALLGEMEIN.cVERAG_in_eza) As String
|
||||
' VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cREST_Options.isTESTSSTEM(Request)
|
||||
'Public Function PostValue(ByVal EZA_FREMD As VERAG_PROG_ALLGEMEIN.cVERAG_in_eza) As String
|
||||
' ' VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
' 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()
|
||||
' 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_EZA_START_X101_ " & Now.ToShortDateString & "-" & Now.ToShortTimeString & "','" & ip & "')", "FMZOLL")
|
||||
' SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_EZA_START_X101_ " & Now.ToShortDateString & "-" & Now.ToShortTimeString & "','" & ip & "')", "FMZOLL")
|
||||
|
||||
|
||||
Try
|
||||
' Try
|
||||
|
||||
Dim resultJson2 = jsonString.FromClass(EZA_FREMD)
|
||||
SQL.doSQL("insert into tbltest (test) Values('EZA_" & resultJson2.Replace("'", "") & "')", "FMZOLL")
|
||||
' Dim resultJson2 = jsonString.FromClass(EZA_FREMD)
|
||||
' SQL.doSQL("insert into tbltest (test) Values('EZA_" & resultJson2.Replace("'", "") & "')", "FMZOLL")
|
||||
|
||||
Catch ex As Exception
|
||||
SQL.doSQL("insert into tbltest (test) Values('ERR:EZA_101_" & ex.Message & "')", "FMZOLL")
|
||||
' Catch ex As Exception
|
||||
' SQL.doSQL("insert into tbltest (test) Values('ERR:EZA_101_" & ex.Message & "')", "FMZOLL")
|
||||
|
||||
End Try
|
||||
' End Try
|
||||
|
||||
|
||||
PostValue = "EZA_ERR"
|
||||
Try
|
||||
If EZA_FREMD Is Nothing Then Return EZA_Exceptions.ERR_01_Wrong_Format
|
||||
' If EZA_FREMD.TransportBorderLicensePlate = "" Then Return EZA_Exceptions.ERR_07_Missing_PlateNr
|
||||
' If EZA_FREMD.Reference = "" Then Return EZA_Exceptions.ERR_08_Missing_Reference
|
||||
' PostValue = "EZA_ERR"
|
||||
' Try
|
||||
' If EZA_FREMD Is Nothing Then Return EZA_Exceptions.ERR_01_Wrong_Format
|
||||
' ' If EZA_FREMD.TransportBorderLicensePlate = "" Then Return EZA_Exceptions.ERR_07_Missing_PlateNr
|
||||
' ' If EZA_FREMD.Reference = "" Then Return EZA_Exceptions.ERR_08_Missing_Reference
|
||||
|
||||
Dim Reference = If(EZA_FREMD.Reference, "")
|
||||
' Dim Reference = If(EZA_FREMD.Reference, "")
|
||||
|
||||
Dim EZA_TR = VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_FULL.LOADByReference("ATEZ", Reference, True)
|
||||
' Dim EZA_TR = VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_FULL.LOADByReference("ATEZ", Reference, True)
|
||||
|
||||
If EZA_TR Is Nothing Then
|
||||
EZA_TR = New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_FULL(EZA_FREMD)
|
||||
Else
|
||||
EZA_TR.setEZA(EZA_FREMD)
|
||||
End If
|
||||
' If EZA_TR Is Nothing Then
|
||||
' EZA_TR = New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_FULL(EZA_FREMD)
|
||||
' Else
|
||||
' EZA_TR.setEZA(EZA_FREMD)
|
||||
' End If
|
||||
|
||||
EZA_TR.shTr_Partnersystem = "ATEZ"
|
||||
EZA_TR.shTr_Status = 5
|
||||
'EZA_TR.shTr_Status_KEWILL_Equivalent = 5
|
||||
' EZA_TR.shTr_Partnersystem = "ATEZ"
|
||||
' EZA_TR.shTr_Status = 5
|
||||
' 'EZA_TR.shTr_Status_KEWILL_Equivalent = 5
|
||||
|
||||
EZA_TR.EZA.Company = "VERAG"
|
||||
EZA_TR.EZA.Department = "SUB"
|
||||
'EZA_TR.Reference = ""
|
||||
' EZA_TR.EZA.Company = "VERAG"
|
||||
' EZA_TR.EZA.Department = "SUB"
|
||||
' 'EZA_TR.Reference = ""
|
||||
|
||||
|
||||
If EZA_TR.SAVE_ALL Then
|
||||
'PostValue = "EZA_OK " & Now.ToShortDateString & "-" & Now.ToShortTimeString
|
||||
'Dim resultJson = jsonString.FromClass(EZA_FREMD)
|
||||
'SQL.doSQL("insert into tbltest (test) Values('EZA_" & resultJson & "')", "FMZOLL")
|
||||
'SQL.doSQL("insert into tbltest (test) Values('ATEZ_EZA_TEST: " & EZA_FREMD.TransportBorderLicensePlate & " - " & EZA_FREMD.Reference & "')", "FMZOLL")
|
||||
SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_EZA_OK - ID: " & EZA_TR.shTr_id & "','" & ip & "')", "FMZOLL")
|
||||
' If EZA_TR.SAVE_ALL Then
|
||||
' 'PostValue = "EZA_OK " & Now.ToShortDateString & "-" & Now.ToShortTimeString
|
||||
' 'Dim resultJson = jsonString.FromClass(EZA_FREMD)
|
||||
' 'SQL.doSQL("insert into tbltest (test) Values('EZA_" & resultJson & "')", "FMZOLL")
|
||||
' 'SQL.doSQL("insert into tbltest (test) Values('ATEZ_EZA_TEST: " & EZA_FREMD.TransportBorderLicensePlate & " - " & EZA_FREMD.Reference & "')", "FMZOLL")
|
||||
' SQL.doSQL("insert into tbltest (test,ipaddress) Values('ATEZ_EZA_OK - ID: " & EZA_TR.shTr_id & "','" & ip & "')", "FMZOLL")
|
||||
|
||||
Return "OK"
|
||||
Else
|
||||
PostValue = EZA_Exceptions.ERR_04_InternalSave
|
||||
End If
|
||||
' Return "OK"
|
||||
' Else
|
||||
' PostValue = EZA_Exceptions.ERR_04_InternalSave
|
||||
' End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & EZA_Exceptions.ERR_03_InternalVerarb, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
SQL.doSQL("insert into tbltest (test) Values('" & EZA_Exceptions.ERR_03_InternalVerarb & ex.Message & "')", "FMZOLL")
|
||||
Return EZA_Exceptions.ERR_03_InternalVerarb
|
||||
End Try
|
||||
' Catch ex As Exception
|
||||
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & EZA_Exceptions.ERR_03_InternalVerarb, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
' SQL.doSQL("insert into tbltest (test) Values('" & EZA_Exceptions.ERR_03_InternalVerarb & ex.Message & "')", "FMZOLL")
|
||||
' Return EZA_Exceptions.ERR_03_InternalVerarb
|
||||
' End Try
|
||||
|
||||
' SQL.doSQL("insert into tbltest (test) Values('" & PostValue & "')", "FMZOLL")
|
||||
' ' SQL.doSQL("insert into tbltest (test) Values('" & PostValue & "')", "FMZOLL")
|
||||
|
||||
Return PostValue
|
||||
' Return PostValue
|
||||
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user