diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index a00b2e98..ff5e4249 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/kassenbuch/frmBelegNeu.vb b/SDL/kassenbuch/frmBelegNeu.vb index 0849607d..9ff28fd0 100644 --- a/SDL/kassenbuch/frmBelegNeu.vb +++ b/SDL/kassenbuch/frmBelegNeu.vb @@ -369,8 +369,8 @@ Public Class frmBelegNeu lblFrachtf_Fahrer.Text = BELEG.Fahrer lblFrachtf_LKWNr.Text = BELEG.LKW_Kennzeichen Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA - Case "ATILLA" : cbxSplittung.Enabled = False - Case Else : cbxSplittung.Checked = Not If(BELEG.LKW_Beleg, False) + Case "ATILLA" : cbxSplittung.Checked = True : cbxSplittung.Enabled = True 'false + Case Else : cbxSplittung.Checked = Not If(BELEG.LKW_Beleg, True) End Select diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb new file mode 100644 index 00000000..0c0919dd --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb @@ -0,0 +1,1670 @@ +Imports System.Net.Http +Imports System.Web +Imports System +Imports Microsoft.AspNetCore.Authentication.Cookies +Imports Microsoft.AspNetCore.Builder +Imports Microsoft.AspNetCore.Hosting +Imports Microsoft.AspNetCore.Http +Imports Microsoft.Extensions.Configuration +Imports Microsoft.Extensions.DependencyInjection +Imports Microsoft.Extensions.Hosting +Imports System.Collections.Specialized +Imports System.Text +Imports System.IO +Imports VERAG_PROG_ALLGEMEIN +Imports System.Windows.Forms +Imports System.Drawing + + +Public Class cHMRC + + 'TEST + 'Shared API_STRING As String = "https://test-api.service.hmrc.gov.uk" + 'Shared CLIENT_ID As String = "xybTOMaQWcuifeW5xnGggojlACWC" + 'Shared CLIENT_SECRET As String = "bf1cfb6e-1bcb-4282-b7a0-3d3ccb2b1dc1" + + 'PROD + Shared API_STRING As String = "https://api.service.hmrc.gov.uk" + Shared CLIENT_ID As String = "qO1kqyMtFnvHi9XpRVJBGTCrNpno" + Shared CLIENT_SECRET As String = "3169852a-afa5-4adb-837c-fbd4d0cd4c7e" + + + Public Class cHMRCCredentials + Public CLIENT_ID As String = "" + Public CLIENT_SECRET As String = "" + Public API_STRING As String = "" + End Class + + Shared Function getCredentials(HMRC_APPLICATION) As cHMRCCredentials + Dim cHMRCCredentials = New cHMRCCredentials + Select Case HMRC_APPLICATION + Case "AVISO" + If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then + cHMRCCredentials.API_STRING = "https://test-api.service.hmrc.gov.uk" + cHMRCCredentials.CLIENT_ID = "xybTOMaQWcuifeW5xnGggojlACWC" + cHMRCCredentials.CLIENT_SECRET = "bf1cfb6e-1bcb-4282-b7a0-3d3ccb2b1dc1" + Else + cHMRCCredentials.API_STRING = "https://api.service.hmrc.gov.uk" + cHMRCCredentials.CLIENT_ID = "qO1kqyMtFnvHi9XpRVJBGTCrNpno" + cHMRCCredentials.CLIENT_SECRET = "3169852a-afa5-4adb-837c-fbd4d0cd4c7e" + End If + Case "AVISO_ENS" + + If cHMRC_ENS.TEST Or VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then + cHMRCCredentials.API_STRING = "https://test-api.service.hmrc.gov.uk" + cHMRCCredentials.CLIENT_ID = cHMRC_ENS.Client_ID + cHMRCCredentials.CLIENT_SECRET = cHMRC_ENS.Client_Secret + + Else + cHMRCCredentials.API_STRING = "https://api.service.hmrc.gov.uk" + cHMRCCredentials.CLIENT_ID = cHMRC_ENS.Client_ID + cHMRCCredentials.CLIENT_SECRET = cHMRC_ENS.Client_Secret + End If + End Select + Return cHMRCCredentials + End Function + + Shared Function SEND_GVMS(GVMS As VERAG_PROG_ALLGEMEIN.cGVMS, Optional updateGMR As String = "") + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim AccessToken = "" + grantAccess(AccessToken, "write:goods-movement-system+read:pull-notifications", "AVISO") + + If AccessToken <> "" Then + Dim Notification_Box_Id = "" + Dim Notification_Message_Id = "" + If genGVMS_GMR(GVMS, AccessToken, Notification_Box_Id, Notification_Message_Id, updateGMR) Then + GVMS.SAVE() + End If + End If + + End Function + + Shared Function GET_GVMS_LIST() + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim AccessToken = "" + grantAccess(AccessToken, "write:goods-movement-system", "AVISO") + + If AccessToken <> "" Then + If getGVMS_LIST(AccessToken) Then + MsgBox("LISTE: " & Now.ToShortDateString & " " & Now.ToShortTimeString) + End If + End If + + End Function + + Shared Function GET_GVMS_GMR(GMR As String) + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim AccessToken = "" + grantAccess(AccessToken, "write:goods-movement-system", "AVISO") + + If AccessToken <> "" Then + If getGVMS_GMR(GMR, AccessToken) Then + MsgBox("GMR: " & Now.ToShortDateString & " " & Now.ToShortTimeString) + End If + End If + + End Function + + + Shared Function DELETE_GMR(GVMS As VERAG_PROG_ALLGEMEIN.cGVMS) + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim AccessToken = "" + grantAccess(AccessToken, "write:goods-movement-system+read:pull-notifications", "AVISO") + + If AccessToken <> "" Then + Dim Notification_Box_Id = "" + Dim Notification_Message_Id = "" + If delGVMS_GMR(GVMS, AccessToken, Notification_Box_Id, Notification_Message_Id) Then + 'GVMS.delete() + MsgBox("GELÖSCHT: " & Now.ToShortDateString & " " & Now.ToShortTimeString) + End If + End If + + End Function + + Shared Function GET_NOTIFICATIONS(Notification_Box_Id As String) As Boolean + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim AccessTokenNotTEST1 = grantAccessApplication("", "read:pull-notifications") + If AccessTokenNotTEST1 <> "" Then + getGVMS_Notifications(AccessTokenNotTEST1, Notification_Box_Id) 'Notification_Box_Id) '"877b619c-33c1-4ab6-a34f-8bd7542e0596" + End If + End Function + Shared Function Acknowledge_NOTIFICATIONS(Notification_Box_Id As String, Notification_Message_Id As String) As Boolean + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + MsgBox("3") + Dim AccessTokenNotTEST1 = grantAccessApplication("", "write:notifications") + If AccessTokenNotTEST1 <> "" Then + MsgBox("4") + getGVMS_AcknolageNotifications(AccessTokenNotTEST1, Notification_Box_Id, Notification_Message_Id) '"877b619c-33c1-4ab6-a34f-8bd7542e0596" + End If + End Function + + Shared Sub hmrcTEST2() + 'Dim rClient As RestClient = New RestClient() + 'rClient.endPoint = "https://test-api.service.hmrc.gov.uk/hello/user" + 'Dim strResponse As String = String.Empty + 'strResponse = rClient.makeRequest(_accessToken) + + Dim rest As New Chilkat.Rest + + ' Connect to the REST server. + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + Dim success As Boolean = rest.Connect("https://test-api.service.hmrc.gov.uk", port, bTls, bAutoReconnect) + '389356931 -> VERAG-UNISPED + 'Dim responseJson As String = rest.FullRequestNoBody("GET", "/organisations/vat/check-vat-number/lookup/553557881") + 'Dim responseJson As String = rest.FullRequestNoBody("GET", "/organisations/vat/check-vat-number/lookup/553552881") 'falsch + Dim responseJson As String = rest.FullRequestNoBody("GET", "/organisations/vat/check-vat-number/lookup/5535532881") 'falsch + If (rest.LastMethodSuccess <> True) Then + Console.WriteLine(rest.LastErrorText) + Exit Sub + End If + + Try + + Dim read = Newtonsoft.Json.Linq.JObject.Parse(responseJson) + + If read.Item("code") IsNot Nothing Then + Dim VAT_Message = read.Item("message").ToString + Dim VAT_code = read.Item("code").ToString + MsgBox("ERROR: " & VAT_Message, MsgBoxStyle.OkOnly, VAT_code) + Else + ' Dim json As String = "{""name"":""Rap God"",""statistics"":{""likeCount"":""122255"",""dislikeCount"":""4472""}}" + Dim VAT_Name = read.Item("target")("name").ToString + Dim VAT_processingDate = read.Item("processingDate").ToString + Dim VAT_Strasse = read.Item("target")("address")("line1").ToString + Dim VAT_PLZ = read.Item("target")("address")("postcode").ToString + Dim VAT_countryCode = read.Item("target")("address")("countryCode").ToString + + MsgBox(VAT_Name) + MsgBox(VAT_processingDate) + End If + Catch ex As Exception + MsgBox(ex.Message & ex.StackTrace) + End Try + + + 'Console.WriteLine(responseJson) + 'Console.WriteLine("----") + + '' We can alternatively do this: + 'rest.ClearAllQueryParams() + '' rest.AddQueryParam("consumer_key", "YOUR_CONSUMER_KEY") + '' rest.AddQueryParam("consumer_secret", "YOUR_CONSUMER_SECRET") + 'responseJson = rest.FullRequestNoBody("GET", "/wp-json/wc/v1/products") + 'If (rest.LastMethodSuccess <> True) Then + ' Console.WriteLine(rest.LastErrorText) + ' Exit Sub + 'End If + + + Console.WriteLine(responseJson) + + End Sub + + + Shared Sub hmrcTEST() + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + '---------------------------REF DATA--------------------------- + + getGVMS_RefData() + + '-------------------------------------------------------------- + + + Exit Sub + + + '---------------------------NOTIFICATIONS--------------------------- + + Dim AccessTokenNotTEST1 = grantAccessApplication("", "read:pull-notifications") + If AccessTokenNotTEST1 <> "" Then + getGVMS_Notifications(AccessTokenNotTEST1, "877b619c-33c1-4ab6-a34f-8bd7542e0596") + End If + + '------------------------------------------------------------------- + Exit Sub + + + Dim AccessToken = "" + 'grantAccess(AccessToken, "write:goods-movement-system") + grantAccess(AccessToken, "write:goods-movement-system+read:pull-notifications", "AVISO") + 'getHMRC_Token(AccessToken, "write:goods-movement-system") + + ' MsgBox(AccessToken) + 'If AccessToken <> "" Then + + ' Dim Notification_Box_Id = "" + ' Dim Notification_Message_Id = "" + ' If genGVMS_GMR(AccessToken, Notification_Box_Id, Notification_Message_Id) Then + + ' Dim AccessTokenNotTEST = grantAccessApplication("", "read:pull-notifications") + + ' ' getHMRC_Token(AccessTokenNotTEST, "read:pull-notifications") + ' ' grantAccess(AccessTokenNotTEST, "read:pull-notifications") + ' If AccessTokenNotTEST <> "" Then + ' getGVMS_Notifications(AccessTokenNotTEST, Notification_Box_Id) + ' End If + ' 'If AccessToken <> "" Then + ' ' getGVMS_Notifications(AccessToken, Notification_Box_Id) + ' 'End If + ' End If + 'End If + + Exit Sub + 'UnlockCilkat() + + 'Dim AccessTokenNotTEST = "" + 'grantAccess(AccessTokenNotTEST, "read:pull-notifications") + 'If AccessTokenNotTEST <> "" Then + ' getGVMS_Notifications(AccessTokenNotTEST, "877b619c-33c1-4ab6-a34f-8bd7542e0596") + + 'End If + Exit Sub + + 'Dim AccessToken = "" + 'grantAccess(AccessToken, "write:goods-movement-system") + 'If AccessToken <> "" Then + + ' Dim Notification_Box_Id = "" + ' Dim Notification_Message_Id = "" + ' genGVMS_GMR(AccessToken, Notification_Box_Id, Notification_Message_Id) + + ' Dim AccessTokenNot = "" + ' grantAccess(AccessTokenNot, "read:pull-notifications") + ' If AccessTokenNot <> "" Then + ' getGVMS_Notifications(AccessTokenNot, Notification_Box_Id) + + ' End If + 'End If + + + + Exit Sub + getGVMS_RefData() + + Exit Sub + + + + Exit Sub + 'genGVMS_GMR("TEST") + + 'Exit Sub + 'Dim AccessToken = "" + 'grantAccess(AccessToken) + 'If AccessToken <> "" Then + ' genGVMS_GMR(AccessToken) + 'End If + End Sub + Shared Sub grantAccess(ByRef AccessToken, scope, HMRC_APPLICATION) + Try + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + Dim CREDENTIALS = getCredentials(HMRC_APPLICATION) + + Debug.WriteLine("HMRC Start") + Dim oauth2 As Chilkat.OAuth2 = New Chilkat.OAuth2() + Dim success As Boolean + + oauth2.ListenPort = 3017 + oauth2.AuthorizationEndpoint = CREDENTIALS.API_STRING & "/oauth/authorize" + oauth2.TokenEndpoint = CREDENTIALS.API_STRING & "/oauth/token" + oauth2.ClientId = CREDENTIALS.CLIENT_ID '"xybTOMaQWcuifeW5xnGggojlACWC" + oauth2.ClientSecret = CREDENTIALS.CLIENT_SECRET '"bf1cfb6e-1bcb-4282-b7a0-3d3ccb2b1dc1" + oauth2.Scope = scope '"write:goods-movement-system" + + 'oauth2.RedirectAllowHtml = "http://www.verag.ag/AVISO/Success.html" + 'oauth2.RedirectDenyHtml = "http://www.verag.ag/AVISO/Sussess.html" + + + Dim url As String = oauth2.StartAuth() + MsgBox(url) + + + + 'oauth2.AuthorizationEndpoint = "https://test-api.service.hmrc.gov.uk/oauth/authorize" + 'oauth2.TokenEndpoint = "https://test-api.service.hmrc.gov.uk/oauth/token" + + + + If oauth2.LastMethodSuccess <> True Then + Debug.WriteLine(oauth2.LastErrorText) + Exit Sub + End If + + Dim http As Chilkat.Http = New Chilkat.Http() + + Dim useBrowser = False + If Not useBrowser Then + System.Diagnostics.Process.Start(url) + Dim numMsWaited As Integer = 0 + + + While (numMsWaited < 120000) AndAlso (oauth2.AuthFlowState < 3) + oauth2.SleepMs(100) + numMsWaited = numMsWaited + 100 + End While + ' If there was no response from the browser within 30 seconds, then + ' the AuthFlowState will be equal to 1 Or 2. + ' 1: Waiting for Redirect. The OAuth2 background thread Is waiting to receive the redirect HTTP request from the browser. + ' 2: Waiting for Final Response. The OAuth2 background thread Is waiting for the final access token response. + ' In that case, cancel the background task started in the call to StartAuth. + + Else + + ' System.Diagnostics.Process.Start(url) + + Dim f As New Form + f.Size = New Size(800, 1400) + Dim wb As New WebBrowser + f.Controls.Add(wb) + f.StartPosition = FormStartPosition.CenterScreen + wb.Dock = DockStyle.Fill + wb.Navigate(url) + Dim done = False + + + 'AddHandler wb.DocumentCompleted, Sub() + ' If Not done Then + + ' If wb.Url.AbsolutePath = "/api-test-login/sign-in" Then + ' Try + ' Dim txtInput As HtmlElement = wb.Document.Forms(0).GetElementsByTagName("input").GetElementsByName("userId")(0) + ' txtInput.InnerText = "224015321897" + ' Dim txtInputPwd As HtmlElement = wb.Document.Forms(0).GetElementsByTagName("input").GetElementsByName("password")(0) + ' txtInputPwd.InnerText = "ry1cspz0nsvj" + ' done = True + ' Catch + ' End Try + ' End If + ' End If + ' MsgBox(wb.Url.AbsolutePath) + ' End Sub + + f.ShowDialog() + End If + + + + If oauth2.AuthFlowState < 3 Then + oauth2.Cancel() + Debug.WriteLine("No response from the browser!") + Exit Sub + End If + + Debug.WriteLine("HMRC here") + + + ' Check the AuthFlowState to see if authorization was granted, denied, Or if some error occurred + ' The possible AuthFlowState values are: + ' 3 Completed with Success. The OAuth2 flow has completed, the background thread exited, And the successful JSON response Is available in AccessTokenResponse property. + ' 4: Completed with Access Denied. The OAuth2 flow has completed, the background thread exited, And the error JSON Is available in AccessTokenResponse property. + ' 5: Failed Prior To Completion. The OAuth2 flow failed To complete, the background thread exited, And the error information Is available in the FailureInfo property. + + If oauth2.AuthFlowState = 5 Then + Debug.WriteLine("OAuth2 failed to complete.") + Debug.WriteLine(oauth2.FailureInfo) + Exit Sub + End If + + If oauth2.AuthFlowState = 4 Then + Debug.WriteLine("OAuth2 authorization was denied.") + Debug.WriteLine(oauth2.AccessTokenResponse) + Exit Sub + End If + + If oauth2.AuthFlowState <> 3 Then + Debug.WriteLine("Unexpected AuthFlowState:" & Convert.ToString(oauth2.AuthFlowState)) + Exit Sub + End If + + ' MsgBox("OAuth2 authorization granted!") + Debug.WriteLine("OAuth2 authorization granted!") + Debug.WriteLine("Access Token = " & oauth2.AccessToken) + Dim json As Chilkat.JsonObject = New Chilkat.JsonObject() + json.Load(oauth2.AccessTokenResponse) + json.EmitCompact = False + Debug.WriteLine(json.Emit()) + ' MsgBox(json.Emit()) + + ' The JSON response looks Like this + + ' { + ' "token_type": "Bearer", + ' "scope": "user_impersonation", + ' "expires_in": "3599", + ' "ext_expires_in": "0", + ' "expires_on": "1524783438", + ' "not_before": "1524779538", + ' "resource": "https://mydomain.api.crm.dynamics.com", + ' "access_token": "...", + ' "refresh_token": "...", + ' "id_token": "..." + ' } + + ' If an "expires_on" member does Not exist, then add the JSON member by + ' getting the current system date/time And adding the "expires_in" seconds. + ' This way we'll know when the token expires. + + If json.HasMember("expires_on") <> True Then + Dim dtExpire As Chilkat.CkDateTime = New Chilkat.CkDateTime() + dtExpire.SetFromCurrentSystemTime() + dtExpire.AddSeconds(json.IntOf("expires_in")) + json.AppendString("expires_on", dtExpire.GetAsUnixTimeStr(False)) + End If + + Debug.WriteLine(json.Emit()) + Dim fac As Chilkat.FileAccess = New Chilkat.FileAccess() + 'fac.WriteEntireTextFile("qa_data/tokens/hmrc.json", json.Emit(), "utf-8", False) + ' fac.WriteEntireTextFile("C:\Users\DEVELOPER1\Desktop\hmrc.json", json.Emit(), "utf-8", False) + AccessToken = oauth2.AccessToken + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + + + Shared Sub HMRC_RefreshToken(ByVal TOKEN As cHMRCToken, HMRC_APPLICATION As String) + + If DateDiff(DateInterval.Minute, TOKEN.token_refresh_datetime, Now) < 230 Then 'bis 240 MIN / 4hr + 'Token ist noch frisch + Exit Sub + End If + + ' Chilkat Lizenz aktivieren (falls benötigt) + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + ' HTTP-Objekt für API-Request erstellen + Dim http As New Chilkat.Http() + + ' URL für HMRC Token Refresh + ' Dim url As String = "/oauth/token" + + ' HTTP-Request-Objekt für POST-Anfrage + Dim req As New Chilkat.HttpRequest() + req.HttpVerb = "POST" + req.Path = "/oauth/token" + req.ContentType = "application/x-www-form-urlencoded" + + ' OAuth2 Credentials einfügen + Dim CREDENTIALS = getCredentials(HMRC_APPLICATION) + + + Dim TOKEN_NEW = "" + req.AddParam("client_secret", CREDENTIALS.CLIENT_SECRET) + req.AddParam("client_id", CREDENTIALS.CLIENT_ID) + req.AddParam("grant_type", "client_credentials") + req.AddParam("refresh_token", TOKEN_NEW) + + + + ' rest.AddQueryParam("scope", scope) + + + ' Anfrage senden + Dim resp As Chilkat.HttpResponse = http.PostUrlEncoded(CREDENTIALS.API_STRING & "/oauth/token", req) + + ' Fehlerprüfung + If resp Is Nothing Then + Console.WriteLine("Fehler: " & http.LastErrorText) + Exit Sub + End If + + ' API-Antwort ausgeben + Dim json As New Chilkat.JsonObject() + json.Load(resp.BodyStr) + + ' Neuer Access Token + Dim accessToken As String = json.StringOf("access_token") + Dim newRefreshToken As String = json.StringOf("refresh_token") + Dim expiresIn As String = json.StringOf("expires_in") + + Console.WriteLine("Neuer Access Token: " & accessToken) + Console.WriteLine("Neuer Refresh Token: " & newRefreshToken) + Console.WriteLine("Gültigkeit (Sekunden): " & expiresIn) + + ' Optional: Tokens in einer Datei speichern + 'Dim tokenFile As String = "token.json" + 'json.EmitCompact = False + 'json.WriteFile(tokenFile) + + TOKEN.token_BEARER_TOKEN = newRefreshToken + TOKEN.token_refresh_datetime = Now + TOKEN.SAVE() + + Console.WriteLine("Tokens wurden in TokenDB gespeichert.") + + End Sub + + + Shared Function grantAccessApplication(ByRef AccessToken, scope) As String + Try + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + Dim rest As New Chilkat.Rest + Dim success As Boolean + + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Return "" + End If + + + rest.AddHeader("Content-Type", "application/x-www-form-urlencoded") + + rest.AddQueryParam("client_secret", CLIENT_SECRET) + rest.AddQueryParam("client_id", CLIENT_ID) + rest.AddQueryParam("grant_type", "client_credentials") + rest.AddQueryParam("scope", scope) + + + Dim ResponseStr = rest.FullRequestFormUrlEncoded("POST", "/oauth/token") + + Dim respStatusCode As Integer = rest.ResponseStatusCode + + + If (respStatusCode <> 200) Then + Debug.WriteLine(rest.LastErrorText) + Return "" + End If + + Dim jsonResp = New Chilkat.JsonObject() + jsonResp.Load(ResponseStr) + + AccessToken = jsonResp.StringOf("access_token") + ' MsgBox("AccessToken: " & AccessToken) + 'jsonResp.StringOf("expires_in") + + Return AccessToken + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return "" + + End Function + + + Shared Sub VATTEST(hmrc_app_server_token) + + Dim rest As New Chilkat.Rest + Dim success As Boolean + + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + Exit Sub + End If + + + ' See the Online Tool for Generating JSON Creation Code + Dim json As New Chilkat.JsonObject + json.UpdateString("periodKey", "#001") + json.UpdateNumber("vatDueSales", "100.00") + json.UpdateNumber("vatDueAcquisitions", "100.00") + json.UpdateNumber("totalVatDue", "200") + json.UpdateNumber("vatReclaimedCurrPeriod", "100.00") + json.UpdateNumber("netVatDue", "100") + json.UpdateNumber("totalValueSalesExVAT", "500") + json.UpdateNumber("totalValuePurchasesExVAT", "500") + json.UpdateNumber("totalValueGoodsSuppliedExVAT", "500") + json.UpdateNumber("totalAcquisitionsExVAT", "500") + json.UpdateBool("finalised", True) + + + rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + json.EmitSb(sbRequestBody) + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("POST", "/organisations/vat/123456789/returns", sbRequestBody, sbResponseBody) + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Exit Sub + End If + + Dim respStatusCode As Integer = rest.ResponseStatusCode + If (respStatusCode >= 400) Then + Debug.WriteLine("Response Status Code = " & respStatusCode) + Debug.WriteLine("Response Header:") + Debug.WriteLine(rest.ResponseHeader) + Debug.WriteLine("Response Body:") + Debug.WriteLine(sbResponseBody.GetAsString()) + Exit Sub + End If + + + End Sub + + Shared Sub getGVMS_RefData() + + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim portSSL As Integer = 443 + Dim bAutoReconnect As Boolean = True + + success = rest.Connect(API_STRING, portSSL, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + + Exit Sub + End If + + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("GET", "/customs/goods-movement-system/reference-data", sbRequestBody, sbResponseBody) + + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Exit Sub + End If + + Dim respStatusCode As Integer = rest.ResponseStatusCode + If (respStatusCode <> 200) Then + MsgBox("respStatusCode: " & respStatusCode) + Debug.WriteLine("Response Status Code = " & respStatusCode) + Debug.WriteLine("Response Header:") + Debug.WriteLine(rest.ResponseHeader) + Debug.WriteLine("Response Body:") + Debug.WriteLine(sbResponseBody.GetAsString()) + + Exit Sub + End If + + MsgBox("OK " & respStatusCode) + + Dim jsonResp = New Chilkat.JsonObject() + jsonResp.LoadSb(sbResponseBody) + + VERAG_PROG_ALLGEMEIN.cGVMS_Routes.DELETE_ALL() + For i = 0 To jsonResp.SizeOfArray("routes") - 1 + + Dim ROUTE As New VERAG_PROG_ALLGEMEIN.cGVMS_Routes + + ROUTE.routeId = jsonResp.StringOf("routes[" & i & "].routeId") + ROUTE.routeDirection = jsonResp.StringOf("routes[" & i & "].routeDirection") + + ROUTE.routeEffectiveFrom = jsonResp.StringOf("routes[" & i & "].routeEffectiveFrom") + ROUTE.departurePortId = jsonResp.StringOf("routes[" & i & "].departurePortId") + ROUTE.arrivalPortId = jsonResp.StringOf("routes[" & i & "].arrivalPortId") + ROUTE.carrierId = jsonResp.StringOf("routes[" & i & "].carrierId") + ROUTE.routeEffectiveTo = jsonResp.StringOf("routes[" & i & "].routeEffectiveTo") + ROUTE.SAVE() + + Next + + + VERAG_PROG_ALLGEMEIN.cGVMS_Ports.DELETE_ALL() + For i = 0 To jsonResp.SizeOfArray("ports") - 1 + + Dim PORT As New VERAG_PROG_ALLGEMEIN.cGVMS_Ports + PORT.portId = jsonResp.StringOf("ports[" & i & "].portId") + PORT.portDescription = jsonResp.StringOf("ports[" & i & "].portDescription") + PORT.portRegion = jsonResp.StringOf("ports[" & i & "].portRegion") + PORT.portEffectiveFrom = jsonResp.StringOf("ports[" & i & "].portEffectiveFrom") + PORT.portDescription = jsonResp.StringOf("ports[" & i & "].portDescription") + PORT.chiefPortCode = jsonResp.StringOf("ports[" & i & "].chiefPortCode") + PORT.cdsPortCode = jsonResp.StringOf("ports[" & i & "].cdsPortCode") + PORT.officeOfTransitCustomsOfficeCode = jsonResp.StringOf("ports[" & i & "].officeOfTransitCustomsOfficeCode") + PORT.portEffectiveTo = jsonResp.StringOf("ports[" & i & "].portEffectiveTo") + PORT.portCountryCode = jsonResp.StringOf("ports[" & i & "].portCountryCode") + PORT.isOperatingArrivedExportsProcess = jsonResp.StringOf("ports[" & i & "].isOperatingArrivedExportsProcess") + PORT.SAVE() + Next + + VERAG_PROG_ALLGEMEIN.cGVMS_Carriers.DELETE_ALL() + For i = 0 To jsonResp.SizeOfArray("carriers") - 1 + + Dim CARRIER As New VERAG_PROG_ALLGEMEIN.cGVMS_Carriers + CARRIER.carrierId = jsonResp.StringOf("carriers[" & i & "].carrierId") + CARRIER.carrierName = jsonResp.StringOf("carriers[" & i & "].carrierName") + CARRIER.countryCode = jsonResp.StringOf("carriers[" & i & "].countryCode") + CARRIER.SAVE() + Next + + 'For i = 0 To jsonResp.SizeOfArray("locations") - 1 + + ' MsgBox(jsonResp.StringOf("locations[" & i & "].locationId")) + ' MsgBox(jsonResp.StringOf("locations[" & i & "].locationDescription")) + ' MsgBox(jsonResp.StringOf("locations[" & i & "].locationType")) + + 'Next + 'For i = 0 To jsonResp.SizeOfArray("inspectionTypes") - 1 + + ' MsgBox(jsonResp.StringOf("inspectionTypes[" & i & "].inspectionTypeId")) + ' MsgBox(jsonResp.StringOf("inspectionTypes[" & i & "].description")) + + 'Next + 'For i = 0 To jsonResp.SizeOfArray("ruleFailures") - 1 + + ' MsgBox(jsonResp.StringOf("ruleFailures[" & i & "].ruleId")) + ' MsgBox(jsonResp.StringOf("ruleFailures[" & i & "].ruleDescription")) + + 'Next + + MsgBox("FERTIG: " & Now.ToShortDateString & " " & Now.ToShortTimeString) + + End Sub + Private Shared Function genGVMS_GMR(ByRef GVMS As VERAG_PROG_ALLGEMEIN.cGVMS, hmrc_app_server_token As String, ByRef Notification_Box_Id As String, ByRef Notification_Message_Id As String, Optional updateGMR As String = "") As Boolean + Try + Dim rest As New Chilkat.Rest + Dim success As Boolean + + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Return False + End If + + ' See the Online Tool for Generating JSON Creation Code + Dim json As New Chilkat.JsonObject + json.UpdateString("direction", GVMS.gvms_direction) + json.UpdateBool("isUnaccompanied", GVMS.gvms_isUnaccompanied) + json.UpdateString("vehicleRegNum", GVMS.gvms_vehicleRegNum) 'LKW + If If(GVMS.gvms_trailorRegNum, "") <> "" Then json.UpdateString("trailerRegistrationNums", GVMS.gvms_trailorRegNum) 'Anhänger + + + json.UpdateString("plannedCrossing.routeId", GVMS.gvms_routeId) '--> Calais - Dover - DFDS + json.UpdateString("plannedCrossing.localDateTimeOfDeparture", Format(CDate(GVMS.gvms_locateDateTimeOfDeparture), "yyyy-MM-ddTHH:mm")) '"2021-08-11T10:58") + + + + If GVMS.gvms_empty Then + json.UpdateBool("emptyVehicle.isOwnVehicle", GVMS.gvms_emptyisOwn) + ' json.UpdateBool("emptyVehicle.sAndSMasterRefNum", GVMS.gvms_emptyisOwn) + Else + Dim cnt = 0 + '---------customsDeclarations---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.IMPORT Or POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.EXPORT Then + json.UpdateString("customsDeclarations[" & cnt & "].customsDeclarationId", POS.gvms_RefNum) + ' json.UpdateString("customsDeclarations[" & cnt & "].customsDeclarationPartId", "20GB01I0XLM976S001") + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("customsDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + '---------transitDeclarations TSAD---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.TSAD Then + json.UpdateString("transitDeclarations[" & cnt & "].transitDeclarationId", POS.gvms_RefNum) + json.UpdateBool("transitDeclarations[" & cnt & "].isTSAD", True) + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("transitDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + '---------transitDeclarations TAD---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.TAD Then + json.UpdateString("transitDeclarations[" & cnt & "].transitDeclarationId", POS.gvms_RefNum) + json.UpdateBool("transitDeclarations[" & cnt & "].isTSAD", False) + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("transitDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + '---------tirDeclarations---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.TIR Then + json.UpdateString("tirDeclarations[" & cnt & "].tirCarnetId", POS.gvms_RefNum) + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("tirDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + '---------ataDeclarations---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.ATA Then + json.UpdateString("ataDeclarations[" & cnt & "].ataCarnetId", POS.gvms_RefNum) + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("ataDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + + '---------eidrDeclarations---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.EIDR Then + json.UpdateString("eidrDeclarations[" & cnt & "].traderEORI", POS.gvms_RefNum) + If If(POS.gvms_SS, "") <> "" Then json.UpdateString("eidrDeclarations[" & cnt & "].sAndSMasterRefNum", POS.gvms_SS) + End If + cnt += 1 + Next + + + '---------indirectExportDeclarations---------------- + cnt = 0 + For Each POS In GVMS.GVMS_POSITIONEN + If POS.gvms_art = VERAG_PROG_ALLGEMEIN.cGVMS_POS_DecArt.INDIRECT Then + json.UpdateString("indirectExportDeclarations[" & cnt & "].eadMasterRefNum", POS.gvms_RefNum) + End If + cnt += 1 + Next + + End If + + + rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + json.EmitSb(sbRequestBody) + + + Dim sbResponseBody As New Chilkat.StringBuilder + + If updateGMR <> "" Then 'UPDATE! + success = rest.FullRequestSb("PUT", "/customs/goods-movement-system/movements/" & updateGMR, sbRequestBody, sbResponseBody) + Dim respStatusCode As Integer = rest.ResponseStatusCode + + If (respStatusCode = 404) Then 'update + MsgBox("GMR wurde nicht gefunden.") + Return False + End If + '403 + If (respStatusCode = 202) Then + MsgBox("UPDATE: " & Now.ToShortDateString & " " & Now.ToShortTimeString) + + Return True 'OK + Else + MsgBox("HMRC ERROR: " & respStatusCode & rest.ResponseHeader.ToString) + MsgBox("HMRC ERROR: " & sbResponseBody.ToString) + Return False + End If + + Else + success = rest.FullRequestSb("POST", "/customs/goods-movement-system/movements", sbRequestBody, sbResponseBody) + + + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Return False + End If + Dim respStatusCode As Integer = rest.ResponseStatusCode + + If (respStatusCode = 404) Then 'update + MsgBox("GMR wurde nicht gefunden.") + Return False + End If + + If (respStatusCode <> 202) Then + MsgBox("HMRC ERROR: " & respStatusCode & rest.ResponseHeader.ToString) + MsgBox("HMRC ERROR: " & sbResponseBody.ToString) + Return False + End If + + + + 'Dim jsonResp = New Chilkat.JsonObject() + 'jsonResp.Load(rest.ResponseHeader) + + + 'MsgBox(rest.ResponseHeader) + + 'MsgBox(jsonResp.StringOf("Notification-Box-Id")) + 'MsgBox(jsonResp.StringOf("Notification-Message-Id")) + + 'Notification_Box_Id = (jsonResp.StringOf("Notification-Box-Id")) + 'Notification_Message_Id = (jsonResp.StringOf("Notification-Message-Id")) + + For Each rh In rest.ResponseHeader.Split(vbNewLine) + If (rh.Contains("Notification-Box-Id: ")) Then + Notification_Box_Id = rh.Replace("Notification-Box-Id: ", "").Replace(vbNewLine, "").Replace(" ", "").Trim + ' MsgBox(Notification_Box_Id) + End If + If (rh.Contains("Notification-Message-Id: ")) Then + Notification_Message_Id = rh.Replace("Notification-Message-Id: ", "").Replace(vbNewLine, "").Replace(" ", "").Trim + ' MsgBox(Notification_Message_Id) + End If + Next + + GVMS.gvms_notification_id = Notification_Message_Id + GVMS.gvms_notification_boxid = Notification_Box_Id + + Return True + End If + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Private Shared Function delGVMS_GMR(ByRef GVMS As VERAG_PROG_ALLGEMEIN.cGVMS, hmrc_app_server_token As String, ByRef Notification_Box_Id As String, ByRef Notification_Message_Id As String) As Boolean + Try + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Return False + End If + + ' See the Online Tool for Generating JSON Creation Code + Dim json As New Chilkat.JsonObject + + ' rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + json.EmitSb(sbRequestBody) + + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("DELETE", "/customs/goods-movement-system/movements/" & GVMS.gvms_GMR, sbRequestBody, sbResponseBody) + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Return False + End If + Dim respStatusCode As Integer = rest.ResponseStatusCode + + If (respStatusCode = 404) Then + MsgBox("GMR wurde nicht gefunden.") + Return False + End If + If (respStatusCode <> 202) Then + MsgBox("HMRC ERROR: " & respStatusCode & rest.ResponseHeader.ToString) + Return False + End If + + + For Each rh In rest.ResponseHeader.Split(vbNewLine) + If (rh.Contains("Notification-Box-Id: ")) Then + Notification_Box_Id = rh.Replace("Notification-Box-Id: ", "").Replace(vbNewLine, "").Replace(" ", "").Trim + ' MsgBox(Notification_Box_Id) + End If + If (rh.Contains("Notification-Message-Id: ")) Then + Notification_Message_Id = rh.Replace("Notification-Message-Id: ", "").Replace(vbNewLine, "").Replace(" ", "").Trim + ' MsgBox(Notification_Message_Id) + End If + Next + + GVMS.gvms_notification_id = Notification_Message_Id + GVMS.gvms_notification_boxid = Notification_Box_Id + + Return True + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Private Shared Function getGVMS_LIST(hmrc_app_server_token As String) As Boolean + Try + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Return False + End If + + ' See the Online Tool for Generating JSON Creation Code + Dim json As New Chilkat.JsonObject + + ' rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + 'json.EmitSb(sbRequestBody) + + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("GET", "/customs/goods-movement-system/movements", sbRequestBody, sbResponseBody) + + MsgBox("GO " & success) + + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Return False + End If + Dim respStatusCode As Integer = rest.ResponseStatusCode + + + If (respStatusCode = 200) Then + MsgBox(sbResponseBody.ToString) + Return True + Else + MsgBox(sbResponseBody.ToString) + MsgBox(rest.ResponseHeader.ToString) + MsgBox("HMRC ERROR: " & respStatusCode & rest.ResponseHeader.ToString) + Return False + End If + + + Return True + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Private Shared Function getGVMS_GMR(GMR As String, hmrc_app_server_token As String) As Boolean + Try + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + MsgBox(rest.LastErrorText) + Return False + End If + + ' See the Online Tool for Generating JSON Creation Code + Dim json As New Chilkat.JsonObject + + ' rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + Dim sbRequestBody As New Chilkat.StringBuilder + + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("GET", "/customs/goods-movement-system/movements/" & GMR, sbRequestBody, sbResponseBody) + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Return False + End If + Dim respStatusCode As Integer = rest.ResponseStatusCode + + + If (respStatusCode = 200) Then + MsgBox(sbResponseBody.ToString) + Return True + Else + MsgBox("HMRC ERROR: " & respStatusCode & rest.ResponseHeader.ToString) + Return False + End If + + + Return True + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Private Shared Sub getGVMS_Notifications(hmrc_app_server_token As String, Notification_Box_Id As String) + Try + + + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + + Exit Sub + End If + '37d1feab8776c006f7fb7c9cc2f93172 + + + '"UK_INBOUND", + ' "UK_OUTBOUND", + ' "GB_TO_NI", + ' "NI_TO_GB" + + ' See the Online Tool for Generating JSON Creation Code + 'Dim json As New Chilkat.JsonObject + 'json.UpdateString("boxId", Notification_Box_Id) + ' json.UpdateString("status", "PENDING") + 'json.UpdateString("fromDate", "2020-06-03T14:20:54.987") + 'json.UpdateString("toDate", "2020-06-03T14:20:54.987") + + + ' rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + + Dim sbRequestBody As New Chilkat.StringBuilder + ' json.EmitSb(sbRequestBody) + + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("GET", "/misc/push-pull-notification/box/" & Notification_Box_Id & "/notifications", sbRequestBody, sbResponseBody) + + Dim respStatusCode As Integer = rest.ResponseStatusCode + + + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Exit Sub + End If + If (respStatusCode <> 200) Then + System.IO.File.WriteAllText("C:\Users\DEVELOPER1\Desktop\hmrc3.json", rest.ResponseHeader.ToString()) + + Debug.WriteLine("Response Status Code = " & respStatusCode) + Debug.WriteLine("Response Header:") + Debug.WriteLine(rest.ResponseHeader) + Debug.WriteLine("Response Body:") + Debug.WriteLine(sbResponseBody.GetAsString()) + Exit Sub + End If + + Dim strJson = sbResponseBody.ToString + + If strJson.StartsWith("[") Then + strJson = "{""arrNotification"":" & strJson & "}" + End If + + Dim jsonResp = New Chilkat.JsonObject() + jsonResp.Load(strJson) + + + + For i = 0 To jsonResp.SizeOfArray("arrNotification") - 1 + + 'MsgBox(jsonResp.StringOf("arrNotification[" & i & "].status")) + 'Dim notificationId = jsonResp.StringOf("arrNotification[" & i & "].notificationId") + 'If notificationId = "notificationId" Then + ' MsgBox("OOOO") + 'End If + + Dim jsonRespMsg = New Chilkat.JsonObject() + If jsonRespMsg.Load(jsonResp.StringOf("arrNotification[" & i & "].message")) Then + If jsonRespMsg.StringOf("gmrId") <> "" Then + Dim notificationId = jsonRespMsg.StringOf("messageId") + Dim GVMS = VERAG_PROG_ALLGEMEIN.cGVMS.LOAD_ByNotification(Notification_Box_Id, notificationId) + If GVMS IsNot Nothing Then + If jsonRespMsg.StringOf("gmrId") <> "" Then GVMS.gvms_GMR = jsonRespMsg.StringOf("gmrId") + If jsonRespMsg.StringOf("gmrState") <> "" Then GVMS.gvms_status = jsonRespMsg.StringOf("gmrState") + GVMS.SAVE() + End If + End If + End If + + ' MsgBox(jsonRespMsg.StringOf("messageId") & " / " & jsonRespMsg.StringOf("gmrId") & " / " & jsonRespMsg.StringOf("gmrState")) + + + Next + + 'i = 0; + 'count_i = json.SizeOfArray("product.variants"); + 'while (i < count_i) { + ' json.I = i; + ' id = json.IntOf("product.variants[i].id"); + ' product_id = json.IntOf("product.variants[i].product_id"); + ' title = json.StringOf("product.variants[i].title"); + ' price = json.StringOf("product.variants[i].price"); + ' sku = json.StringOf("product.variants[i].sku"); + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + + Private Shared Sub getGVMS_AcknolageNotifications(hmrc_app_server_token As String, Notification_Box_Id As String, Notification_Message_Id As String) + Try + + + Dim rest As New Chilkat.Rest + Dim success As Boolean + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + + Exit Sub + End If + + ' rest.AddHeader("Content-Type", "application/json") + rest.AddHeader("Authorization", "Bearer " & hmrc_app_server_token) + rest.AddHeader("Accept", "application/vnd.hmrc.1.0+json") + + + + Dim json As New Chilkat.JsonObject + json.Load("{ + ""notificationIds"": [ + """ & Notification_Message_Id & """ + ] + }") + + Dim sbRequestBody As New Chilkat.StringBuilder + json.EmitSb(sbRequestBody) + + + Dim sbResponseBody As New Chilkat.StringBuilder + success = rest.FullRequestSb("PUT", "/misc/push-pull-notification/box/" & Notification_Box_Id & "/notifications/acknowledge", sbRequestBody, sbResponseBody) + + Dim respStatusCode As Integer = rest.ResponseStatusCode + + MsgBox("OK: " & success) + If (success <> True) Then + Debug.WriteLine(rest.LastErrorText) + Exit Sub + End If + If (respStatusCode = 204) Then + MsgBox("ACKNOLAGED " & Now.ToShortDateString & " " & Now.ToShortTimeString) + Exit Sub + Else + System.IO.File.WriteAllText("C:\Users\DEVELOPER1\Desktop\hmrc3.json", rest.ResponseHeader.ToString()) + + Debug.WriteLine("Response Status Code = " & respStatusCode) + Debug.WriteLine("Response Header:") + Debug.WriteLine(rest.ResponseHeader) + Debug.WriteLine("Response Body:") + Debug.WriteLine(sbResponseBody.GetAsString()) + Exit Sub + End If + + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + + + '''''''''''''''''''''''''''''''''''''''''''''''''''''''' + ''' + 'Shared Sub testToken2() + ' Dim refresh_token As String + ' Dim token As String + + ' ' construct the request for access token + ' Dim client = New RestClient(API_STRING & "/oauth/token") + ' Dim request = New RestRequest("dfe/application-info", Method.POST) + ' request.AddHeader("content-type", "application/x-www-form-urlencoded") + ' request.AddParameter("grant_type", "client_credentials") + ' request.AddParameter("client_id", "") + ' request.AddParameter("client_secret", "") + + ' ' make call to get token + ' Dim response As IRestResponse = client.Execute(request) + + ' ' Extract token + ' token = JObject.Parse(response.Content).SelectToken("$..access_token").ToString() + ' refresh_token = JObject.Parse(response.Content).SelectToken("$..refresh_token").ToString() + 'End Sub + Shared Sub getHMRC_Token(ByRef AccessToken, scope) + 'oauth2.ListenPort = 3017 + ''oauth2.AuthorizationEndpoint = "https://test-api.service.hmrc.gov.uk/oauth/authorize" + ''oauth2.TokenEndpoint = "https://test-api.service.hmrc.gov.uk/oauth/token" + 'oauth2.AuthorizationEndpoint = API_STRING & "/oauth/authorize" + 'oauth2.TokenEndpoint = API_STRING & "/oauth/token" + 'oauth2.ClientId = "xybTOMaQWcuifeW5xnGggojlACWC" + 'oauth2.ClientSecret = "bf1cfb6e-1bcb-4282-b7a0-3d3ccb2b1dc1" + ''oauth2.Scope = "read:vat write:vat" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + 'oauth2.Scope = scope '"write:goods-movement-system" + 'Dim url As String = oauth2.StartAuth() + + + ' Refer to the documentation for more information on how to get the client id/secret + 'Dim clientId As String = "xybTOMaQWcuifeW5xnGggojlACWC" + ' Dim clientSecret As String = "bf1cfb6e-1bcb-4282-b7a0-3d3ccb2b1dc1" + ' Refer to the documentation for more information on how to get the tokens + 'Dim accessToken As String = "" '"OaOXXXXTaSucp8XXcgXXH" + ' Dim refreshToken As String = "kE4HXXXXXXXhxvtUHlboSF" + + ' -- Refresh the access token + Dim request As System.Net.WebRequest = System.Net.HttpWebRequest.Create(API_STRING & "/oauth/token") + 'oauth2.AuthorizationEndpoint = API_STRING & "/oauth/authorize" + ' oauth2.TokenEndpoint = API_STRING & "/oauth/token" + request.Method = "POST" + request.ContentType = "application/x-www-form-urlencoded" + 'request.ContentType = "application/json" + + Dim outgoingQueryString As NameValueCollection = HttpUtility.ParseQueryString(String.Empty) + outgoingQueryString.Add("grant_type", "client_credentials") + ' outgoingQueryString.Add("refresh_token", refreshToken) + outgoingQueryString.Add("client_id", CLIENT_ID) + outgoingQueryString.Add("client_secret", CLIENT_SECRET) + outgoingQueryString.Add("scope", scope) '"write:goods-movement-system") + Dim postBytes As Byte() = New ASCIIEncoding().GetBytes(outgoingQueryString.ToString()) + + Dim postStream As Stream = request.GetRequestStream() + postStream.Write(postBytes, 0, postBytes.Length) + postStream.Flush() + postStream.Close() + Try + + Using response As System.Net.WebResponse = request.GetResponse() + Using streamReader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) + ' Parse the JSON the way you prefer + 'FFFFFFFFFFFFFFFFFFALSE:::::::::::::::::::::::: Dim jsonResult As RefreshTokenResultJSON = New System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(streamReader.ReadToEnd(), GetType(RefreshTokenResultJSON)) + 'FFFFFFFFFFFFFFFFFFALSE:::::::::::::::::::::::: AccessToken = jsonResult.access_token + + + ' For more information, refer to the documentation + End Using + End Using + + Catch ex As Exception + MsgBox(ex.Message & ex.StackTrace) + End Try + '' -- Get current user profile + 'request = System.Net.HttpWebRequest.Create("https://api.clicdata.com/profile/user") + 'request.Method = "GET" + 'request.Headers.Add("Authorization", "Bearer " & accessToken) + 'Using response As System.Net.WebResponse = request.GetResponse() + ' Using streamReader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) + ' Dim jsonResponseText = streamReader.ReadToEnd() + ' ' Parse the JSON the way you prefer + ' ' In this example the JSON will be something Like: + ' ' {"email_address" "john.smith@clicdata.com", "first_name": "John", "last_login_date": "2016−04−26T14:24:58+00:00", "last_name": "Smith", ... + ' ' For more information, refer to the documentation + ' End Using + 'End Using + + '' -- List the current data + 'request = System.Net.HttpWebRequest.Create("https://api.clicdata.com/data/") + 'request.Method = "GET" + 'request.Headers.Add("Authorization", "Bearer " & accessToken) + 'Using response As System.Net.WebResponse = request.GetResponse() + ' Using streamReader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) + ' Dim jsonResponseText = streamReader.ReadToEnd() + ' ' Parse the JSON the way you prefer + ' ' In this example the JSON will be something Like: + ' ' { "count" 265, "data": [{ "description": "","source": "merge", "creation_date": "2015−06−10T12:47:32+02:00", "last_data_update_date": "2015−06−10T12:47:49+02:00", ... + ' ' For more information, refer to the documentation + ' End Using + 'End Using + + '' -- Create some new data + 'Dim dataId As Integer = 0 + 'request = System.Net.HttpWebRequest.Create("https://api.clicdata.com/data/") + 'request.Method = "POST" + 'request.ContentType = "application/json" + 'request.Headers.Add("Authorization", "Bearer " & accessToken) + 'Using tStreamWriter As System.IO.StreamWriter = New System.IO.StreamWriter(request.GetRequestStream()) + ' tStreamWriter.Write(New System.Web.Script.Serialization.JavaScriptSerializer().Serialize(New With {Key .name = "my test data " & Guid.NewGuid().ToString(), Key .description = "some description for my test data", Key .columns = {New With {Key .name = "column 1", Key .data_type = "text"}, New With {Key .name = "column 2", Key .data_type = "number"}}})) + 'End Using + + 'Using response As System.Net.WebResponse = request.GetResponse() + ' Using streamReader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) + ' Dim jsonResponseText = streamReader.ReadToEnd() + ' ' The JSON returned in this example is the ID of our newly created data + ' dataId = Integer.Parse(jsonResponseText) + ' ' For more information, refer to the documentation + ' End Using + 'End Using + + '' -- Add a few rows of data + 'request = System.Net.HttpWebRequest.Create("https://api.clicdata.com/data/" & dataId & "/rows") + 'request.Method = "POST" + 'request.ContentType = "application/json" + 'request.Headers.Add("Authorization", "Bearer " & accessToken) + 'Using tStreamWriter As System.IO.StreamWriter = New System.IO.StreamWriter(request.GetRequestStream()) + ' tStreamWriter.Write(New System.Web.Script.Serialization.JavaScriptSerializer().Serialize(New With {Key .data = New Object() {New Object() {"one", 1}, New Object() {"two", 2}}})) + 'End Using + + 'Using response As System.Net.WebResponse = request.GetResponse() + ' Using streamReader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) + ' Dim jsonResponseText = streamReader.ReadToEnd() + ' ' The JSON returned in this example tells us if the rows were inserted successfully: + ' ' { "success" true } + ' ' For more information, refer to the documentation + ' End Using + 'End Using + + + + + + End Sub + + + + Shared Function getTOKEN(APPLICATION, Optional forceNewToken = False) As cHMRCToken + Dim TOKEN = New cHMRCToken(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA, APPLICATION) + Dim appl = "" + Dim HMRC_APPLICATION = "AVISO" + Select Case APPLICATION + Case "HELLOWORLD" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "applicationRestricted" + HMRC_APPLICATION = "AVISO" + Case "GVMS" + appl = "write:goods-movement-system+read:pull-notifications" + HMRC_APPLICATION = "AVISO" + Case "VAT_CHECK" '"EORI_CHECK" + appl = "read:vat write:vat" + HMRC_APPLICATION = "AVISO" + Case "ENS" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "write:import-control-system" + HMRC_APPLICATION = "AVISO_ENS" + Case "ENS_HELLOWORLD" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "hello" + HMRC_APPLICATION = "AVISO_ENS" + End Select + + + + If forceNewToken OrElse TOKEN.hasEntry = False OrElse TOKEN.token_BEARER_TOKEN = "" Then + Dim AccessToken = "" + + grantAccess(AccessToken, appl, HMRC_APPLICATION) + TOKEN.token_Application = APPLICATION + TOKEN.token_BEARER_TOKEN = AccessToken + TOKEN.token_refresh_datetime = Now + TOKEN.SAVE() + Else + HMRC_RefreshToken(TOKEN, HMRC_APPLICATION) + End If + Return TOKEN + End Function + + + Shared Function checkEORI_UK(eoriNumber As String, ByVal response As String) As Boolean + ' Chilkat-Objekt initialisieren + Dim http As New Chilkat.Http + + http.SetRequestHeader("Accept", "application/x-www-form-urlencoded") + + ' EORI-Nummer für die Überprüfung + 'Dim eoriNumber As String = "GB123456789000" + Dim url As String = "https://api.service.hmrc.gov.uk/customs/eori/lookup/check-multiple-eori" + + + Dim requestBody As New Chilkat.JsonObject + requestBody.AppendArray("eoris").AddStringAt(-1, eoriNumber) + requestBody.AppendArray("eoris").AddStringAt(-1, "GB8392848394939") + + + + ' HTTP GET-Anfrage senden + Dim responseHttp = http.PostJson2(url, "application/json", requestBody.Emit()) + + ' Fehlerprüfung + If http.LastMethodSuccess <> True Then + Console.WriteLine("Fehler: " & http.LastErrorText) + Return False + End If + response = responseHttp.BodyStr + ' Antwort ausgeben + Console.WriteLine("API Antwort: " & responseHttp.BodyStr) + Return True + End Function + + Shared Function checkVAT_UK(VATNumber As String, ByVal response As String) As Boolean + ' Chilkat-Objekt initialisieren + Dim http As New Chilkat.Http + + ' Falls API-Schlüssel oder Authentifizierung erforderlich ist, hinzufügen + ' Beispiel: http.SetRequestHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN") + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + Dim TOKEN = getTOKEN("VAT_CHECK") + + If TOKEN.hasEntry Then + http.SetRequestHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) + http.SetRequestHeader("Accept", "application/x-www-form-urlencoded") + + ' EORI-Nummer für die Überprüfung + Dim url As String = "https://api.service.hmrc.gov.uk/organisations/vat/check-vat-number/lookup/" & VATNumber + + response = http.QuickGetStr(url) + + If http.LastMethodSuccess <> True Then + Console.WriteLine("Fehler: " & http.LastErrorText) + Return False + End If + + ' Antwort ausgeben + Console.WriteLine("API Antwort: " & response) + Return True + End If + Return False + End Function + + Public Class RefreshTokenResultJSON + Public Property access_token As String + End Class +End Class + +'Public Class Startup +' Public Sub New(ByVal configuration As IConfiguration) +' configuration = configuration +' End Sub + +' Public ReadOnly Property Configuration As IConfiguration + +' Public Sub ConfigureServices(ByVal services As IServiceCollection) +' services.Configure(Configuration) + +' services.Configure(Of CookiePolicyOptions)(Function(options) +' options.CheckConsentNeeded = Function(context) True +' options.MinimumSameSitePolicy = SameSiteMode.None +' End Function) +' services.AddSession(Function(options) +' options.IdleTimeout = TimeSpan.FromSeconds(10) +' options.Cookie.HttpOnly = True +' options.Cookie.IsEssential = True +' End Function) +' services.AddAuthentication(Function(options) +' options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme +' options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme +' options.DefaultChallengeScheme = "HMRC" +' End Function).AddCookie().AddOAuth("HMRC", Function(options) +' options.ClientId = Configuration("clientId") +' options.ClientSecret = Configuration("clientSecret") +' options.CallbackPath = New PathString(Configuration("oauthCallbackUri")) +' options.Scope.Add("hello") +' options.SaveTokens = True +' options.AuthorizationEndpoint = Configuration("uri") & "/oauth/authorize" +' options.TokenEndpoint = Configuration("uri") & "/oauth/token" +' End Function) +' services.AddRazorPages(Function(options) +' options.Conventions.AddPageRoute("/HelloWorld/Index", "") +' End Function) +' End Sub + +' Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IWebHostEnvironment) +' If env.IsDevelopment() Then +' app.UseDeveloperExceptionPage() +' Else +' app.UseExceptionHandler("/Error") +' app.UseHsts() +' End If + +' app.UseHttpsRedirection() +' app.UseStaticFiles() +' app.UseRouting() +' app.UseAuthorization() +' app.UseAuthentication() +' app.UseSession() +' app.UseCookiePolicy() +' app.UseEndpoints(Function(endpoints) +' endpoints.MapRazorPages() +' endpoints.MapControllerRoute(name:="default", pattern:="{controller=HelloWorld}/{action=Index}") +' End Function) +' End Sub +'End Class + + + +Public Class VATResponse + Public Class Address + Public Property line1 As String + Public Property postcode As String + Public Property countryCode As String + End Class + + Public Class Target + Public Property name As String + Public Property vatNumber As String + Public Property address As Address + End Class + + Public Class Root + Public Property target As Target + Public Property processingDate As DateTime + End Class + +End Class diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb new file mode 100644 index 00000000..d55ca5f5 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb @@ -0,0 +1,5665 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"ENS_CC315A","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace ENS_CC315A + + + Partial Public Class CC315AType + +#Region "Private fields" + Private _mesSenMES3 As String + + Private _mesRecMES6 As String + + Private _datOfPreMES9 As String + + Private _timOfPreMES10 As String + + Private _priMES15 As String + + Private _mesIdeMES19 As String + + Private _mesTypMES20 As MessageTypes + + Private _corIdeMES25 As String + + Private _hEAHEA As HEAHEAType + + Private _tRACONCO1 As TRACONCO1Type + + Private _tRACONCE1 As TRACONCE1Type + + Private _nOTPAR670 As NOTPAR670Type + + Private _gOOITEGDS As List(Of GOOITEGDSType) + + Private _iTI As List(Of ITIType) + + Private _cUSOFFLON As CUSOFFLONType + + Private _tRAREP As TRAREPType + + Private _pERLODSUMDEC As PERLODSUMDECType + + Private _sEAID529 As List(Of SEAID529Type) + + Private _cUSOFFFENT730 As CUSOFFFENT730Type + + Private _cUSOFFSENT740 As List(Of CUSOFFSENT740Type) + + Private _tRACARENT601 As TRACARENT601Type + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._tRACARENT601 = New TRACARENT601Type() + Me._cUSOFFSENT740 = New List(Of CUSOFFSENT740Type)() + Me._cUSOFFFENT730 = New CUSOFFFENT730Type() + Me._sEAID529 = New List(Of SEAID529Type)() + Me._pERLODSUMDEC = New PERLODSUMDECType() + Me._tRAREP = New TRAREPType() + Me._cUSOFFLON = New CUSOFFLONType() + Me._iTI = New List(Of ITIType)() + Me._gOOITEGDS = New List(Of GOOITEGDSType)() + Me._nOTPAR670 = New NOTPAR670Type() + Me._tRACONCE1 = New TRACONCE1Type() + Me._tRACONCO1 = New TRACONCO1Type() + Me._hEAHEA = New HEAHEAType() + End Sub + + + Public Property MesSenMES3() As String + Get + Return Me._mesSenMES3 + End Get + Set + Me._mesSenMES3 = Value + End Set + End Property + + + Public Property MesRecMES6() As String + Get + Return Me._mesRecMES6 + End Get + Set + Me._mesRecMES6 = Value + End Set + End Property + + + Public Property DatOfPreMES9() As String + Get + Return Me._datOfPreMES9 + End Get + Set + Me._datOfPreMES9 = Value + End Set + End Property + + + Public Property TimOfPreMES10() As String + Get + Return Me._timOfPreMES10 + End Get + Set + Me._timOfPreMES10 = Value + End Set + End Property + + + Public Property PriMES15() As String + Get + Return Me._priMES15 + End Get + Set + Me._priMES15 = Value + End Set + End Property + + + Public Property MesIdeMES19() As String + Get + Return Me._mesIdeMES19 + End Get + Set + Me._mesIdeMES19 = Value + End Set + End Property + + + Public Property MesTypMES20() As MessageTypes + Get + Return Me._mesTypMES20 + End Get + Set + Me._mesTypMES20 = Value + End Set + End Property + + + Public Property CorIdeMES25() As String + Get + Return Me._corIdeMES25 + End Get + Set + Me._corIdeMES25 = Value + End Set + End Property + + + Public Property HEAHEA() As HEAHEAType + Get + Return Me._hEAHEA + End Get + Set + Me._hEAHEA = Value + End Set + End Property + + + Public Property TRACONCO1() As TRACONCO1Type + Get + Return Me._tRACONCO1 + End Get + Set + Me._tRACONCO1 = Value + End Set + End Property + + + Public Property TRACONCE1() As TRACONCE1Type + Get + Return Me._tRACONCE1 + End Get + Set + Me._tRACONCE1 = Value + End Set + End Property + + + Public Property NOTPAR670() As NOTPAR670Type + Get + Return Me._nOTPAR670 + End Get + Set + Me._nOTPAR670 = Value + End Set + End Property + + + Public Property GOOITEGDS() As List(Of GOOITEGDSType) + Get + Return Me._gOOITEGDS + End Get + Set + Me._gOOITEGDS = Value + End Set + End Property + + + Public Property ITI() As List(Of ITIType) + Get + Return Me._iTI + End Get + Set + Me._iTI = Value + End Set + End Property + + + Public Property CUSOFFLON() As CUSOFFLONType + Get + Return Me._cUSOFFLON + End Get + Set + Me._cUSOFFLON = Value + End Set + End Property + + + Public Property TRAREP() As TRAREPType + Get + Return Me._tRAREP + End Get + Set + Me._tRAREP = Value + End Set + End Property + + + Public Property PERLODSUMDEC() As PERLODSUMDECType + Get + Return Me._pERLODSUMDEC + End Get + Set + Me._pERLODSUMDEC = Value + End Set + End Property + + + Public Property SEAID529() As List(Of SEAID529Type) + Get + Return Me._sEAID529 + End Get + Set + Me._sEAID529 = Value + End Set + End Property + + + Public Property CUSOFFFENT730() As CUSOFFFENT730Type + Get + Return Me._cUSOFFFENT730 + End Get + Set + Me._cUSOFFFENT730 = Value + End Set + End Property + + + Public Property CUSOFFSENT740() As List(Of CUSOFFSENT740Type) + Get + Return Me._cUSOFFSENT740 + End Get + Set + Me._cUSOFFSENT740 = Value + End Set + End Property + + + Public Property TRACARENT601() As TRACARENT601Type + Get + Return Me._tRACARENT601 + End Get + Set + Me._tRACARENT601 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC315AType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CC315AType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CC315AType object + ''' + ''' string to deserialize + ''' Output CC315AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC315AType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CC315AType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC315AType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC315AType + Return CType(SerializerXml.Deserialize(s), CC315AType) + End Function +#End Region + + ''' + ''' Serializes current CC315AType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CC315AType object + ''' + ''' File to load and deserialize + ''' Output CC315AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC315AType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC315AType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum MessageTypes + + CC304A + + CC305A + + CC313A + + CC315A + + CC316A + + CC323A + + CC324A + + CC325A + + CC328A + + CC351A + + CD030C + + CD031C + + CD032C + + CD070B + + CD071B + + CD301A + + CD302A + + CD303A + + CD319A + + CD411C + + CD412C + + CD906B + + CD912B + + CD913B + + CD914B + + CD916B + + CD917B + + CD931C + + CD932C + + CD971B + End Enum + + + Partial Public Class HEAHEAType + +#Region "Private fields" + Private _refNumHEA4 As String + + Private _traModAtBorHEA76 As String + + Private _ideOfMeaOfTraCroHEA85 As String + + Private _ideOfMeaOfTraCroHEA85LNG As String + + Private _natOfMeaOfTraCroHEA87 As String + + Private _totNumOfIteHEA305 As String + + Private _totNumOfPacHEA306 As String + + Private _totGroMasHEA307 As Decimal + + Private _decPlaHEA394 As String + + Private _decPlaHEA394LNG As String + + Private _speCirIndHEA1 As String + + Private _traChaMetOfPayHEA1 As String + + Private _comRefNumHEA As String + + Private _conRefNumHEA As String + + Private _plaLoaGOOITE334 As String + + Private _plaLoaGOOITE334LNG As String + + Private _plaUnlGOOITE334 As String + + Private _codPlUnHEA357LNG As String + + Private _decDatTimHEA114 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumHEA4() As String + Get + Return Me._refNumHEA4 + End Get + Set + Me._refNumHEA4 = Value + End Set + End Property + + + Public Property TraModAtBorHEA76() As String + Get + Return Me._traModAtBorHEA76 + End Get + Set + Me._traModAtBorHEA76 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85() As String + Get + Return Me._ideOfMeaOfTraCroHEA85 + End Get + Set + Me._ideOfMeaOfTraCroHEA85 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85LNG() As String + Get + Return Me._ideOfMeaOfTraCroHEA85LNG + End Get + Set + Me._ideOfMeaOfTraCroHEA85LNG = Value + End Set + End Property + + + Public Property NatOfMeaOfTraCroHEA87() As String + Get + Return Me._natOfMeaOfTraCroHEA87 + End Get + Set + Me._natOfMeaOfTraCroHEA87 = Value + End Set + End Property + + + Public Property TotNumOfIteHEA305() As String + Get + Return Me._totNumOfIteHEA305 + End Get + Set + Me._totNumOfIteHEA305 = Value + End Set + End Property + + + Public Property TotNumOfPacHEA306() As String + Get + Return Me._totNumOfPacHEA306 + End Get + Set + Me._totNumOfPacHEA306 = Value + End Set + End Property + + + Public Property TotGroMasHEA307() As Decimal + Get + Return Me._totGroMasHEA307 + End Get + Set + Me._totGroMasHEA307 = Value + End Set + End Property + + + Public Property DecPlaHEA394() As String + Get + Return Me._decPlaHEA394 + End Get + Set + Me._decPlaHEA394 = Value + End Set + End Property + + + Public Property DecPlaHEA394LNG() As String + Get + Return Me._decPlaHEA394LNG + End Get + Set + Me._decPlaHEA394LNG = Value + End Set + End Property + + + Public Property SpeCirIndHEA1() As String + Get + Return Me._speCirIndHEA1 + End Get + Set + Me._speCirIndHEA1 = Value + End Set + End Property + + + Public Property TraChaMetOfPayHEA1() As String + Get + Return Me._traChaMetOfPayHEA1 + End Get + Set + Me._traChaMetOfPayHEA1 = Value + End Set + End Property + + + Public Property ComRefNumHEA() As String + Get + Return Me._comRefNumHEA + End Get + Set + Me._comRefNumHEA = Value + End Set + End Property + + + Public Property ConRefNumHEA() As String + Get + Return Me._conRefNumHEA + End Get + Set + Me._conRefNumHEA = Value + End Set + End Property + + + Public Property PlaLoaGOOITE334() As String + Get + Return Me._plaLoaGOOITE334 + End Get + Set + Me._plaLoaGOOITE334 = Value + End Set + End Property + + + Public Property PlaLoaGOOITE334LNG() As String + Get + Return Me._plaLoaGOOITE334LNG + End Get + Set + Me._plaLoaGOOITE334LNG = Value + End Set + End Property + + + Public Property PlaUnlGOOITE334() As String + Get + Return Me._plaUnlGOOITE334 + End Get + Set + Me._plaUnlGOOITE334 = Value + End Set + End Property + + + Public Property CodPlUnHEA357LNG() As String + Get + Return Me._codPlUnHEA357LNG + End Get + Set + Me._codPlUnHEA357LNG = Value + End Set + End Property + + + Public Property DecDatTimHEA114() As String + Get + Return Me._decDatTimHEA114 + End Get + Set + Me._decDatTimHEA114 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HEAHEAType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes HEAHEAType object + ''' + ''' string to deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType + Return CType(SerializerXml.Deserialize(s), HEAHEAType) + End Function +#End Region + + ''' + ''' Serializes current HEAHEAType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an HEAHEAType object + ''' + ''' File to load and deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACARENT601Type + +#Region "Private fields" + Private _namTRACARENT604 As String + + Private _strNumTRACARENT607 As String + + Private _pstCodTRACARENT606 As String + + Private _ctyTRACARENT603 As String + + Private _couCodTRACARENT605 As String + + Private _tRACARENT601LNG As String + + Private _tINTRACARENT602 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRACARENT604() As String + Get + Return Me._namTRACARENT604 + End Get + Set + Me._namTRACARENT604 = Value + End Set + End Property + + + Public Property StrNumTRACARENT607() As String + Get + Return Me._strNumTRACARENT607 + End Get + Set + Me._strNumTRACARENT607 = Value + End Set + End Property + + + Public Property PstCodTRACARENT606() As String + Get + Return Me._pstCodTRACARENT606 + End Get + Set + Me._pstCodTRACARENT606 = Value + End Set + End Property + + + Public Property CtyTRACARENT603() As String + Get + Return Me._ctyTRACARENT603 + End Get + Set + Me._ctyTRACARENT603 = Value + End Set + End Property + + + Public Property CouCodTRACARENT605() As String + Get + Return Me._couCodTRACARENT605 + End Get + Set + Me._couCodTRACARENT605 = Value + End Set + End Property + + + Public Property TRACARENT601LNG() As String + Get + Return Me._tRACARENT601LNG + End Get + Set + Me._tRACARENT601LNG = Value + End Set + End Property + + + Public Property TINTRACARENT602() As String + Get + Return Me._tINTRACARENT602 + End Get + Set + Me._tINTRACARENT602 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACARENT601Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACARENT601Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACARENT601Type object + ''' + ''' string to deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACARENT601Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACARENT601Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACARENT601Type + Return CType(SerializerXml.Deserialize(s), TRACARENT601Type) + End Function +#End Region + + ''' + ''' Serializes current TRACARENT601Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACARENT601Type object + ''' + ''' File to load and deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACARENT601Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFSENT740Type + +#Region "Private fields" + Private _refNumSUBENR909 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumSUBENR909() As String + Get + Return Me._refNumSUBENR909 + End Get + Set + Me._refNumSUBENR909 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFSENT740Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFSENT740Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFSENT740Type object + ''' + ''' string to deserialize + ''' Output CUSOFFSENT740Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFSENT740Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFSENT740Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFSENT740Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFSENT740Type + Return CType(SerializerXml.Deserialize(s), CUSOFFSENT740Type) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFSENT740Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFSENT740Type object + ''' + ''' File to load and deserialize + ''' Output CUSOFFSENT740Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFSENT740Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFSENT740Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFFENT730Type + +#Region "Private fields" + Private _refNumCUSOFFFENT731 As String + + Private _expDatOfArrFIRENT733 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCUSOFFFENT731() As String + Get + Return Me._refNumCUSOFFFENT731 + End Get + Set + Me._refNumCUSOFFFENT731 = Value + End Set + End Property + + + Public Property ExpDatOfArrFIRENT733() As String + Get + Return Me._expDatOfArrFIRENT733 + End Get + Set + Me._expDatOfArrFIRENT733 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFFENT730Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFFENT730Type object + ''' + ''' string to deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type + Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFFENT730Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFFENT730Type object + ''' + ''' File to load and deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class SEAID529Type + +#Region "Private fields" + Private _seaIdSEAID530 As String + + Private _seaIdSEAID530LNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property SeaIdSEAID530() As String + Get + Return Me._seaIdSEAID530 + End Get + Set + Me._seaIdSEAID530 = Value + End Set + End Property + + + Public Property SeaIdSEAID530LNG() As String + Get + Return Me._seaIdSEAID530LNG + End Get + Set + Me._seaIdSEAID530LNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SEAID529Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize SEAID529Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes SEAID529Type object + ''' + ''' string to deserialize + ''' Output SEAID529Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SEAID529Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As SEAID529Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SEAID529Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As SEAID529Type + Return CType(SerializerXml.Deserialize(s), SEAID529Type) + End Function +#End Region + + ''' + ''' Serializes current SEAID529Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an SEAID529Type object + ''' + ''' File to load and deserialize + ''' Output SEAID529Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SEAID529Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SEAID529Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PERLODSUMDECType + +#Region "Private fields" + Private _namPLD1 As String + + Private _strAndNumPLD1 As String + + Private _posCodPLD1 As String + + Private _citPLD1 As String + + Private _couCodPLD1 As String + + Private _pERLODSUMDECLNG As String + + Private _tINPLD1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamPLD1() As String + Get + Return Me._namPLD1 + End Get + Set + Me._namPLD1 = Value + End Set + End Property + + + Public Property StrAndNumPLD1() As String + Get + Return Me._strAndNumPLD1 + End Get + Set + Me._strAndNumPLD1 = Value + End Set + End Property + + + Public Property PosCodPLD1() As String + Get + Return Me._posCodPLD1 + End Get + Set + Me._posCodPLD1 = Value + End Set + End Property + + + Public Property CitPLD1() As String + Get + Return Me._citPLD1 + End Get + Set + Me._citPLD1 = Value + End Set + End Property + + + Public Property CouCodPLD1() As String + Get + Return Me._couCodPLD1 + End Get + Set + Me._couCodPLD1 = Value + End Set + End Property + + + Public Property PERLODSUMDECLNG() As String + Get + Return Me._pERLODSUMDECLNG + End Get + Set + Me._pERLODSUMDECLNG = Value + End Set + End Property + + + Public Property TINPLD1() As String + Get + Return Me._tINPLD1 + End Get + Set + Me._tINPLD1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PERLODSUMDECType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PERLODSUMDECType object + ''' + ''' string to deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType + Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType) + End Function +#End Region + + ''' + ''' Serializes current PERLODSUMDECType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PERLODSUMDECType object + ''' + ''' File to load and deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRAREPType + +#Region "Private fields" + Private _namTRE1 As String + + Private _strAndNumTRE1 As String + + Private _posCodTRE1 As String + + Private _citTRE1 As String + + Private _couCodTRE1 As String + + Private _tRAREPLNG As String + + Private _tINTRE1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRE1() As String + Get + Return Me._namTRE1 + End Get + Set + Me._namTRE1 = Value + End Set + End Property + + + Public Property StrAndNumTRE1() As String + Get + Return Me._strAndNumTRE1 + End Get + Set + Me._strAndNumTRE1 = Value + End Set + End Property + + + Public Property PosCodTRE1() As String + Get + Return Me._posCodTRE1 + End Get + Set + Me._posCodTRE1 = Value + End Set + End Property + + + Public Property CitTRE1() As String + Get + Return Me._citTRE1 + End Get + Set + Me._citTRE1 = Value + End Set + End Property + + + Public Property CouCodTRE1() As String + Get + Return Me._couCodTRE1 + End Get + Set + Me._couCodTRE1 = Value + End Set + End Property + + + Public Property TRAREPLNG() As String + Get + Return Me._tRAREPLNG + End Get + Set + Me._tRAREPLNG = Value + End Set + End Property + + + Public Property TINTRE1() As String + Get + Return Me._tINTRE1 + End Get + Set + Me._tINTRE1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRAREPType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRAREPType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRAREPType object + ''' + ''' string to deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRAREPType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRAREPType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRAREPType + Return CType(SerializerXml.Deserialize(s), TRAREPType) + End Function +#End Region + + ''' + ''' Serializes current TRAREPType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRAREPType object + ''' + ''' File to load and deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRAREPType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFLONType + +#Region "Private fields" + Private _refNumCOL1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCOL1() As String + Get + Return Me._refNumCOL1 + End Get + Set + Me._refNumCOL1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFLONType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFLONType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFLONType object + ''' + ''' string to deserialize + ''' Output CUSOFFLONType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFLONType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFLONType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFLONType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFLONType + Return CType(SerializerXml.Deserialize(s), CUSOFFLONType) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFLONType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFLONType object + ''' + ''' File to load and deserialize + ''' Output CUSOFFLONType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFLONType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFLONType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class ITIType + +#Region "Private fields" + Private _couOfRouCodITI1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property CouOfRouCodITI1() As String + Get + Return Me._couOfRouCodITI1 + End Get + Set + Me._couOfRouCodITI1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ITIType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ITIType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes ITIType object + ''' + ''' string to deserialize + ''' Output ITIType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ITIType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As ITIType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ITIType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As ITIType + Return CType(SerializerXml.Deserialize(s), ITIType) + End Function +#End Region + + ''' + ''' Serializes current ITIType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an ITIType object + ''' + ''' File to load and deserialize + ''' Output ITIType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ITIType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ITIType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PRTNOT640Type + +#Region "Private fields" + Private _namPRTNOT642 As String + + Private _strNumPRTNOT646 As String + + Private _pstCodPRTNOT644 As String + + Private _ctyPRTNOT643 As String + + Private _couCodGINOT647 As String + + Private _pRTNOT640LNG As String + + Private _tINPRTNOT641 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamPRTNOT642() As String + Get + Return Me._namPRTNOT642 + End Get + Set + Me._namPRTNOT642 = Value + End Set + End Property + + + Public Property StrNumPRTNOT646() As String + Get + Return Me._strNumPRTNOT646 + End Get + Set + Me._strNumPRTNOT646 = Value + End Set + End Property + + + Public Property PstCodPRTNOT644() As String + Get + Return Me._pstCodPRTNOT644 + End Get + Set + Me._pstCodPRTNOT644 = Value + End Set + End Property + + + Public Property CtyPRTNOT643() As String + Get + Return Me._ctyPRTNOT643 + End Get + Set + Me._ctyPRTNOT643 = Value + End Set + End Property + + + Public Property CouCodGINOT647() As String + Get + Return Me._couCodGINOT647 + End Get + Set + Me._couCodGINOT647 = Value + End Set + End Property + + + Public Property PRTNOT640LNG() As String + Get + Return Me._pRTNOT640LNG + End Get + Set + Me._pRTNOT640LNG = Value + End Set + End Property + + + Public Property TINPRTNOT641() As String + Get + Return Me._tINPRTNOT641 + End Get + Set + Me._tINPRTNOT641 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRTNOT640Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PRTNOT640Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PRTNOT640Type object + ''' + ''' string to deserialize + ''' Output PRTNOT640Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRTNOT640Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PRTNOT640Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRTNOT640Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRTNOT640Type + Return CType(SerializerXml.Deserialize(s), PRTNOT640Type) + End Function +#End Region + + ''' + ''' Serializes current PRTNOT640Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PRTNOT640Type object + ''' + ''' File to load and deserialize + ''' Output PRTNOT640Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRTNOT640Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRTNOT640Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PACGS2Type + +#Region "Private fields" + Private _kinOfPacGS23 As String + + Private _numOfPacGS24 As String + + Private _numOfPieGS25 As String + + Private _marNumOfPacGSL21 As String + + Private _marNumOfPacGSL21LNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property KinOfPacGS23() As String + Get + Return Me._kinOfPacGS23 + End Get + Set + Me._kinOfPacGS23 = Value + End Set + End Property + + + Public Property NumOfPacGS24() As String + Get + Return Me._numOfPacGS24 + End Get + Set + Me._numOfPacGS24 = Value + End Set + End Property + + + Public Property NumOfPieGS25() As String + Get + Return Me._numOfPieGS25 + End Get + Set + Me._numOfPieGS25 = Value + End Set + End Property + + + Public Property MarNumOfPacGSL21() As String + Get + Return Me._marNumOfPacGSL21 + End Get + Set + Me._marNumOfPacGSL21 = Value + End Set + End Property + + + Public Property MarNumOfPacGSL21LNG() As String + Get + Return Me._marNumOfPacGSL21LNG + End Get + Set + Me._marNumOfPacGSL21LNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PACGS2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PACGS2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PACGS2Type object + ''' + ''' string to deserialize + ''' Output PACGS2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PACGS2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PACGS2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PACGS2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PACGS2Type + Return CType(SerializerXml.Deserialize(s), PACGS2Type) + End Function +#End Region + + ''' + ''' Serializes current PACGS2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PACGS2Type object + ''' + ''' File to load and deserialize + ''' Output PACGS2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PACGS2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PACGS2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class IDEMEATRAGI970Type + +#Region "Private fields" + Private _natIDEMEATRAGI973 As String + + Private _ideMeaTraGIMEATRA971 As String + + Private _ideMeaTraGIMEATRA972LNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NatIDEMEATRAGI973() As String + Get + Return Me._natIDEMEATRAGI973 + End Get + Set + Me._natIDEMEATRAGI973 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA971() As String + Get + Return Me._ideMeaTraGIMEATRA971 + End Get + Set + Me._ideMeaTraGIMEATRA971 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA972LNG() As String + Get + Return Me._ideMeaTraGIMEATRA972LNG + End Get + Set + Me._ideMeaTraGIMEATRA972LNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDEMEATRAGI970Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IDEMEATRAGI970Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes IDEMEATRAGI970Type object + ''' + ''' string to deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As IDEMEATRAGI970Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDEMEATRAGI970Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As IDEMEATRAGI970Type + Return CType(SerializerXml.Deserialize(s), IDEMEATRAGI970Type) + End Function +#End Region + + ''' + ''' Serializes current IDEMEATRAGI970Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an IDEMEATRAGI970Type object + ''' + ''' File to load and deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IDEMEATRAGI970Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CONNR2Type + +#Region "Private fields" + Private _conNumNR21 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ConNumNR21() As String + Get + Return Me._conNumNR21 + End Get + Set + Me._conNumNR21 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CONNR2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CONNR2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CONNR2Type object + ''' + ''' string to deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CONNR2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CONNR2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CONNR2Type + Return CType(SerializerXml.Deserialize(s), CONNR2Type) + End Function +#End Region + + ''' + ''' Serializes current CONNR2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CONNR2Type object + ''' + ''' File to load and deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CONNR2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACONCE2Type + +#Region "Private fields" + Private _namCE27 As String + + Private _strAndNumCE222 As String + + Private _posCodCE223 As String + + Private _citCE224 As String + + Private _couCE225 As String + + Private _nADLNGGICE As String + + Private _tINCE259 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamCE27() As String + Get + Return Me._namCE27 + End Get + Set + Me._namCE27 = Value + End Set + End Property + + + Public Property StrAndNumCE222() As String + Get + Return Me._strAndNumCE222 + End Get + Set + Me._strAndNumCE222 = Value + End Set + End Property + + + Public Property PosCodCE223() As String + Get + Return Me._posCodCE223 + End Get + Set + Me._posCodCE223 = Value + End Set + End Property + + + Public Property CitCE224() As String + Get + Return Me._citCE224 + End Get + Set + Me._citCE224 = Value + End Set + End Property + + + Public Property CouCE225() As String + Get + Return Me._couCE225 + End Get + Set + Me._couCE225 = Value + End Set + End Property + + + Public Property NADLNGGICE() As String + Get + Return Me._nADLNGGICE + End Get + Set + Me._nADLNGGICE = Value + End Set + End Property + + + Public Property TINCE259() As String + Get + Return Me._tINCE259 + End Get + Set + Me._tINCE259 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACONCE2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACONCE2Type object + ''' + ''' string to deserialize + ''' Output TRACONCE2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCE2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE2Type + Return CType(SerializerXml.Deserialize(s), TRACONCE2Type) + End Function +#End Region + + ''' + ''' Serializes current TRACONCE2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACONCE2Type object + ''' + ''' File to load and deserialize + ''' Output TRACONCE2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCE2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class COMCODGODITMType + +#Region "Private fields" + Private _comNomCMD1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ComNomCMD1() As String + Get + Return Me._comNomCMD1 + End Get + Set + Me._comNomCMD1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(COMCODGODITMType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize COMCODGODITMType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes COMCODGODITMType object + ''' + ''' string to deserialize + ''' Output COMCODGODITMType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, COMCODGODITMType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As COMCODGODITMType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), COMCODGODITMType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As COMCODGODITMType + Return CType(SerializerXml.Deserialize(s), COMCODGODITMType) + End Function +#End Region + + ''' + ''' Serializes current COMCODGODITMType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an COMCODGODITMType object + ''' + ''' File to load and deserialize + ''' Output COMCODGODITMType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, COMCODGODITMType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As COMCODGODITMType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACONCO2Type + +#Region "Private fields" + Private _namCO27 As String + + Private _strAndNumCO222 As String + + Private _posCodCO223 As String + + Private _citCO224 As String + + Private _couCO225 As String + + Private _nADLNGGTCO As String + + Private _tINCO259 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamCO27() As String + Get + Return Me._namCO27 + End Get + Set + Me._namCO27 = Value + End Set + End Property + + + Public Property StrAndNumCO222() As String + Get + Return Me._strAndNumCO222 + End Get + Set + Me._strAndNumCO222 = Value + End Set + End Property + + + Public Property PosCodCO223() As String + Get + Return Me._posCodCO223 + End Get + Set + Me._posCodCO223 = Value + End Set + End Property + + + Public Property CitCO224() As String + Get + Return Me._citCO224 + End Get + Set + Me._citCO224 = Value + End Set + End Property + + + Public Property CouCO225() As String + Get + Return Me._couCO225 + End Get + Set + Me._couCO225 = Value + End Set + End Property + + + Public Property NADLNGGTCO() As String + Get + Return Me._nADLNGGTCO + End Get + Set + Me._nADLNGGTCO = Value + End Set + End Property + + + Public Property TINCO259() As String + Get + Return Me._tINCO259 + End Get + Set + Me._tINCO259 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACONCO2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACONCO2Type object + ''' + ''' string to deserialize + ''' Output TRACONCO2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCO2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO2Type + Return CType(SerializerXml.Deserialize(s), TRACONCO2Type) + End Function +#End Region + + ''' + ''' Serializes current TRACONCO2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACONCO2Type object + ''' + ''' File to load and deserialize + ''' Output TRACONCO2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCO2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class SPEMENMT2Type + +#Region "Private fields" + Private _addInfCodMT23 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property AddInfCodMT23() As String + Get + Return Me._addInfCodMT23 + End Get + Set + Me._addInfCodMT23 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SPEMENMT2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize SPEMENMT2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes SPEMENMT2Type object + ''' + ''' string to deserialize + ''' Output SPEMENMT2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SPEMENMT2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As SPEMENMT2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SPEMENMT2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As SPEMENMT2Type + Return CType(SerializerXml.Deserialize(s), SPEMENMT2Type) + End Function +#End Region + + ''' + ''' Serializes current SPEMENMT2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an SPEMENMT2Type object + ''' + ''' File to load and deserialize + ''' Output SPEMENMT2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SPEMENMT2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SPEMENMT2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PRODOCDC2Type + +#Region "Private fields" + Private _docTypDC21 As String + + Private _docRefDC23 As String + + Private _docRefDCLNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property DocTypDC21() As String + Get + Return Me._docTypDC21 + End Get + Set + Me._docTypDC21 = Value + End Set + End Property + + + Public Property DocRefDC23() As String + Get + Return Me._docRefDC23 + End Get + Set + Me._docRefDC23 = Value + End Set + End Property + + + Public Property DocRefDCLNG() As String + Get + Return Me._docRefDCLNG + End Get + Set + Me._docRefDCLNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRODOCDC2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PRODOCDC2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PRODOCDC2Type object + ''' + ''' string to deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PRODOCDC2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRODOCDC2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRODOCDC2Type + Return CType(SerializerXml.Deserialize(s), PRODOCDC2Type) + End Function +#End Region + + ''' + ''' Serializes current PRODOCDC2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PRODOCDC2Type object + ''' + ''' File to load and deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRODOCDC2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class GOOITEGDSType + +#Region "Private fields" + Private _iteNumGDS7 As String + + Private _gooDesGDS23 As String + + Private _gooDesGDS23LNG As String + + Private _groMasGDS46 As Decimal + + Private _metOfPayGDI12 As String + + Private _comRefNumGIM1 As String + + Private _uNDanGooCodGDI1 As String + + Private _plaLoaGOOITE333 As String + + Private _plaLoaGOOITE333LNG As String + + Private _plaUnlGOOITE333 As String + + Private _plaUnlGOOITE333LNG As String + + Private _pRODOCDC2 As List(Of PRODOCDC2Type) + + Private _sPEMENMT2 As List(Of SPEMENMT2Type) + + Private _tRACONCO2 As TRACONCO2Type + + Private _cOMCODGODITM As COMCODGODITMType + + Private _tRACONCE2 As TRACONCE2Type + + Private _cONNR2 As List(Of CONNR2Type) + + Private _iDEMEATRAGI970 As List(Of IDEMEATRAGI970Type) + + Private _pACGS2 As List(Of PACGS2Type) + + Private _pRTNOT640 As PRTNOT640Type + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._pRTNOT640 = New PRTNOT640Type() + Me._pACGS2 = New List(Of PACGS2Type)() + Me._iDEMEATRAGI970 = New List(Of IDEMEATRAGI970Type)() + Me._cONNR2 = New List(Of CONNR2Type)() + Me._tRACONCE2 = New TRACONCE2Type() + Me._cOMCODGODITM = New COMCODGODITMType() + Me._tRACONCO2 = New TRACONCO2Type() + Me._sPEMENMT2 = New List(Of SPEMENMT2Type)() + Me._pRODOCDC2 = New List(Of PRODOCDC2Type)() + End Sub + + + Public Property IteNumGDS7() As String + Get + Return Me._iteNumGDS7 + End Get + Set + Me._iteNumGDS7 = Value + End Set + End Property + + + Public Property GooDesGDS23() As String + Get + Return Me._gooDesGDS23 + End Get + Set + Me._gooDesGDS23 = Value + End Set + End Property + + + Public Property GooDesGDS23LNG() As String + Get + Return Me._gooDesGDS23LNG + End Get + Set + Me._gooDesGDS23LNG = Value + End Set + End Property + + + Public Property GroMasGDS46() As Decimal + Get + Return Me._groMasGDS46 + End Get + Set + Me._groMasGDS46 = Value + End Set + End Property + + + Public Property MetOfPayGDI12() As String + Get + Return Me._metOfPayGDI12 + End Get + Set + Me._metOfPayGDI12 = Value + End Set + End Property + + + Public Property ComRefNumGIM1() As String + Get + Return Me._comRefNumGIM1 + End Get + Set + Me._comRefNumGIM1 = Value + End Set + End Property + + + Public Property UNDanGooCodGDI1() As String + Get + Return Me._uNDanGooCodGDI1 + End Get + Set + Me._uNDanGooCodGDI1 = Value + End Set + End Property + + + Public Property PlaLoaGOOITE333() As String + Get + Return Me._plaLoaGOOITE333 + End Get + Set + Me._plaLoaGOOITE333 = Value + End Set + End Property + + + Public Property PlaLoaGOOITE333LNG() As String + Get + Return Me._plaLoaGOOITE333LNG + End Get + Set + Me._plaLoaGOOITE333LNG = Value + End Set + End Property + + + Public Property PlaUnlGOOITE333() As String + Get + Return Me._plaUnlGOOITE333 + End Get + Set + Me._plaUnlGOOITE333 = Value + End Set + End Property + + + Public Property PlaUnlGOOITE333LNG() As String + Get + Return Me._plaUnlGOOITE333LNG + End Get + Set + Me._plaUnlGOOITE333LNG = Value + End Set + End Property + + + Public Property PRODOCDC2() As List(Of PRODOCDC2Type) + Get + Return Me._pRODOCDC2 + End Get + Set + Me._pRODOCDC2 = Value + End Set + End Property + + + Public Property SPEMENMT2() As List(Of SPEMENMT2Type) + Get + Return Me._sPEMENMT2 + End Get + Set + Me._sPEMENMT2 = Value + End Set + End Property + + + Public Property TRACONCO2() As TRACONCO2Type + Get + Return Me._tRACONCO2 + End Get + Set + Me._tRACONCO2 = Value + End Set + End Property + + + Public Property COMCODGODITM() As COMCODGODITMType + Get + Return Me._cOMCODGODITM + End Get + Set + Me._cOMCODGODITM = Value + End Set + End Property + + + Public Property TRACONCE2() As TRACONCE2Type + Get + Return Me._tRACONCE2 + End Get + Set + Me._tRACONCE2 = Value + End Set + End Property + + + Public Property CONNR2() As List(Of CONNR2Type) + Get + Return Me._cONNR2 + End Get + Set + Me._cONNR2 = Value + End Set + End Property + + + Public Property IDEMEATRAGI970() As List(Of IDEMEATRAGI970Type) + Get + Return Me._iDEMEATRAGI970 + End Get + Set + Me._iDEMEATRAGI970 = Value + End Set + End Property + + + Public Property PACGS2() As List(Of PACGS2Type) + Get + Return Me._pACGS2 + End Get + Set + Me._pACGS2 = Value + End Set + End Property + + + Public Property PRTNOT640() As PRTNOT640Type + Get + Return Me._pRTNOT640 + End Get + Set + Me._pRTNOT640 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GOOITEGDSType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize GOOITEGDSType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes GOOITEGDSType object + ''' + ''' string to deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As GOOITEGDSType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GOOITEGDSType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As GOOITEGDSType + Return CType(SerializerXml.Deserialize(s), GOOITEGDSType) + End Function +#End Region + + ''' + ''' Serializes current GOOITEGDSType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an GOOITEGDSType object + ''' + ''' File to load and deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As GOOITEGDSType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class NOTPAR670Type + +#Region "Private fields" + Private _namNOTPAR672 As String + + Private _strNumNOTPAR673 As String + + Private _posCodNOTPAR676 As String + + Private _citNOTPAR674 As String + + Private _couCodNOTPAR675 As String + + Private _nOTPAR670LNG As String + + Private _tINNOTPAR671 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamNOTPAR672() As String + Get + Return Me._namNOTPAR672 + End Get + Set + Me._namNOTPAR672 = Value + End Set + End Property + + + Public Property StrNumNOTPAR673() As String + Get + Return Me._strNumNOTPAR673 + End Get + Set + Me._strNumNOTPAR673 = Value + End Set + End Property + + + Public Property PosCodNOTPAR676() As String + Get + Return Me._posCodNOTPAR676 + End Get + Set + Me._posCodNOTPAR676 = Value + End Set + End Property + + + Public Property CitNOTPAR674() As String + Get + Return Me._citNOTPAR674 + End Get + Set + Me._citNOTPAR674 = Value + End Set + End Property + + + Public Property CouCodNOTPAR675() As String + Get + Return Me._couCodNOTPAR675 + End Get + Set + Me._couCodNOTPAR675 = Value + End Set + End Property + + + Public Property NOTPAR670LNG() As String + Get + Return Me._nOTPAR670LNG + End Get + Set + Me._nOTPAR670LNG = Value + End Set + End Property + + + Public Property TINNOTPAR671() As String + Get + Return Me._tINNOTPAR671 + End Get + Set + Me._tINNOTPAR671 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(NOTPAR670Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize NOTPAR670Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes NOTPAR670Type object + ''' + ''' string to deserialize + ''' Output NOTPAR670Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, NOTPAR670Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As NOTPAR670Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), NOTPAR670Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As NOTPAR670Type + Return CType(SerializerXml.Deserialize(s), NOTPAR670Type) + End Function +#End Region + + ''' + ''' Serializes current NOTPAR670Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an NOTPAR670Type object + ''' + ''' File to load and deserialize + ''' Output NOTPAR670Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, NOTPAR670Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As NOTPAR670Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACONCE1Type + +#Region "Private fields" + Private _namCE17 As String + + Private _strAndNumCE122 As String + + Private _posCodCE123 As String + + Private _citCE124 As String + + Private _couCE125 As String + + Private _nADLNGCE As String + + Private _tINCE159 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamCE17() As String + Get + Return Me._namCE17 + End Get + Set + Me._namCE17 = Value + End Set + End Property + + + Public Property StrAndNumCE122() As String + Get + Return Me._strAndNumCE122 + End Get + Set + Me._strAndNumCE122 = Value + End Set + End Property + + + Public Property PosCodCE123() As String + Get + Return Me._posCodCE123 + End Get + Set + Me._posCodCE123 = Value + End Set + End Property + + + Public Property CitCE124() As String + Get + Return Me._citCE124 + End Get + Set + Me._citCE124 = Value + End Set + End Property + + + Public Property CouCE125() As String + Get + Return Me._couCE125 + End Get + Set + Me._couCE125 = Value + End Set + End Property + + + Public Property NADLNGCE() As String + Get + Return Me._nADLNGCE + End Get + Set + Me._nADLNGCE = Value + End Set + End Property + + + Public Property TINCE159() As String + Get + Return Me._tINCE159 + End Get + Set + Me._tINCE159 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE1Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACONCE1Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACONCE1Type object + ''' + ''' string to deserialize + ''' Output TRACONCE1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCE1Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE1Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE1Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE1Type + Return CType(SerializerXml.Deserialize(s), TRACONCE1Type) + End Function +#End Region + + ''' + ''' Serializes current TRACONCE1Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACONCE1Type object + ''' + ''' File to load and deserialize + ''' Output TRACONCE1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCE1Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE1Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACONCO1Type + +#Region "Private fields" + Private _namCO17 As String + + Private _strAndNumCO122 As String + + Private _posCodCO123 As String + + Private _citCO124 As String + + Private _couCO125 As String + + Private _nADLNGCO As String + + Private _tINCO159 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamCO17() As String + Get + Return Me._namCO17 + End Get + Set + Me._namCO17 = Value + End Set + End Property + + + Public Property StrAndNumCO122() As String + Get + Return Me._strAndNumCO122 + End Get + Set + Me._strAndNumCO122 = Value + End Set + End Property + + + Public Property PosCodCO123() As String + Get + Return Me._posCodCO123 + End Get + Set + Me._posCodCO123 = Value + End Set + End Property + + + Public Property CitCO124() As String + Get + Return Me._citCO124 + End Get + Set + Me._citCO124 = Value + End Set + End Property + + + Public Property CouCO125() As String + Get + Return Me._couCO125 + End Get + Set + Me._couCO125 = Value + End Set + End Property + + + Public Property NADLNGCO() As String + Get + Return Me._nADLNGCO + End Get + Set + Me._nADLNGCO = Value + End Set + End Property + + + Public Property TINCO159() As String + Get + Return Me._tINCO159 + End Get + Set + Me._tINCO159 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO1Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACONCO1Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACONCO1Type object + ''' + ''' string to deserialize + ''' Output TRACONCO1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCO1Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO1Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO1Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO1Type + Return CType(SerializerXml.Deserialize(s), TRACONCO1Type) + End Function +#End Region + + ''' + ''' Serializes current TRACONCO1Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACONCO1Type object + ''' + ''' File to load and deserialize + ''' Output TRACONCO1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACONCO1Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO1Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.xsd new file mode 100644 index 00000000..3efd4ede --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.xsd @@ -0,0 +1,1257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/complex_types_ics-v11-2.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/complex_types_ics-v11-2.xsd new file mode 100644 index 00000000..010ba08e --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/complex_types_ics-v11-2.xsd @@ -0,0 +1,1754 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/doc-v11-2.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/doc-v11-2.xsd new file mode 100644 index 00000000..a9e7b973 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/doc-v11-2.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/simple_types-v11-2.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/simple_types-v11-2.xsd new file mode 100644 index 00000000..3ab81f0c --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/simple_types-v11-2.xsd @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all anN and an..N types + + + + + + Base class for all aN and a..N + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Customs Office Reference Number + (format:an8) + + + + + + + + + Trader City (format: + an..35) + + + + + + + + + + + + + + Country Code (format:a2) + + + + + + + + + Date type (format + YYMMDD) + + + + + + + + + Date and Time with precision of minute + (format + YYYYMMDDHHMM) + + + + + + + + + Date type (format + YYYYMMDD) + + + + + + + + + Date type (format + YYYYMMDDHHMNSS) + + + + + + + + + Day in the Month (format: + DD) + + + + + + + + + Base class for all n..N,M + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Declaration request number (format: + an..22) + + + + + + + + + GRN (format: an..24), (alias:GuaRefNumGRNREF21) + + + + + + + + Language Code (format: a2) + + + + + + + + + MRN (format: an..21), (alias: DocNumHEA5Type) + + + + + + + + Base class for all nN and n..N + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Trader Postal Code (format: + n..9) + + + + + + + + + Trader Street and Number (format: + an..35) + + + + + + + + + + + + + + Trader Identification Number (format: + an..17) + + + + + + + + + + Taric Code (format: + an..6) + + + + + + + + Time with precision of minute (format + HHMM) + + + + + + + + + Trader Name (format: + an..35) + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/tcl-v11-2.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/tcl-v11-2.xsd new file mode 100644 index 00000000..1b705b11 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/tcl-v11-2.xsd @@ -0,0 +1,769 @@ + + + + + [Format: a1] + + + + + Reference Data + + + + + Entry Processing + + + + + Lodgement + + + + + ALL FUNCTIONALITY + + + + + + + All the countries included in code list 9 excluding AX, GF, GP, LI, MC, MQ, RE, SJ and YT. The same codelist values are used for all Domains (ECS/NCTS/ICS) in order to support the COL. Values are shown for illustration only. [Format: a2] + + + + + Andorra + + + + + Austria + + + + + Belgium + + + + + Bulgaria + + + + + Switzerland + + + + + Cyprus + + + + + Czech Republic + + + + + Germany + + + + + Denmark + + + + + Estonia + + + + + Spain + + + + + Finland + + + + + France + + + + + United Kingdom + + + + + Greece + + + + + Croatia + + + + + Hungary + + + + + Ireland + + + + + Iceland + + + + + Italy + + + + + Lithuania + + + + + Luxembourg + + + + + Latvia + + + + + Malta + + + + + Netherlands + + + + + Norway + + + + + Poland + + + + + Portugal + + + + + Romania + + + + + Sweden + + + + + Slovenia + + + + + Slovakia + + + + + San Marino + + + + + Turkey + + + + + + + [Format: n1] + + + + + Monday + + + + + Tuesday + + + + + Wednesday + + + + + Thursday + + + + + Friday + + + + + Saturday + + + + + Sunday + + + + + + + It is an alphanumerical up to 50 characters string (i.e. an..50) that is used to define in an acknowledgement notification message the error code(s). [Format: an..50] + + + + + Non XML message received + + + + + Invalid byte sequence: a byte sequence does not represent a valid character in the character encoding scheme (UTF-8). + + + + + Envelope Id and/or Originator Reference are missing + + + + + + + - Subset of the UN/EDIFACT generic error table. - For remarks on the codes : see DDNTA Sec. VII. [Format: n2] + + + + + Incorrect (code) value + + + + + Missing + + + + + Value not supported in this position (code value constraint) + + + + + Not supported in this position + + + + + Invalid decimal notation + + + + + Duplicate detected + + + + + Too many repetitions + + + + + Invalid type characters + + + + + Missing digit in front of decimal sign + + + + + Element too long (length constraint) + + + + + Element too short (length constraint) + + + + + Unknown MRN + + + + + Duplicate MRN + + + + + Message out of sequence + + + + + Invalid MRN + + + + + + + Defines the codes to be used for reporting errors on XML messages. [Format: n2] + + + + + Incorrect enumeration + + + + + Missing + + + + + Not supported in this position + + + + + Unspecified Error / Other + + + + + Invalid decimal notation + + + + + Too many repetitions + + + + + Element too long (length constraint) + + + + + Element too short (length constraint) + + + + + Invalid Value for the specific type + + + + + Invalid value according to the pattern + + + + + Invalid XML format + + + + + Invalid character(s) + + + + + Value is lower than the allowed lowest limit (Minimum Inclusive) + + + + + Value is greater than the allowed upper limit (Maximum Inclusive) + + + + + Value is lower than or equal to the allowed lowest limit (Minimum Exlcusive) + + + + + Value is greater than or equal to the allowed upper limit (Maximum Exclusive) + + + + + + + Used for CUSTOMS OFFICE LSD. [Format: an1] + + + + + Simple office (see box A in Customs Office List) + + + + + Higher authority (see box E in Customs Office List) + + + + + + + Used for the attribute SYSTEM UNAVAILABILITY.System Unavailability Type. [Format: a1] + + + + + Business service not implemented + + + + + Scheduled Unavailability + + + + + Unscheduled Unavailability + + + + + + + Used for attributes that can have a positive or a negative value. [Format: n1] + + + + + NO + + + + + YES + + + + + + + [Format: an2] + + + + + January + + + + + February + + + + + March + + + + + April + + + + + May + + + + + June + + + + + July + + + + + August + + + + + September + + + + + October + + + + + November + + + + + December + + + + + + + Used for attribute MESSAGE ERRORS.Association assigned code and MESSAGE.Message Type. The usage of each code in one of the UNSM templates is defined in the Remarks column. CC should in all cases be instantiated to the value of the particular domain in which the message is created. [Format: an..6] [Format: an..6] + + + + + Entry Summary Declaration Amendment Accepted + + + + + Entry Summary Declaration Amendment Rejection + + + + + Entry Summary Declaration Amendment + + + + + Entry Summary Declaration + + + + + Entry Summary Declaration Rejected + + + + + Diversion Request Import + + + + + Diversion Request Rejected + + + + + Diversion Request Acknowledgement + + + + + Entry Summary Request Acknowledgement + + + + + Advanced Intervention Notification + + + + + Notification of customs offices modification to common domain + + + + + Notification of customs offices modification to national domain + + + + + Notification of common reference data modification to ND + + + + + Notification of System Unavailability to CD + + + + + Notification of System Unavailability to ND + + + + + ENS + + + + + Declaration Request Import + + + + + Entry Summary Declaration Response + + + + + Transmission to subsequent Office of Entry + + + + + Sending of statistics data + + + + + Statistics generated sent to national domain + + + + + Functional NACK + + + + + Availability Matrix + + + + + Upload parsing response + + + + + COL request + + + + + Common RD Request + + + + + XML NACK + + + + + COL DATA + + + + + Common RD Data + + + + + Full Unavailability Schedule + + + + + + + Used for (multiple) attribute Operation. [Format: a1] + + + + + Create + + + + + Delete + + + + + Update + + + + + + + Custom System applicable domain [Format: n..2] + + + + + NCTS + + + + + ECS + + + + + ICS + + + + + EOS + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cHMRCToken.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRCToken.vb similarity index 100% rename from VERAG_PROG_ALLGEMEIN/Classes/cHMRCToken.vb rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRCToken.vb diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb new file mode 100644 index 00000000..53d49968 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb @@ -0,0 +1,146 @@ +Imports VERAG_PROG_ALLGEMEIN.CC015B_TR_EXT_V4_3 +Imports VERAG_PROG_ALLGEMEIN.ENS_CC315A + +Public Class cHMRC_ENS + + + '---> VERAG AG!!! GVMS use 26 86 22 45 50 78? + Public Shared ApplicationName = "AVISO_ENS" + Public Shared ApplicationID = "af3dc225-6726-4cba-98e6-9b8df39b4c20" + Public Shared Client_ID = "Qbwx6C1YYdc6q4XM0aWOKZGH0zyO" + Public Shared Client_Secret = "143a33cc-33c8-43bb-bcca-51186ac52855" + Public Shared TEST As Boolean = True + + + + Shared Function helloWorldENS(ByVal response As String) As Boolean + + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + + Dim TOKEN = cHMRC.getTOKEN("ENS_HELLOWORLD", True) + + If TOKEN.hasEntry Then + + ' HTTP-Client initialisieren + Dim http As New Chilkat.Http + + ' HMRC OAuth2 Access Token (muss vorher abgerufen werden) + Dim accessToken As String = "YOUR_ACCESS_TOKEN" + + ' Falls das Token fehlt, Hinweis ausgeben + If String.IsNullOrEmpty(accessToken) Then + Console.WriteLine("Fehler: Kein OAuth2-Token gefunden!") + Return False + End If + + ' Setze die benötigten Header + http.SetRequestHeader("Authorization", "Bearer " & accessToken) + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+json") + + ' API-Endpunkt für User-Restricted Hello API + Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/application" + 'Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/user" + + ' API-Anfrage senden + response = http.QuickGetStr(url) + + ' Fehlerbehandlung + If (http.LastMethodSuccess <> True) Then + Console.WriteLine("Fehler: " & http.LastErrorText) + Else + Console.WriteLine("Antwort von HMRC API: " & response) + End If + Return True + End If + Return False + End Function + Shared Function insertENS(ENS_CC315A As CC315AType, ByVal response As String) As Boolean + ' Chilkat-Objekt initialisieren + Dim http As New Chilkat.Http() + + + ' EORI-Nummer für die Überprüfung + 'Dim eoriNumber As String = "GB123456789000" + + Dim url As String = "" + If TEST Then + url = "test-api.service.hmrc.gov.uk" + Else + url = "api.service.hmrc.gov.uk" + End If + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + '------------------------------------------------------- + + ENS_CC315A = New CC315AType + + ENS_CC315A.MesSenMES3 = "GB123" + ENS_CC315A.DatOfPreMES9 = Now.ToString("yyMMdd") + ENS_CC315A.TimOfPreMES10 = Now.ToString("HHmm") + ENS_CC315A.MesIdeMES19 = "ABCD1234" + 'ENS_CC315A.MesTypMES20 = "CC315A" + + ENS_CC315A.HEAHEA.RefNumHEA4 = "ABCD1234" + ENS_CC315A.HEAHEA.TraModAtBorHEA76 = "4" + ENS_CC315A.HEAHEA.TotNumOfIteHEA305 = "1" + + + '------------------------------------------------------- + + + + + Dim TOKEN = cHMRC.getTOKEN("ENS", True) + + If TOKEN.hasEntry Then + + Dim req As New Chilkat.HttpRequest() + + ' Setze deine HMRC API-Credentials + http.AuthToken = TOKEN.token_BEARER_TOKEN + + req.HttpVerb = "POST" + req.Path = "/customs/imports/declarations" + req.ContentType = "application/xml" + req.Charset = "utf-8" + req.SendCharset = True + + + + MsgBox(ENS_CC315A.Serialize) + ' Füge das XML als Body hinzu + req.LoadBodyFromString(ENS_CC315A.Serialize, "utf-8") + + ' Füge benötigte Header hinzu + req.AddHeader("Accept", "application/x-www-form-urlencoded") '"application/vnd.hmrc.1.0+xml") + req.AddHeader("Content-Type", "application/xml; charset=UTF-8") '"application/xml") + req.AddHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) + ' req.AddHeader("Gov-Client-Connection-Method", "WEB_APP_VIA_SERVER") + ' req.AddHeader("Gov-Client-Public-IP", "192.168.1.1") + ' req.AddHeader("Gov-Client-Timezone", "UTC+00:00") + + MsgBox(TOKEN.token_BEARER_TOKEN) + ' Sende die Anfrage + Dim resp As Chilkat.HttpResponse = http.SynchronousRequest(url, 443, True, req) + + If resp Is Nothing Then + Console.WriteLine("Fehler: " & http.LastErrorText) + Else + Console.WriteLine("Status Code: " & resp.StatusCode) + Console.WriteLine("Antwort: " & resp.BodyStr) + End If + + Return True + End If + Return False + End Function + + + +End Class diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj index 38817568..84b9ecf8 100644 --- a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj +++ b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj @@ -362,7 +362,8 @@ - + + @@ -425,6 +426,8 @@ + + @@ -868,6 +871,21 @@ Designer + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + Designer