diff --git a/VERAG_REST_SERVER/Controllers/SDLControler/AuditFlowController.vb b/VERAG_REST_SERVER/Controllers/SDLControler/AuditFlowController.vb new file mode 100644 index 0000000..f556d97 --- /dev/null +++ b/VERAG_REST_SERVER/Controllers/SDLControler/AuditFlowController.vb @@ -0,0 +1,73 @@ +Imports System.IO +Imports System.Net +Imports System.Net.Http +Imports System.Threading +Imports System.Threading.Tasks +Imports System.Web.Http +Imports System.Web.Http.Description +Imports Microsoft.Web.Http +Imports Org.BouncyCastle.Asn1 +Imports VERAG_PROG_ALLGEMEIN +Imports VERAG_PROG_ALLGEMEIN.TESTJSON + +Namespace ApiController.Controllers + + + Public Class AuditFlowController + Inherits System.Web.Http.ApiController + + ''' + ''' Upload Attachment in Base64-Format and attach it to an existring LKW (with avisoId) or an specific consignment (with sendungsId) + ''' + + + + ''' Returns 200 if sucessfully + ''' Returns 400 update/upload failed + + + + + Public Async Function SetzePruefungAufErledigtMitAnhaengen(pruefungsId As Integer, Bemerkung As String, Optional anhaengeBase64 As List(Of String) = Nothing) As Task(Of HttpResponseMessage) + ' Globale Fehlerbehandlung einstellen + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False + VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.LOG + + Dim response As HttpResponseMessage + + Try + ' Eingabevalidierung + If String.IsNullOrWhiteSpace(Bemerkung) Then + Return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Der Parameter 'Bemerkung' darf nicht leer sein.") + End If + + If pruefungsId <= 0 Then + Return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "PrüfungsID muss gesetzt werden") + End If + + + If VERAG_PROG_ALLGEMEIN.cAuditFlow.SetzePruefungAufErledigtMitAnhaengen(pruefungsId, Bemerkung, anhaengeBase64) Then + + Return Request.CreateResponse(HttpStatusCode.OK) + Else + + Return Request.CreateResponse(HttpStatusCode.BadRequest) + + End If + + + + + + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine, System.Reflection.MethodInfo.GetCurrentMethod.Name) + response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Ein unerwarteter Fehler ist aufgetreten.") + End Try + + Return response + End Function + + End Class + +End Namespace \ No newline at end of file diff --git a/VERAG_REST_SERVER/VERAG_REST_SERVER.vbproj b/VERAG_REST_SERVER/VERAG_REST_SERVER.vbproj index 72af0b6..e3800df 100644 --- a/VERAG_REST_SERVER/VERAG_REST_SERVER.vbproj +++ b/VERAG_REST_SERVER/VERAG_REST_SERVER.vbproj @@ -383,6 +383,7 @@ +