Commit
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
|
||||
|
||||
Namespace NEWTESTController.Controllers
|
||||
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{apiVersion}/NEWTEST")>
|
||||
Public Class NEWTESTV1Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "NEWTEST 1111"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
<ApiVersion("2")>
|
||||
<ApiVersion("3")>
|
||||
<System.Web.Http.Route("api/v{apiVersion}/NEWTEST")>
|
||||
Public Class NEWTESTV2Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "NEWTEST 2222"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V2
|
||||
|
||||
|
||||
|
||||
' <ApiVersion("2")>
|
||||
' <RoutePrefix("api/v2/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 2"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
'End Namespace
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V3
|
||||
|
||||
' <ApiVersion("3")>
|
||||
' <RoutePrefix("api/v3/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 3"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
|
||||
'End Namespace
|
||||
@@ -1,61 +0,0 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace TESTController.Controllers.V1
|
||||
|
||||
|
||||
|
||||
<ApiVersion("1")>
|
||||
<RoutePrefix("api/{apiVersion:apiVersionConstraint(v1)}/TEST")>
|
||||
Public Class TESTController
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "TEST 1"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V2
|
||||
|
||||
|
||||
|
||||
' <ApiVersion("2")>
|
||||
' <RoutePrefix("api/v2/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 2"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
'End Namespace
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V3
|
||||
|
||||
' <ApiVersion("3")>
|
||||
' <RoutePrefix("api/v3/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 3"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
|
||||
'End Namespace
|
||||
@@ -1,61 +0,0 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace TESTController.Controllers.V2
|
||||
|
||||
|
||||
|
||||
<ApiVersion("2")>
|
||||
<RoutePrefix("api/v{apiVersion}/TEST")>
|
||||
Public Class TESTController
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "TEST 2"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V2
|
||||
|
||||
|
||||
|
||||
' <ApiVersion("2")>
|
||||
' <RoutePrefix("api/v2/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 2"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
'End Namespace
|
||||
|
||||
|
||||
|
||||
'Namespace TESTController.Controllers.V3
|
||||
|
||||
' <ApiVersion("3")>
|
||||
' <RoutePrefix("api/v3/TEST")>
|
||||
' Public Class TESTController
|
||||
' Inherits System.Web.Http.ApiController
|
||||
|
||||
|
||||
' Public Function GetValues() As String
|
||||
' Return "TEST 3"
|
||||
' End Function
|
||||
|
||||
' End Class
|
||||
|
||||
|
||||
'End Namespace
|
||||
@@ -3,16 +3,13 @@ Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
|
||||
Namespace ApiController.Controllers
|
||||
'v{version:apiVersion}
|
||||
|
||||
|
||||
<ApiVersion("001")>
|
||||
<System.Web.Http.Route("api/V001/AVISO")>
|
||||
Public Class AVISO001Controller
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/AVISO")>
|
||||
Public Class AVISOV1Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValue(ByVal id As Integer) As String
|
||||
Return "Hello world!"
|
||||
End Function
|
||||
Public Function GetValue() As String
|
||||
Return "Hello world!"
|
||||
End Function
|
||||
@@ -196,14 +193,11 @@ Namespace ApiController.Controllers
|
||||
'------------------------------------------------------------------------
|
||||
|
||||
|
||||
<ApiVersion("001")>
|
||||
<System.Web.Http.Route("api/V001/TEST/AVISO")>
|
||||
Public Class AVISO001TESTController
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/TEST/AVISO")>
|
||||
Public Class AVISOV1TESTController
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValue(ByVal id As Integer) As String
|
||||
Return "Hello world!"
|
||||
End Function
|
||||
Public Function GetValue() As String
|
||||
Return "Hello world!"
|
||||
End Function
|
||||
@@ -0,0 +1,151 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace api_CustomsDeclaration.Controllers
|
||||
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/CustomsDeclaration")>
|
||||
Public Class CustomsDeclarationV1Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As VERAG_PROG_ALLGEMEIN.cVERAG_in_eza
|
||||
Dim EZA As New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza
|
||||
EZA.POSITIONS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_position)
|
||||
EZA.POSITIONS(0).DOCUMENTS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_position_document)
|
||||
'EZA.DOCUMENTS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_document)
|
||||
EZA.ADDRESS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_Adressen)
|
||||
|
||||
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)
|
||||
|
||||
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")
|
||||
|
||||
|
||||
Try
|
||||
|
||||
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")
|
||||
|
||||
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
|
||||
|
||||
Dim Reference = If(EZA_FREMD.Reference, "")
|
||||
|
||||
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
|
||||
|
||||
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 = ""
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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")
|
||||
|
||||
Return PostValue
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
Public Class jsonString
|
||||
|
||||
Shared Function FromClass(Of T)(data As T,
|
||||
Optional isEmptyToNull As Boolean = False,
|
||||
Optional jsonSettings As JsonSerializerSettings = Nothing) As String
|
||||
|
||||
Dim response As String = String.Empty
|
||||
|
||||
If Not EqualityComparer(Of T).Default.Equals(data, Nothing) Then
|
||||
response = JsonConvert.SerializeObject(data, jsonSettings)
|
||||
End If
|
||||
|
||||
Return If(isEmptyToNull, (If(response = "{}", "null", response)), response)
|
||||
|
||||
End Function
|
||||
|
||||
Shared Function ToClass(Of T)(data As String,
|
||||
Optional jsonSettings As JsonSerializerSettings = Nothing) As T
|
||||
|
||||
Dim response = Nothing
|
||||
|
||||
If Not String.IsNullOrEmpty(data) Then
|
||||
response = If(jsonSettings Is Nothing,
|
||||
JsonConvert.DeserializeObject(Of T)(data),
|
||||
JsonConvert.DeserializeObject(Of T)(data, jsonSettings))
|
||||
End If
|
||||
|
||||
Return response
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Class EZA_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
|
||||
|
||||
@@ -7,8 +7,8 @@ Namespace ApiController.Controllers
|
||||
|
||||
|
||||
|
||||
<ApiVersion("001")>
|
||||
<System.Web.Http.Route("api/V001/TR_NCTS")>
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/TR_NCTS")>
|
||||
Public Class TR_NCTSV001Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
|
||||
|
||||
Namespace NEWTESTController.Controllers
|
||||
|
||||
<ApiVersion("1")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/NEWTEST")>
|
||||
Public Class NEWTESTV1Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "NEWTEST 1111"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,22 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace ApiController.Controllers
|
||||
|
||||
<ApiVersion("1")>
|
||||
<Route("api/v{version:apiVersion}/TEST")>
|
||||
Public Class TESTController
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
<MapToApiVersion("1")>
|
||||
Public Function GetValues() As String
|
||||
Return "TEST 1"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
@@ -1,16 +1,12 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
|
||||
|
||||
Namespace api_CustomsDeclaration.Controllers
|
||||
|
||||
<ApiVersion("2.0")>
|
||||
<System.Web.Http.Route("api/v002/CustomsDeclaration")>
|
||||
Public Class CustomsDeclarationV1Controller
|
||||
<ApiVersion("2")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/CustomsDeclaration")>
|
||||
Public Class CustomsDeclarationV2Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As VERAG_PROG_ALLGEMEIN.cVERAG_in_eza
|
||||
@@ -54,6 +50,7 @@ Namespace api_CustomsDeclaration.Controllers
|
||||
'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)
|
||||
|
||||
@@ -393,152 +390,3 @@ Namespace api_CustomsDeclaration.Controllers
|
||||
'End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
Namespace api_CustomsDeclaration.Controllers
|
||||
|
||||
<ApiVersion("1.0")>
|
||||
<System.Web.Http.Route("api/v101/CustomsDeclaration")>
|
||||
Public Class CustomsDeclarationV2Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As VERAG_PROG_ALLGEMEIN.cVERAG_in_eza
|
||||
Dim EZA As New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza
|
||||
EZA.POSITIONS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_position)
|
||||
EZA.POSITIONS(0).DOCUMENTS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_position_document)
|
||||
'EZA.DOCUMENTS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_document)
|
||||
EZA.ADDRESS.Add(New VERAG_PROG_ALLGEMEIN.cVERAG_in_eza_Adressen)
|
||||
|
||||
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)
|
||||
|
||||
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")
|
||||
|
||||
|
||||
Try
|
||||
|
||||
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")
|
||||
|
||||
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
|
||||
|
||||
Dim Reference = If(EZA_FREMD.Reference, "")
|
||||
|
||||
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
|
||||
|
||||
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 = ""
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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")
|
||||
|
||||
Return PostValue
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
|
||||
|
||||
Public Class jsonString
|
||||
|
||||
Shared Function FromClass(Of T)(data As T,
|
||||
Optional isEmptyToNull As Boolean = False,
|
||||
Optional jsonSettings As JsonSerializerSettings = Nothing) As String
|
||||
|
||||
Dim response As String = String.Empty
|
||||
|
||||
If Not EqualityComparer(Of T).Default.Equals(data, Nothing) Then
|
||||
response = JsonConvert.SerializeObject(data, jsonSettings)
|
||||
End If
|
||||
|
||||
Return If(isEmptyToNull, (If(response = "{}", "null", response)), response)
|
||||
|
||||
End Function
|
||||
|
||||
Shared Function ToClass(Of T)(data As String,
|
||||
Optional jsonSettings As JsonSerializerSettings = Nothing) As T
|
||||
|
||||
Dim response = Nothing
|
||||
|
||||
If Not String.IsNullOrEmpty(data) Then
|
||||
response = If(jsonSettings Is Nothing,
|
||||
JsonConvert.DeserializeObject(Of T)(data),
|
||||
JsonConvert.DeserializeObject(Of T)(data, jsonSettings))
|
||||
End If
|
||||
|
||||
Return response
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Class EZA_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
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace NEWTESTController.Controllers
|
||||
|
||||
<ApiVersion("2")>
|
||||
<ApiVersion("3")>
|
||||
<System.Web.Http.Route("api/v{version:apiVersion}/NEWTEST")>
|
||||
Public Class NEWTESTV2Controller
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "NEWTEST 2222"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,24 @@
|
||||
Imports System.Net
|
||||
Imports System.Web.Http
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
|
||||
Namespace TESTController.Controllers.V2
|
||||
|
||||
|
||||
|
||||
<ApiVersion("2")>
|
||||
<Route("api/v{version:apiVersion}/TEST")>
|
||||
Public Class TESTController
|
||||
Inherits System.Web.Http.ApiController
|
||||
|
||||
Public Function GetValues() As String
|
||||
Return "TEST 2"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user