10284 lines
378 KiB
VB.net
10284 lines
378 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
|
|
'' {"TargetFramework":"Net48","NameSpace":"MicNctsTransitDeclarationP5","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}}
|
|
'' </auto-generated>
|
|
'' ------------------------------------------------------------------------------
|
|
#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 MicNctsTransitDeclarationP5
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0"),
|
|
XmlRoot([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0", IsNullable:=False)>
|
|
Partial Public Class TransitDeclaration
|
|
|
|
#Region "Private fields"
|
|
Private _transitDeclarationHeader As TransitDeclarationHeaderType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._transitDeclarationHeader = New TransitDeclarationHeaderType()
|
|
End Sub
|
|
|
|
Public Property TransitDeclarationHeader() As TransitDeclarationHeaderType
|
|
Get
|
|
Return Me._transitDeclarationHeader
|
|
End Get
|
|
Set
|
|
Me._transitDeclarationHeader = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclaration))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclaration object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclaration object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclaration object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclaration, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclaration)
|
|
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 TransitDeclaration) 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 TransitDeclaration
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclaration)
|
|
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 TransitDeclaration
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclaration)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclaration object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclaration object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclaration object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclaration, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclaration)
|
|
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 TransitDeclaration) 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 TransitDeclaration
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransitDeclarationHeaderType
|
|
|
|
#Region "Private fields"
|
|
Private _company As String
|
|
|
|
Private _plant As String
|
|
|
|
Private _localReferenceNumber As String
|
|
|
|
Private _referenceNumberUniqueConsignmentReference As String
|
|
|
|
Private _templateName As String
|
|
|
|
Private _createdFor As String
|
|
|
|
Private _useAsTemplate As Boolean
|
|
|
|
Private _declarationType As String
|
|
|
|
Private _transitDeclarationType As String
|
|
|
|
Private _additionalDeclarationType As String
|
|
|
|
Private _month As String
|
|
|
|
Private _declarationDate As Date
|
|
|
|
Private _limitDate As Date
|
|
|
|
Private _security As String
|
|
|
|
Private _reducedDatasetIndicator As Boolean
|
|
|
|
Private _specificCircumstanceIndicator As String
|
|
|
|
Private _bindingItinerary As Boolean
|
|
|
|
Private _customsOfficeOfDeparture As String
|
|
|
|
Private _customsOfficeOfDestinationDeclared As String
|
|
|
|
Private _tirCarnetNumber As String
|
|
|
|
Private _signingInformation As String
|
|
|
|
Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureType
|
|
|
|
Private _representative As TransitDeclarationRepresentativeType
|
|
|
|
Private _authorisation As List(Of AuthorisationType)
|
|
|
|
Private _guarantee As List(Of GuaranteeType)
|
|
|
|
Private _consignment As TransitDeclarationConsignmentType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._consignment = New TransitDeclarationConsignmentType()
|
|
Me._guarantee = New List(Of GuaranteeType)()
|
|
Me._authorisation = New List(Of AuthorisationType)()
|
|
Me._representative = New TransitDeclarationRepresentativeType()
|
|
Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureType()
|
|
End Sub
|
|
|
|
Public Property company() As String
|
|
Get
|
|
Return Me._company
|
|
End Get
|
|
Set
|
|
Me._company = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property plant() As String
|
|
Get
|
|
Return Me._plant
|
|
End Get
|
|
Set
|
|
Me._plant = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property localReferenceNumber() As String
|
|
Get
|
|
Return Me._localReferenceNumber
|
|
End Get
|
|
Set
|
|
Me._localReferenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumberUniqueConsignmentReference() As String
|
|
Get
|
|
Return Me._referenceNumberUniqueConsignmentReference
|
|
End Get
|
|
Set
|
|
Me._referenceNumberUniqueConsignmentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property templateName() As String
|
|
Get
|
|
Return Me._templateName
|
|
End Get
|
|
Set
|
|
Me._templateName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property createdFor() As String
|
|
Get
|
|
Return Me._createdFor
|
|
End Get
|
|
Set
|
|
Me._createdFor = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property useAsTemplate() As Boolean
|
|
Get
|
|
Return Me._useAsTemplate
|
|
End Get
|
|
Set
|
|
Me._useAsTemplate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property declarationType() As String
|
|
Get
|
|
Return Me._declarationType
|
|
End Get
|
|
Set
|
|
Me._declarationType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transitDeclarationType() As String
|
|
Get
|
|
Return Me._transitDeclarationType
|
|
End Get
|
|
Set
|
|
Me._transitDeclarationType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalDeclarationType() As String
|
|
Get
|
|
Return Me._additionalDeclarationType
|
|
End Get
|
|
Set
|
|
Me._additionalDeclarationType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property month() As String
|
|
Get
|
|
Return Me._month
|
|
End Get
|
|
Set
|
|
Me._month = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property declarationDate() As Date
|
|
Get
|
|
Return Me._declarationDate
|
|
End Get
|
|
Set
|
|
Me._declarationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property limitDate() As Date
|
|
Get
|
|
Return Me._limitDate
|
|
End Get
|
|
Set
|
|
Me._limitDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property security() As String
|
|
Get
|
|
Return Me._security
|
|
End Get
|
|
Set
|
|
Me._security = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reducedDatasetIndicator() As Boolean
|
|
Get
|
|
Return Me._reducedDatasetIndicator
|
|
End Get
|
|
Set
|
|
Me._reducedDatasetIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specificCircumstanceIndicator() As String
|
|
Get
|
|
Return Me._specificCircumstanceIndicator
|
|
End Get
|
|
Set
|
|
Me._specificCircumstanceIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bindingItinerary() As Boolean
|
|
Get
|
|
Return Me._bindingItinerary
|
|
End Get
|
|
Set
|
|
Me._bindingItinerary = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfDeparture() As String
|
|
Get
|
|
Return Me._customsOfficeOfDeparture
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfDeparture = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfDestinationDeclared() As String
|
|
Get
|
|
Return Me._customsOfficeOfDestinationDeclared
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfDestinationDeclared = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tirCarnetNumber() As String
|
|
Get
|
|
Return Me._tirCarnetNumber
|
|
End Get
|
|
Set
|
|
Me._tirCarnetNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property signingInformation() As String
|
|
Get
|
|
Return Me._signingInformation
|
|
End Get
|
|
Set
|
|
Me._signingInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property holderOfTheTransitProcedure() As HolderOfTheTransitProcedureType
|
|
Get
|
|
Return Me._holderOfTheTransitProcedure
|
|
End Get
|
|
Set
|
|
Me._holderOfTheTransitProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property representative() As TransitDeclarationRepresentativeType
|
|
Get
|
|
Return Me._representative
|
|
End Get
|
|
Set
|
|
Me._representative = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("authorisation")>
|
|
Public Property authorisation() As List(Of AuthorisationType)
|
|
Get
|
|
Return Me._authorisation
|
|
End Get
|
|
Set
|
|
Me._authorisation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("guarantee")>
|
|
Public Property guarantee() As List(Of GuaranteeType)
|
|
Get
|
|
Return Me._guarantee
|
|
End Get
|
|
Set
|
|
Me._guarantee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignment() As TransitDeclarationConsignmentType
|
|
Get
|
|
Return Me._consignment
|
|
End Get
|
|
Set
|
|
Me._consignment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationHeaderType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclarationHeaderType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclarationHeaderType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationHeaderType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclarationHeaderType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationHeaderType)
|
|
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 TransitDeclarationHeaderType) 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 TransitDeclarationHeaderType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationHeaderType)
|
|
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 TransitDeclarationHeaderType
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclarationHeaderType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclarationHeaderType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclarationHeaderType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationHeaderType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclarationHeaderType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationHeaderType)
|
|
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 TransitDeclarationHeaderType) 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 TransitDeclarationHeaderType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class HolderOfTheTransitProcedureType
|
|
|
|
#Region "Private fields"
|
|
Private _addressNumber As String
|
|
|
|
Private _identificationNumber As String
|
|
|
|
Private _tirHolderIdentificationNumber As String
|
|
|
|
Private _name As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumber() As String
|
|
Get
|
|
Return Me._identificationNumber
|
|
End Get
|
|
Set
|
|
Me._identificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tirHolderIdentificationNumber() As String
|
|
Get
|
|
Return Me._tirHolderIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._tirHolderIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HolderOfTheTransitProcedureType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize HolderOfTheTransitProcedureType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes HolderOfTheTransitProcedureType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output HolderOfTheTransitProcedureType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HolderOfTheTransitProcedureType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HolderOfTheTransitProcedureType)
|
|
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 HolderOfTheTransitProcedureType) 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 HolderOfTheTransitProcedureType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureType)
|
|
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 HolderOfTheTransitProcedureType
|
|
Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current HolderOfTheTransitProcedureType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an HolderOfTheTransitProcedureType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output HolderOfTheTransitProcedureType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HolderOfTheTransitProcedureType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HolderOfTheTransitProcedureType)
|
|
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 HolderOfTheTransitProcedureType) 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 HolderOfTheTransitProcedureType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class AddressType
|
|
|
|
#Region "Private fields"
|
|
Private _streetAndNumber As String
|
|
|
|
Private _postcode As String
|
|
|
|
Private _city As String
|
|
|
|
Private _country As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property streetAndNumber() As String
|
|
Get
|
|
Return Me._streetAndNumber
|
|
End Get
|
|
Set
|
|
Me._streetAndNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property postcode() As String
|
|
Get
|
|
Return Me._postcode
|
|
End Get
|
|
Set
|
|
Me._postcode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property city() As String
|
|
Get
|
|
Return Me._city
|
|
End Get
|
|
Set
|
|
Me._city = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property country() As String
|
|
Get
|
|
Return Me._country
|
|
End Get
|
|
Set
|
|
Me._country = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AddressType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AddressType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes AddressType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AddressType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As AddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AddressType)
|
|
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 AddressType) 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 AddressType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressType)
|
|
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 AddressType
|
|
Return CType(SerializerXml.Deserialize(s), AddressType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AddressType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an AddressType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AddressType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AddressType)
|
|
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 AddressType) 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 AddressType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class DangerousGoodsOfConsignmentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _unDangerousGoodsNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unDangerousGoodsNumber() As String
|
|
Get
|
|
Return Me._unDangerousGoodsNumber
|
|
End Get
|
|
Set
|
|
Me._unDangerousGoodsNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DangerousGoodsOfConsignmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DangerousGoodsOfConsignmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes DangerousGoodsOfConsignmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DangerousGoodsOfConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DangerousGoodsOfConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DangerousGoodsOfConsignmentType)
|
|
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 DangerousGoodsOfConsignmentType) 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 DangerousGoodsOfConsignmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DangerousGoodsOfConsignmentType)
|
|
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 DangerousGoodsOfConsignmentType
|
|
Return CType(SerializerXml.Deserialize(s), DangerousGoodsOfConsignmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DangerousGoodsOfConsignmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DangerousGoodsOfConsignmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DangerousGoodsOfConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DangerousGoodsOfConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DangerousGoodsOfConsignmentType)
|
|
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 DangerousGoodsOfConsignmentType) 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 DangerousGoodsOfConsignmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class ConsignmentItemPackagingType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _typeOfPackages As String
|
|
|
|
Private _numberOfPackages As Integer
|
|
|
|
Private _shippingMarks As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfPackages() As String
|
|
Get
|
|
Return Me._typeOfPackages
|
|
End Get
|
|
Set
|
|
Me._typeOfPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property numberOfPackages() As Integer
|
|
Get
|
|
Return Me._numberOfPackages
|
|
End Get
|
|
Set
|
|
Me._numberOfPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property shippingMarks() As String
|
|
Get
|
|
Return Me._shippingMarks
|
|
End Get
|
|
Set
|
|
Me._shippingMarks = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemPackagingType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ConsignmentItemPackagingType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ConsignmentItemPackagingType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ConsignmentItemPackagingType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ConsignmentItemPackagingType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ConsignmentItemPackagingType)
|
|
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 ConsignmentItemPackagingType) 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 ConsignmentItemPackagingType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemPackagingType)
|
|
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 ConsignmentItemPackagingType
|
|
Return CType(SerializerXml.Deserialize(s), ConsignmentItemPackagingType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ConsignmentItemPackagingType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ConsignmentItemPackagingType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ConsignmentItemPackagingType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ConsignmentItemPackagingType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ConsignmentItemPackagingType)
|
|
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 ConsignmentItemPackagingType) 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 ConsignmentItemPackagingType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class ConsignmentItemType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _goodsItemNumber As Integer
|
|
|
|
Private _declarationGoodsItemNumber As Integer
|
|
|
|
Private _declarationType As String
|
|
|
|
Private _partNumber As String
|
|
|
|
Private _descriptionOfGoods As String
|
|
|
|
Private _cusCode As String
|
|
|
|
Private _commodityCode As String
|
|
|
|
Private _grossMass As Decimal
|
|
|
|
Private _netMass As Decimal
|
|
|
|
Private _countryOfDispatch As String
|
|
|
|
Private _countryOfDestination As String
|
|
|
|
Private _referenceNumberUniqueConsignmentReference As String
|
|
|
|
Private _packaging As List(Of ConsignmentItemPackagingType)
|
|
|
|
Private _dangerousGoodsOfConsignment As List(Of DangerousGoodsOfConsignmentType)
|
|
|
|
Private _consignee As OperatorWithContactAndSubsidiaryType
|
|
|
|
Private _supplementaryUnits As Decimal
|
|
|
|
Private _statisticalValue As Decimal
|
|
|
|
Private _statisticalQuantity As Decimal
|
|
|
|
Private _foreignStatisticalValue As Decimal
|
|
|
|
Private _foreignCurrency As String
|
|
|
|
Private _methodOfPayment As String
|
|
|
|
Private _previousDocument As List(Of ItemPreviousDocumentType)
|
|
|
|
Private _supportingDocument As List(Of SupportingDocumentType)
|
|
|
|
Private _transportDocument As List(Of TransportDocumentType)
|
|
|
|
Private _additionalInformation As List(Of AdditionalInformationType)
|
|
|
|
Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType)
|
|
|
|
Private _additionalReference As List(Of AdditionalReferenceType)
|
|
|
|
Private _customerFields As CustomerFieldsType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._customerFields = New CustomerFieldsType()
|
|
Me._additionalReference = New List(Of AdditionalReferenceType)()
|
|
Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)()
|
|
Me._additionalInformation = New List(Of AdditionalInformationType)()
|
|
Me._transportDocument = New List(Of TransportDocumentType)()
|
|
Me._supportingDocument = New List(Of SupportingDocumentType)()
|
|
Me._previousDocument = New List(Of ItemPreviousDocumentType)()
|
|
Me._consignee = New OperatorWithContactAndSubsidiaryType()
|
|
Me._dangerousGoodsOfConsignment = New List(Of DangerousGoodsOfConsignmentType)()
|
|
Me._packaging = New List(Of ConsignmentItemPackagingType)()
|
|
End Sub
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property goodsItemNumber() As Integer
|
|
Get
|
|
Return Me._goodsItemNumber
|
|
End Get
|
|
Set
|
|
Me._goodsItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property declarationGoodsItemNumber() As Integer
|
|
Get
|
|
Return Me._declarationGoodsItemNumber
|
|
End Get
|
|
Set
|
|
Me._declarationGoodsItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property declarationType() As String
|
|
Get
|
|
Return Me._declarationType
|
|
End Get
|
|
Set
|
|
Me._declarationType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partNumber() As String
|
|
Get
|
|
Return Me._partNumber
|
|
End Get
|
|
Set
|
|
Me._partNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property descriptionOfGoods() As String
|
|
Get
|
|
Return Me._descriptionOfGoods
|
|
End Get
|
|
Set
|
|
Me._descriptionOfGoods = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property cusCode() As String
|
|
Get
|
|
Return Me._cusCode
|
|
End Get
|
|
Set
|
|
Me._cusCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property commodityCode() As String
|
|
Get
|
|
Return Me._commodityCode
|
|
End Get
|
|
Set
|
|
Me._commodityCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossMass() As Decimal
|
|
Get
|
|
Return Me._grossMass
|
|
End Get
|
|
Set
|
|
Me._grossMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netMass() As Decimal
|
|
Get
|
|
Return Me._netMass
|
|
End Get
|
|
Set
|
|
Me._netMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDispatch() As String
|
|
Get
|
|
Return Me._countryOfDispatch
|
|
End Get
|
|
Set
|
|
Me._countryOfDispatch = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDestination() As String
|
|
Get
|
|
Return Me._countryOfDestination
|
|
End Get
|
|
Set
|
|
Me._countryOfDestination = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumberUniqueConsignmentReference() As String
|
|
Get
|
|
Return Me._referenceNumberUniqueConsignmentReference
|
|
End Get
|
|
Set
|
|
Me._referenceNumberUniqueConsignmentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("packaging")>
|
|
Public Property packaging() As List(Of ConsignmentItemPackagingType)
|
|
Get
|
|
Return Me._packaging
|
|
End Get
|
|
Set
|
|
Me._packaging = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("dangerousGoodsOfConsignment")>
|
|
Public Property dangerousGoodsOfConsignment() As List(Of DangerousGoodsOfConsignmentType)
|
|
Get
|
|
Return Me._dangerousGoodsOfConsignment
|
|
End Get
|
|
Set
|
|
Me._dangerousGoodsOfConsignment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignee() As OperatorWithContactAndSubsidiaryType
|
|
Get
|
|
Return Me._consignee
|
|
End Get
|
|
Set
|
|
Me._consignee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supplementaryUnits() As Decimal
|
|
Get
|
|
Return Me._supplementaryUnits
|
|
End Get
|
|
Set
|
|
Me._supplementaryUnits = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalValue() As Decimal
|
|
Get
|
|
Return Me._statisticalValue
|
|
End Get
|
|
Set
|
|
Me._statisticalValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalQuantity() As Decimal
|
|
Get
|
|
Return Me._statisticalQuantity
|
|
End Get
|
|
Set
|
|
Me._statisticalQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property foreignStatisticalValue() As Decimal
|
|
Get
|
|
Return Me._foreignStatisticalValue
|
|
End Get
|
|
Set
|
|
Me._foreignStatisticalValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property foreignCurrency() As String
|
|
Get
|
|
Return Me._foreignCurrency
|
|
End Get
|
|
Set
|
|
Me._foreignCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property methodOfPayment() As String
|
|
Get
|
|
Return Me._methodOfPayment
|
|
End Get
|
|
Set
|
|
Me._methodOfPayment = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("previousDocument")>
|
|
Public Property previousDocument() As List(Of ItemPreviousDocumentType)
|
|
Get
|
|
Return Me._previousDocument
|
|
End Get
|
|
Set
|
|
Me._previousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("supportingDocument")>
|
|
Public Property supportingDocument() As List(Of SupportingDocumentType)
|
|
Get
|
|
Return Me._supportingDocument
|
|
End Get
|
|
Set
|
|
Me._supportingDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("transportDocument")>
|
|
Public Property transportDocument() As List(Of TransportDocumentType)
|
|
Get
|
|
Return Me._transportDocument
|
|
End Get
|
|
Set
|
|
Me._transportDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalInformation")>
|
|
Public Property additionalInformation() As List(Of AdditionalInformationType)
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalSupplyChainActor")>
|
|
Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType)
|
|
Get
|
|
Return Me._additionalSupplyChainActor
|
|
End Get
|
|
Set
|
|
Me._additionalSupplyChainActor = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalReference")>
|
|
Public Property additionalReference() As List(Of AdditionalReferenceType)
|
|
Get
|
|
Return Me._additionalReference
|
|
End Get
|
|
Set
|
|
Me._additionalReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customerFields() As CustomerFieldsType
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ConsignmentItemType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ConsignmentItemType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ConsignmentItemType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ConsignmentItemType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ConsignmentItemType)
|
|
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 ConsignmentItemType) 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 ConsignmentItemType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemType)
|
|
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 ConsignmentItemType
|
|
Return CType(SerializerXml.Deserialize(s), ConsignmentItemType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ConsignmentItemType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ConsignmentItemType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ConsignmentItemType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ConsignmentItemType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ConsignmentItemType)
|
|
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 ConsignmentItemType) 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 ConsignmentItemType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class OperatorWithContactAndSubsidiaryType
|
|
|
|
#Region "Private fields"
|
|
Private _addressNumber As String
|
|
|
|
Private _identificationNumber As String
|
|
|
|
Private _subsidiaryNumber As String
|
|
|
|
Private _name As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumber() As String
|
|
Get
|
|
Return Me._identificationNumber
|
|
End Get
|
|
Set
|
|
Me._identificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property subsidiaryNumber() As String
|
|
Get
|
|
Return Me._subsidiaryNumber
|
|
End Get
|
|
Set
|
|
Me._subsidiaryNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(OperatorWithContactAndSubsidiaryType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize OperatorWithContactAndSubsidiaryType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes OperatorWithContactAndSubsidiaryType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output OperatorWithContactAndSubsidiaryType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As OperatorWithContactAndSubsidiaryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, OperatorWithContactAndSubsidiaryType)
|
|
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 OperatorWithContactAndSubsidiaryType) 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 OperatorWithContactAndSubsidiaryType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), OperatorWithContactAndSubsidiaryType)
|
|
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 OperatorWithContactAndSubsidiaryType
|
|
Return CType(SerializerXml.Deserialize(s), OperatorWithContactAndSubsidiaryType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current OperatorWithContactAndSubsidiaryType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an OperatorWithContactAndSubsidiaryType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output OperatorWithContactAndSubsidiaryType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As OperatorWithContactAndSubsidiaryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, OperatorWithContactAndSubsidiaryType)
|
|
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 OperatorWithContactAndSubsidiaryType) 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 OperatorWithContactAndSubsidiaryType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class ContactPersonType
|
|
|
|
#Region "Private fields"
|
|
Private _name As String
|
|
|
|
Private _phoneNumber As String
|
|
|
|
Private _emailAddress As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property phoneNumber() As String
|
|
Get
|
|
Return Me._phoneNumber
|
|
End Get
|
|
Set
|
|
Me._phoneNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property emailAddress() As String
|
|
Get
|
|
Return Me._emailAddress
|
|
End Get
|
|
Set
|
|
Me._emailAddress = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ContactPersonType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ContactPersonType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ContactPersonType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ContactPersonType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ContactPersonType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ContactPersonType)
|
|
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 ContactPersonType) 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 ContactPersonType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonType)
|
|
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 ContactPersonType
|
|
Return CType(SerializerXml.Deserialize(s), ContactPersonType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ContactPersonType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ContactPersonType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ContactPersonType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ContactPersonType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ContactPersonType)
|
|
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 ContactPersonType) 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 ContactPersonType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class ItemPreviousDocumentType
|
|
Inherits PreviousDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _previousDocumentTypeOfPackages As String
|
|
|
|
Private _previousDocumentNumberOfPackages As Integer
|
|
|
|
Private _previousDocumentMeasurementUnit As String
|
|
|
|
Private _previousDocumentQuantity As Decimal
|
|
|
|
Private _depreciatedAmountOfGuarantee As Long
|
|
|
|
Private _authorisationSpecialProcedure As String
|
|
|
|
Private _commodityCodeOfEarlyExportedEqualMaterial As String
|
|
|
|
Private _earlyExportOfEqualMaterial As String
|
|
|
|
Private _partNumberOfPreviousDocument As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property previousDocumentTypeOfPackages() As String
|
|
Get
|
|
Return Me._previousDocumentTypeOfPackages
|
|
End Get
|
|
Set
|
|
Me._previousDocumentTypeOfPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentNumberOfPackages() As Integer
|
|
Get
|
|
Return Me._previousDocumentNumberOfPackages
|
|
End Get
|
|
Set
|
|
Me._previousDocumentNumberOfPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentMeasurementUnit() As String
|
|
Get
|
|
Return Me._previousDocumentMeasurementUnit
|
|
End Get
|
|
Set
|
|
Me._previousDocumentMeasurementUnit = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentQuantity() As Decimal
|
|
Get
|
|
Return Me._previousDocumentQuantity
|
|
End Get
|
|
Set
|
|
Me._previousDocumentQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property depreciatedAmountOfGuarantee() As Long
|
|
Get
|
|
Return Me._depreciatedAmountOfGuarantee
|
|
End Get
|
|
Set
|
|
Me._depreciatedAmountOfGuarantee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorisationSpecialProcedure() As String
|
|
Get
|
|
Return Me._authorisationSpecialProcedure
|
|
End Get
|
|
Set
|
|
Me._authorisationSpecialProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property commodityCodeOfEarlyExportedEqualMaterial() As String
|
|
Get
|
|
Return Me._commodityCodeOfEarlyExportedEqualMaterial
|
|
End Get
|
|
Set
|
|
Me._commodityCodeOfEarlyExportedEqualMaterial = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property earlyExportOfEqualMaterial() As String
|
|
Get
|
|
Return Me._earlyExportOfEqualMaterial
|
|
End Get
|
|
Set
|
|
Me._earlyExportOfEqualMaterial = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partNumberOfPreviousDocument() As String
|
|
Get
|
|
Return Me._partNumberOfPreviousDocument
|
|
End Get
|
|
Set
|
|
Me._partNumberOfPreviousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ItemPreviousDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ItemPreviousDocumentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ItemPreviousDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ItemPreviousDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ItemPreviousDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ItemPreviousDocumentType)
|
|
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 ItemPreviousDocumentType) 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 ItemPreviousDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ItemPreviousDocumentType)
|
|
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 ItemPreviousDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), ItemPreviousDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ItemPreviousDocumentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ItemPreviousDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ItemPreviousDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ItemPreviousDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ItemPreviousDocumentType)
|
|
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 ItemPreviousDocumentType) 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 ItemPreviousDocumentType
|
|
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
|
|
|
|
<XmlIncludeAttribute(GetType(ItemPreviousDocumentType)),
|
|
System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class PreviousDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _previousDocumentType As String
|
|
|
|
Private _previousDocumentReference As String
|
|
|
|
Private _previousDocumentGoodsItemNumber As Long
|
|
|
|
Private _previousDocumentGoodsItemNumberString As String
|
|
|
|
Private _previousDocumentComplementOfInformation As String
|
|
|
|
Private _temporaryStorage As Boolean
|
|
|
|
Private _previousDocumentSid As Long
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentType() As String
|
|
Get
|
|
Return Me._previousDocumentType
|
|
End Get
|
|
Set
|
|
Me._previousDocumentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentReference() As String
|
|
Get
|
|
Return Me._previousDocumentReference
|
|
End Get
|
|
Set
|
|
Me._previousDocumentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentGoodsItemNumber() As Long
|
|
Get
|
|
Return Me._previousDocumentGoodsItemNumber
|
|
End Get
|
|
Set
|
|
Me._previousDocumentGoodsItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentGoodsItemNumberString() As String
|
|
Get
|
|
Return Me._previousDocumentGoodsItemNumberString
|
|
End Get
|
|
Set
|
|
Me._previousDocumentGoodsItemNumberString = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentComplementOfInformation() As String
|
|
Get
|
|
Return Me._previousDocumentComplementOfInformation
|
|
End Get
|
|
Set
|
|
Me._previousDocumentComplementOfInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property temporaryStorage() As Boolean
|
|
Get
|
|
Return Me._temporaryStorage
|
|
End Get
|
|
Set
|
|
Me._temporaryStorage = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocumentSid() As Long
|
|
Get
|
|
Return Me._previousDocumentSid
|
|
End Get
|
|
Set
|
|
Me._previousDocumentSid = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize PreviousDocumentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes PreviousDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output PreviousDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PreviousDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PreviousDocumentType)
|
|
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 PreviousDocumentType) 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 PreviousDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentType)
|
|
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 PreviousDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), PreviousDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current PreviousDocumentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an PreviousDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output PreviousDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PreviousDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PreviousDocumentType)
|
|
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 PreviousDocumentType) 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 PreviousDocumentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class SupportingDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _supportingDocumentType As String
|
|
|
|
Private _supportingDocumentReference As String
|
|
|
|
Private _supportingDocumentLineItemNumber As Integer
|
|
|
|
Private _supportingDocumentComplementOfInformation As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supportingDocumentType() As String
|
|
Get
|
|
Return Me._supportingDocumentType
|
|
End Get
|
|
Set
|
|
Me._supportingDocumentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supportingDocumentReference() As String
|
|
Get
|
|
Return Me._supportingDocumentReference
|
|
End Get
|
|
Set
|
|
Me._supportingDocumentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supportingDocumentLineItemNumber() As Integer
|
|
Get
|
|
Return Me._supportingDocumentLineItemNumber
|
|
End Get
|
|
Set
|
|
Me._supportingDocumentLineItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supportingDocumentComplementOfInformation() As String
|
|
Get
|
|
Return Me._supportingDocumentComplementOfInformation
|
|
End Get
|
|
Set
|
|
Me._supportingDocumentComplementOfInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SupportingDocumentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes SupportingDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SupportingDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SupportingDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupportingDocumentType)
|
|
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 SupportingDocumentType) 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 SupportingDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentType)
|
|
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 SupportingDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), SupportingDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SupportingDocumentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an SupportingDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SupportingDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SupportingDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupportingDocumentType)
|
|
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 SupportingDocumentType) 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 SupportingDocumentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransportDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _transportDocumentType As String
|
|
|
|
Private _transportDocumentReference As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportDocumentType() As String
|
|
Get
|
|
Return Me._transportDocumentType
|
|
End Get
|
|
Set
|
|
Me._transportDocumentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportDocumentReference() As String
|
|
Get
|
|
Return Me._transportDocumentReference
|
|
End Get
|
|
Set
|
|
Me._transportDocumentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransportDocumentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransportDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransportDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransportDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransportDocumentType)
|
|
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 TransportDocumentType) 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 TransportDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentType)
|
|
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 TransportDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), TransportDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransportDocumentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransportDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransportDocumentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransportDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransportDocumentType)
|
|
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 TransportDocumentType) 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 TransportDocumentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class AdditionalInformationType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _additionalInformationCode As String
|
|
|
|
Private _additionalInformationText As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalInformationCode() As String
|
|
Get
|
|
Return Me._additionalInformationCode
|
|
End Get
|
|
Set
|
|
Me._additionalInformationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalInformationText() As String
|
|
Get
|
|
Return Me._additionalInformationText
|
|
End Get
|
|
Set
|
|
Me._additionalInformationText = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AdditionalInformationType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes AdditionalInformationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AdditionalInformationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As AdditionalInformationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalInformationType)
|
|
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 AdditionalInformationType) 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 AdditionalInformationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationType)
|
|
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 AdditionalInformationType
|
|
Return CType(SerializerXml.Deserialize(s), AdditionalInformationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AdditionalInformationType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an AdditionalInformationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AdditionalInformationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalInformationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalInformationType)
|
|
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 AdditionalInformationType) 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 AdditionalInformationType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class AdditionalSupplyChainActorType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _role As String
|
|
|
|
Private _supplyChainActorId As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property role() As String
|
|
Get
|
|
Return Me._role
|
|
End Get
|
|
Set
|
|
Me._role = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supplyChainActorId() As String
|
|
Get
|
|
Return Me._supplyChainActorId
|
|
End Get
|
|
Set
|
|
Me._supplyChainActorId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalSupplyChainActorType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AdditionalSupplyChainActorType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes AdditionalSupplyChainActorType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AdditionalSupplyChainActorType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalSupplyChainActorType)
|
|
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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalSupplyChainActorType)
|
|
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 AdditionalSupplyChainActorType
|
|
Return CType(SerializerXml.Deserialize(s), AdditionalSupplyChainActorType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AdditionalSupplyChainActorType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an AdditionalSupplyChainActorType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AdditionalSupplyChainActorType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalSupplyChainActorType)
|
|
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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class AdditionalReferenceType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _additionalReferenceType As String
|
|
|
|
Private _additionalReferenceReference As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalReferenceType() As String
|
|
Get
|
|
Return Me._additionalReferenceType
|
|
End Get
|
|
Set
|
|
Me._additionalReferenceType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalReferenceReference() As String
|
|
Get
|
|
Return Me._additionalReferenceReference
|
|
End Get
|
|
Set
|
|
Me._additionalReferenceReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferenceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AdditionalReferenceType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes AdditionalReferenceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AdditionalReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As AdditionalReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalReferenceType)
|
|
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 AdditionalReferenceType) 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 AdditionalReferenceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceType)
|
|
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 AdditionalReferenceType
|
|
Return CType(SerializerXml.Deserialize(s), AdditionalReferenceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AdditionalReferenceType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an AdditionalReferenceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AdditionalReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AdditionalReferenceType)
|
|
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 AdditionalReferenceType) 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 AdditionalReferenceType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class CustomerFieldsType
|
|
|
|
#Region "Private fields"
|
|
Private _text1 As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _text3 As String
|
|
|
|
Private _text4 As String
|
|
|
|
Private _text5 As String
|
|
|
|
Private _text6 As String
|
|
|
|
Private _text7 As String
|
|
|
|
Private _text8 As String
|
|
|
|
Private _text9 As String
|
|
|
|
Private _text10 As String
|
|
|
|
Private _num1 As Decimal
|
|
|
|
Private _num2 As Decimal
|
|
|
|
Private _num3 As Decimal
|
|
|
|
Private _num4 As Decimal
|
|
|
|
Private _num5 As Decimal
|
|
|
|
Private _num6 As Decimal
|
|
|
|
Private _num7 As Decimal
|
|
|
|
Private _num8 As Decimal
|
|
|
|
Private _num9 As Decimal
|
|
|
|
Private _num10 As Decimal
|
|
|
|
Private _flag1 As Boolean
|
|
|
|
Private _flag2 As Boolean
|
|
|
|
Private _flag3 As Boolean
|
|
|
|
Private _flag4 As Boolean
|
|
|
|
Private _flag5 As Boolean
|
|
|
|
Private _flag6 As Boolean
|
|
|
|
Private _flag7 As Boolean
|
|
|
|
Private _flag8 As Boolean
|
|
|
|
Private _flag9 As Boolean
|
|
|
|
Private _flag10 As Boolean
|
|
|
|
Private _date1 As Date
|
|
|
|
Private _date2 As Date
|
|
|
|
Private _date3 As Date
|
|
|
|
Private _date4 As Date
|
|
|
|
Private _date5 As Date
|
|
|
|
Private _date6 As Date
|
|
|
|
Private _date7 As Date
|
|
|
|
Private _date8 As Date
|
|
|
|
Private _date9 As Date
|
|
|
|
Private _date10 As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property text1() As String
|
|
Get
|
|
Return Me._text1
|
|
End Get
|
|
Set
|
|
Me._text1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text3() As String
|
|
Get
|
|
Return Me._text3
|
|
End Get
|
|
Set
|
|
Me._text3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text4() As String
|
|
Get
|
|
Return Me._text4
|
|
End Get
|
|
Set
|
|
Me._text4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text5() As String
|
|
Get
|
|
Return Me._text5
|
|
End Get
|
|
Set
|
|
Me._text5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text6() As String
|
|
Get
|
|
Return Me._text6
|
|
End Get
|
|
Set
|
|
Me._text6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text7() As String
|
|
Get
|
|
Return Me._text7
|
|
End Get
|
|
Set
|
|
Me._text7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text8() As String
|
|
Get
|
|
Return Me._text8
|
|
End Get
|
|
Set
|
|
Me._text8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text9() As String
|
|
Get
|
|
Return Me._text9
|
|
End Get
|
|
Set
|
|
Me._text9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text10() As String
|
|
Get
|
|
Return Me._text10
|
|
End Get
|
|
Set
|
|
Me._text10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num1() As Decimal
|
|
Get
|
|
Return Me._num1
|
|
End Get
|
|
Set
|
|
Me._num1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num2() As Decimal
|
|
Get
|
|
Return Me._num2
|
|
End Get
|
|
Set
|
|
Me._num2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num3() As Decimal
|
|
Get
|
|
Return Me._num3
|
|
End Get
|
|
Set
|
|
Me._num3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num4() As Decimal
|
|
Get
|
|
Return Me._num4
|
|
End Get
|
|
Set
|
|
Me._num4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num5() As Decimal
|
|
Get
|
|
Return Me._num5
|
|
End Get
|
|
Set
|
|
Me._num5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num6() As Decimal
|
|
Get
|
|
Return Me._num6
|
|
End Get
|
|
Set
|
|
Me._num6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num7() As Decimal
|
|
Get
|
|
Return Me._num7
|
|
End Get
|
|
Set
|
|
Me._num7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num8() As Decimal
|
|
Get
|
|
Return Me._num8
|
|
End Get
|
|
Set
|
|
Me._num8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num9() As Decimal
|
|
Get
|
|
Return Me._num9
|
|
End Get
|
|
Set
|
|
Me._num9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property num10() As Decimal
|
|
Get
|
|
Return Me._num10
|
|
End Get
|
|
Set
|
|
Me._num10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag1() As Boolean
|
|
Get
|
|
Return Me._flag1
|
|
End Get
|
|
Set
|
|
Me._flag1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag2() As Boolean
|
|
Get
|
|
Return Me._flag2
|
|
End Get
|
|
Set
|
|
Me._flag2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag3() As Boolean
|
|
Get
|
|
Return Me._flag3
|
|
End Get
|
|
Set
|
|
Me._flag3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag4() As Boolean
|
|
Get
|
|
Return Me._flag4
|
|
End Get
|
|
Set
|
|
Me._flag4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag5() As Boolean
|
|
Get
|
|
Return Me._flag5
|
|
End Get
|
|
Set
|
|
Me._flag5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag6() As Boolean
|
|
Get
|
|
Return Me._flag6
|
|
End Get
|
|
Set
|
|
Me._flag6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag7() As Boolean
|
|
Get
|
|
Return Me._flag7
|
|
End Get
|
|
Set
|
|
Me._flag7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag8() As Boolean
|
|
Get
|
|
Return Me._flag8
|
|
End Get
|
|
Set
|
|
Me._flag8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag9() As Boolean
|
|
Get
|
|
Return Me._flag9
|
|
End Get
|
|
Set
|
|
Me._flag9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag10() As Boolean
|
|
Get
|
|
Return Me._flag10
|
|
End Get
|
|
Set
|
|
Me._flag10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date1() As Date
|
|
Get
|
|
Return Me._date1
|
|
End Get
|
|
Set
|
|
Me._date1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date2() As Date
|
|
Get
|
|
Return Me._date2
|
|
End Get
|
|
Set
|
|
Me._date2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date3() As Date
|
|
Get
|
|
Return Me._date3
|
|
End Get
|
|
Set
|
|
Me._date3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date4() As Date
|
|
Get
|
|
Return Me._date4
|
|
End Get
|
|
Set
|
|
Me._date4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date5() As Date
|
|
Get
|
|
Return Me._date5
|
|
End Get
|
|
Set
|
|
Me._date5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date6() As Date
|
|
Get
|
|
Return Me._date6
|
|
End Get
|
|
Set
|
|
Me._date6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date7() As Date
|
|
Get
|
|
Return Me._date7
|
|
End Get
|
|
Set
|
|
Me._date7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date8() As Date
|
|
Get
|
|
Return Me._date8
|
|
End Get
|
|
Set
|
|
Me._date8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date9() As Date
|
|
Get
|
|
Return Me._date9
|
|
End Get
|
|
Set
|
|
Me._date9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date10() As Date
|
|
Get
|
|
Return Me._date10
|
|
End Get
|
|
Set
|
|
Me._date10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomerFieldsType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CustomerFieldsType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes CustomerFieldsType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CustomerFieldsType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CustomerFieldsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CustomerFieldsType)
|
|
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 CustomerFieldsType) 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 CustomerFieldsType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomerFieldsType)
|
|
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 CustomerFieldsType
|
|
Return CType(SerializerXml.Deserialize(s), CustomerFieldsType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CustomerFieldsType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an CustomerFieldsType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CustomerFieldsType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CustomerFieldsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CustomerFieldsType)
|
|
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 CustomerFieldsType) 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 CustomerFieldsType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class HouseConsignmentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _countryOfDispatch As String
|
|
|
|
Private _countryOfDestination As String
|
|
|
|
Private _grossMass As Decimal
|
|
|
|
Private _referenceNumberUniqueConsignmentReference As String
|
|
|
|
Private _consignor As OperatorWithContactAndSubsidiaryType
|
|
|
|
Private _consignee As OperatorWithContactAndSubsidiaryType
|
|
|
|
Private _methodOfPayment As String
|
|
|
|
Private _previousDocument As List(Of PreviousDocumentType)
|
|
|
|
Private _supportingDocument As List(Of SupportingDocumentType)
|
|
|
|
Private _transportDocument As List(Of TransportDocumentType)
|
|
|
|
Private _additionalReference As List(Of AdditionalReferenceType)
|
|
|
|
Private _additionalInformation As List(Of AdditionalInformationType)
|
|
|
|
Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType)
|
|
|
|
Private _customerFields As CustomerFieldsType
|
|
|
|
Private _consignmentItem As List(Of ConsignmentItemType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._consignmentItem = New List(Of ConsignmentItemType)()
|
|
Me._customerFields = New CustomerFieldsType()
|
|
Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)()
|
|
Me._additionalInformation = New List(Of AdditionalInformationType)()
|
|
Me._additionalReference = New List(Of AdditionalReferenceType)()
|
|
Me._transportDocument = New List(Of TransportDocumentType)()
|
|
Me._supportingDocument = New List(Of SupportingDocumentType)()
|
|
Me._previousDocument = New List(Of PreviousDocumentType)()
|
|
Me._consignee = New OperatorWithContactAndSubsidiaryType()
|
|
Me._consignor = New OperatorWithContactAndSubsidiaryType()
|
|
End Sub
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDispatch() As String
|
|
Get
|
|
Return Me._countryOfDispatch
|
|
End Get
|
|
Set
|
|
Me._countryOfDispatch = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDestination() As String
|
|
Get
|
|
Return Me._countryOfDestination
|
|
End Get
|
|
Set
|
|
Me._countryOfDestination = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossMass() As Decimal
|
|
Get
|
|
Return Me._grossMass
|
|
End Get
|
|
Set
|
|
Me._grossMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumberUniqueConsignmentReference() As String
|
|
Get
|
|
Return Me._referenceNumberUniqueConsignmentReference
|
|
End Get
|
|
Set
|
|
Me._referenceNumberUniqueConsignmentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignor() As OperatorWithContactAndSubsidiaryType
|
|
Get
|
|
Return Me._consignor
|
|
End Get
|
|
Set
|
|
Me._consignor = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignee() As OperatorWithContactAndSubsidiaryType
|
|
Get
|
|
Return Me._consignee
|
|
End Get
|
|
Set
|
|
Me._consignee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property methodOfPayment() As String
|
|
Get
|
|
Return Me._methodOfPayment
|
|
End Get
|
|
Set
|
|
Me._methodOfPayment = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("previousDocument")>
|
|
Public Property previousDocument() As List(Of PreviousDocumentType)
|
|
Get
|
|
Return Me._previousDocument
|
|
End Get
|
|
Set
|
|
Me._previousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("supportingDocument")>
|
|
Public Property supportingDocument() As List(Of SupportingDocumentType)
|
|
Get
|
|
Return Me._supportingDocument
|
|
End Get
|
|
Set
|
|
Me._supportingDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("transportDocument")>
|
|
Public Property transportDocument() As List(Of TransportDocumentType)
|
|
Get
|
|
Return Me._transportDocument
|
|
End Get
|
|
Set
|
|
Me._transportDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalReference")>
|
|
Public Property additionalReference() As List(Of AdditionalReferenceType)
|
|
Get
|
|
Return Me._additionalReference
|
|
End Get
|
|
Set
|
|
Me._additionalReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalInformation")>
|
|
Public Property additionalInformation() As List(Of AdditionalInformationType)
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalSupplyChainActor")>
|
|
Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType)
|
|
Get
|
|
Return Me._additionalSupplyChainActor
|
|
End Get
|
|
Set
|
|
Me._additionalSupplyChainActor = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customerFields() As CustomerFieldsType
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("consignmentItem")>
|
|
Public Property consignmentItem() As List(Of ConsignmentItemType)
|
|
Get
|
|
Return Me._consignmentItem
|
|
End Get
|
|
Set
|
|
Me._consignmentItem = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HouseConsignmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize HouseConsignmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes HouseConsignmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output HouseConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HouseConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HouseConsignmentType)
|
|
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 HouseConsignmentType) 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 HouseConsignmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HouseConsignmentType)
|
|
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 HouseConsignmentType
|
|
Return CType(SerializerXml.Deserialize(s), HouseConsignmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current HouseConsignmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an HouseConsignmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output HouseConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HouseConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HouseConsignmentType)
|
|
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 HouseConsignmentType) 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 HouseConsignmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class PortInformationType
|
|
|
|
#Region "Private fields"
|
|
Private _documentType As String
|
|
|
|
Private _bookingReference As String
|
|
|
|
Private _port As String
|
|
|
|
Private _terminal As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property documentType() As String
|
|
Get
|
|
Return Me._documentType
|
|
End Get
|
|
Set
|
|
Me._documentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bookingReference() As String
|
|
Get
|
|
Return Me._bookingReference
|
|
End Get
|
|
Set
|
|
Me._bookingReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property port() As String
|
|
Get
|
|
Return Me._port
|
|
End Get
|
|
Set
|
|
Me._port = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property terminal() As String
|
|
Get
|
|
Return Me._terminal
|
|
End Get
|
|
Set
|
|
Me._terminal = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PortInformationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize PortInformationType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes PortInformationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output PortInformationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PortInformationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PortInformationType)
|
|
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 PortInformationType) 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 PortInformationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PortInformationType)
|
|
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 PortInformationType
|
|
Return CType(SerializerXml.Deserialize(s), PortInformationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current PortInformationType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an PortInformationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output PortInformationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PortInformationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PortInformationType)
|
|
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 PortInformationType) 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 PortInformationType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransitDeclarationPartnerType
|
|
|
|
#Region "Private fields"
|
|
Private _type As String
|
|
|
|
Private _status As String
|
|
|
|
Private _addressNumber As String
|
|
|
|
Private _identificationNumber As String
|
|
|
|
Private _name As String
|
|
|
|
Private _representativeRin As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private _tirHolderIdentificationNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property type() As String
|
|
Get
|
|
Return Me._type
|
|
End Get
|
|
Set
|
|
Me._type = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property status() As String
|
|
Get
|
|
Return Me._status
|
|
End Get
|
|
Set
|
|
Me._status = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumber() As String
|
|
Get
|
|
Return Me._identificationNumber
|
|
End Get
|
|
Set
|
|
Me._identificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property representativeRin() As String
|
|
Get
|
|
Return Me._representativeRin
|
|
End Get
|
|
Set
|
|
Me._representativeRin = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tirHolderIdentificationNumber() As String
|
|
Get
|
|
Return Me._tirHolderIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._tirHolderIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationPartnerType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclarationPartnerType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclarationPartnerType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationPartnerType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclarationPartnerType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationPartnerType)
|
|
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 TransitDeclarationPartnerType) 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 TransitDeclarationPartnerType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationPartnerType)
|
|
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 TransitDeclarationPartnerType
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclarationPartnerType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclarationPartnerType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclarationPartnerType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationPartnerType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclarationPartnerType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationPartnerType)
|
|
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 TransitDeclarationPartnerType) 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 TransitDeclarationPartnerType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class IncidentGoodsReferenceType
|
|
|
|
#Region "Private fields"
|
|
Private _headerId As String
|
|
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _transportEquipmentGoodsReferenceDeclarationGoodsItemNumber As Integer
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property headerId() As String
|
|
Get
|
|
Return Me._headerId
|
|
End Get
|
|
Set
|
|
Me._headerId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportEquipmentGoodsReferenceDeclarationGoodsItemNumber() As Integer
|
|
Get
|
|
Return Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber
|
|
End Get
|
|
Set
|
|
Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentGoodsReferenceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IncidentGoodsReferenceType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes IncidentGoodsReferenceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IncidentGoodsReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentGoodsReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentGoodsReferenceType)
|
|
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 IncidentGoodsReferenceType) 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 IncidentGoodsReferenceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentGoodsReferenceType)
|
|
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 IncidentGoodsReferenceType
|
|
Return CType(SerializerXml.Deserialize(s), IncidentGoodsReferenceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IncidentGoodsReferenceType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an IncidentGoodsReferenceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IncidentGoodsReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IncidentGoodsReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentGoodsReferenceType)
|
|
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 IncidentGoodsReferenceType) 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 IncidentGoodsReferenceType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class IncidentSealType
|
|
|
|
#Region "Private fields"
|
|
Private _headerId As String
|
|
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _sealsIdentifier As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property headerId() As String
|
|
Get
|
|
Return Me._headerId
|
|
End Get
|
|
Set
|
|
Me._headerId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sealsIdentifier() As String
|
|
Get
|
|
Return Me._sealsIdentifier
|
|
End Get
|
|
Set
|
|
Me._sealsIdentifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentSealType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IncidentSealType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes IncidentSealType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IncidentSealType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentSealType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentSealType)
|
|
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 IncidentSealType) 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 IncidentSealType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentSealType)
|
|
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 IncidentSealType
|
|
Return CType(SerializerXml.Deserialize(s), IncidentSealType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IncidentSealType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an IncidentSealType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IncidentSealType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IncidentSealType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentSealType)
|
|
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 IncidentSealType) 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 IncidentSealType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class IncidentTransportEquipmentType
|
|
|
|
#Region "Private fields"
|
|
Private _headerId As String
|
|
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _containerIdentificationNumber As String
|
|
|
|
Private _numberOfSeals As Integer
|
|
|
|
Private _seal As List(Of IncidentSealType)
|
|
|
|
Private _goodsReference As List(Of IncidentGoodsReferenceType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._goodsReference = New List(Of IncidentGoodsReferenceType)()
|
|
Me._seal = New List(Of IncidentSealType)()
|
|
End Sub
|
|
|
|
Public Property headerId() As String
|
|
Get
|
|
Return Me._headerId
|
|
End Get
|
|
Set
|
|
Me._headerId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerIdentificationNumber() As String
|
|
Get
|
|
Return Me._containerIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._containerIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property numberOfSeals() As Integer
|
|
Get
|
|
Return Me._numberOfSeals
|
|
End Get
|
|
Set
|
|
Me._numberOfSeals = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("seal")>
|
|
Public Property seal() As List(Of IncidentSealType)
|
|
Get
|
|
Return Me._seal
|
|
End Get
|
|
Set
|
|
Me._seal = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("goodsReference")>
|
|
Public Property goodsReference() As List(Of IncidentGoodsReferenceType)
|
|
Get
|
|
Return Me._goodsReference
|
|
End Get
|
|
Set
|
|
Me._goodsReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentTransportEquipmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IncidentTransportEquipmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes IncidentTransportEquipmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IncidentTransportEquipmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentTransportEquipmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentTransportEquipmentType)
|
|
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 IncidentTransportEquipmentType) 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 IncidentTransportEquipmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentTransportEquipmentType)
|
|
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 IncidentTransportEquipmentType
|
|
Return CType(SerializerXml.Deserialize(s), IncidentTransportEquipmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IncidentTransportEquipmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an IncidentTransportEquipmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IncidentTransportEquipmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IncidentTransportEquipmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentTransportEquipmentType)
|
|
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 IncidentTransportEquipmentType) 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 IncidentTransportEquipmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class IncidentType
|
|
|
|
#Region "Private fields"
|
|
Private _transportEquipment As List(Of IncidentTransportEquipmentType)
|
|
|
|
Private _headerId As String
|
|
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _incidentNotificationDateAndTime As Date
|
|
|
|
Private _customsOfficeOfIncidentRegistration As String
|
|
|
|
Private _code As Integer
|
|
|
|
Private _text As String
|
|
|
|
Private _endorsementDate As Date
|
|
|
|
Private _endorsementAuthority As String
|
|
|
|
Private _endorsementPlace As String
|
|
|
|
Private _endorsementCountry As String
|
|
|
|
Private _locationQualifierOfIdentification As String
|
|
|
|
Private _locationUNLocode As String
|
|
|
|
Private _locationCountry As String
|
|
|
|
Private _locationGNSSLatitude As String
|
|
|
|
Private _locationGNSSLongitude As String
|
|
|
|
Private _locationAddressStreetAndNumber As String
|
|
|
|
Private _locationAddressPostcode As String
|
|
|
|
Private _locationAddressCity As String
|
|
|
|
Private _containerIndicator As Boolean
|
|
|
|
Private _transportMeansTypeOfIdentification As String
|
|
|
|
Private _transportMeansIdentificationNumber As String
|
|
|
|
Private _transportMeansNationality As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._transportEquipment = New List(Of IncidentTransportEquipmentType)()
|
|
End Sub
|
|
|
|
<XmlElement("transportEquipment")>
|
|
Public Property transportEquipment() As List(Of IncidentTransportEquipmentType)
|
|
Get
|
|
Return Me._transportEquipment
|
|
End Get
|
|
Set
|
|
Me._transportEquipment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property headerId() As String
|
|
Get
|
|
Return Me._headerId
|
|
End Get
|
|
Set
|
|
Me._headerId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property incidentNotificationDateAndTime() As Date
|
|
Get
|
|
Return Me._incidentNotificationDateAndTime
|
|
End Get
|
|
Set
|
|
Me._incidentNotificationDateAndTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfIncidentRegistration() As String
|
|
Get
|
|
Return Me._customsOfficeOfIncidentRegistration
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfIncidentRegistration = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code() As Integer
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text() As String
|
|
Get
|
|
Return Me._text
|
|
End Get
|
|
Set
|
|
Me._text = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property endorsementDate() As Date
|
|
Get
|
|
Return Me._endorsementDate
|
|
End Get
|
|
Set
|
|
Me._endorsementDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property endorsementAuthority() As String
|
|
Get
|
|
Return Me._endorsementAuthority
|
|
End Get
|
|
Set
|
|
Me._endorsementAuthority = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property endorsementPlace() As String
|
|
Get
|
|
Return Me._endorsementPlace
|
|
End Get
|
|
Set
|
|
Me._endorsementPlace = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property endorsementCountry() As String
|
|
Get
|
|
Return Me._endorsementCountry
|
|
End Get
|
|
Set
|
|
Me._endorsementCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationQualifierOfIdentification() As String
|
|
Get
|
|
Return Me._locationQualifierOfIdentification
|
|
End Get
|
|
Set
|
|
Me._locationQualifierOfIdentification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationUNLocode() As String
|
|
Get
|
|
Return Me._locationUNLocode
|
|
End Get
|
|
Set
|
|
Me._locationUNLocode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationCountry() As String
|
|
Get
|
|
Return Me._locationCountry
|
|
End Get
|
|
Set
|
|
Me._locationCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationGNSSLatitude() As String
|
|
Get
|
|
Return Me._locationGNSSLatitude
|
|
End Get
|
|
Set
|
|
Me._locationGNSSLatitude = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationGNSSLongitude() As String
|
|
Get
|
|
Return Me._locationGNSSLongitude
|
|
End Get
|
|
Set
|
|
Me._locationGNSSLongitude = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationAddressStreetAndNumber() As String
|
|
Get
|
|
Return Me._locationAddressStreetAndNumber
|
|
End Get
|
|
Set
|
|
Me._locationAddressStreetAndNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationAddressPostcode() As String
|
|
Get
|
|
Return Me._locationAddressPostcode
|
|
End Get
|
|
Set
|
|
Me._locationAddressPostcode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationAddressCity() As String
|
|
Get
|
|
Return Me._locationAddressCity
|
|
End Get
|
|
Set
|
|
Me._locationAddressCity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerIndicator() As Boolean
|
|
Get
|
|
Return Me._containerIndicator
|
|
End Get
|
|
Set
|
|
Me._containerIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportMeansTypeOfIdentification() As String
|
|
Get
|
|
Return Me._transportMeansTypeOfIdentification
|
|
End Get
|
|
Set
|
|
Me._transportMeansTypeOfIdentification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportMeansIdentificationNumber() As String
|
|
Get
|
|
Return Me._transportMeansIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._transportMeansIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportMeansNationality() As String
|
|
Get
|
|
Return Me._transportMeansNationality
|
|
End Get
|
|
Set
|
|
Me._transportMeansNationality = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IncidentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes IncidentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IncidentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentType)
|
|
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 IncidentType) 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 IncidentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentType)
|
|
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 IncidentType
|
|
Return CType(SerializerXml.Deserialize(s), IncidentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IncidentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an IncidentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IncidentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IncidentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IncidentType)
|
|
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 IncidentType) 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 IncidentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class CarrierType
|
|
|
|
#Region "Private fields"
|
|
Private _addressNumber As String
|
|
|
|
Private _identificationNumber As String
|
|
|
|
Private _subsidiaryNumber As String
|
|
|
|
Private _name As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumber() As String
|
|
Get
|
|
Return Me._identificationNumber
|
|
End Get
|
|
Set
|
|
Me._identificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property subsidiaryNumber() As String
|
|
Get
|
|
Return Me._subsidiaryNumber
|
|
End Get
|
|
Set
|
|
Me._subsidiaryNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CarrierType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CarrierType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes CarrierType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CarrierType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CarrierType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CarrierType)
|
|
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 CarrierType) 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 CarrierType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CarrierType)
|
|
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 CarrierType
|
|
Return CType(SerializerXml.Deserialize(s), CarrierType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CarrierType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an CarrierType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CarrierType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CarrierType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CarrierType)
|
|
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 CarrierType) 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 CarrierType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class CountryOfRoutingOfConsignmentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _country As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property country() As String
|
|
Get
|
|
Return Me._country
|
|
End Get
|
|
Set
|
|
Me._country = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CountryOfRoutingOfConsignmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CountryOfRoutingOfConsignmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes CountryOfRoutingOfConsignmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CountryOfRoutingOfConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CountryOfRoutingOfConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CountryOfRoutingOfConsignmentType)
|
|
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 CountryOfRoutingOfConsignmentType) 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 CountryOfRoutingOfConsignmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CountryOfRoutingOfConsignmentType)
|
|
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 CountryOfRoutingOfConsignmentType
|
|
Return CType(SerializerXml.Deserialize(s), CountryOfRoutingOfConsignmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CountryOfRoutingOfConsignmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an CountryOfRoutingOfConsignmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CountryOfRoutingOfConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CountryOfRoutingOfConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CountryOfRoutingOfConsignmentType)
|
|
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 CountryOfRoutingOfConsignmentType) 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 CountryOfRoutingOfConsignmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class CustomsOfficeOfTransitDeclaredType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _customsOfficeOfTransitDeclared As String
|
|
|
|
Private _arrivalDateAndTimeEstimated As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfTransitDeclared() As String
|
|
Get
|
|
Return Me._customsOfficeOfTransitDeclared
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfTransitDeclared = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property arrivalDateAndTimeEstimated() As Date
|
|
Get
|
|
Return Me._arrivalDateAndTimeEstimated
|
|
End Get
|
|
Set
|
|
Me._arrivalDateAndTimeEstimated = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfTransitDeclaredType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CustomsOfficeOfTransitDeclaredType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes CustomsOfficeOfTransitDeclaredType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CustomsOfficeOfTransitDeclaredType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CustomsOfficeOfTransitDeclaredType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType)
|
|
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 CustomsOfficeOfTransitDeclaredType) 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 CustomsOfficeOfTransitDeclaredType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfTransitDeclaredType)
|
|
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 CustomsOfficeOfTransitDeclaredType
|
|
Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfTransitDeclaredType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CustomsOfficeOfTransitDeclaredType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an CustomsOfficeOfTransitDeclaredType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CustomsOfficeOfTransitDeclaredType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CustomsOfficeOfTransitDeclaredType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType)
|
|
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 CustomsOfficeOfTransitDeclaredType) 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 CustomsOfficeOfTransitDeclaredType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class ActiveTransportMeansType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _typeOfIdentificationAtBorderCrossing As String
|
|
|
|
Private _identificationNumberAtBorderCrossing As String
|
|
|
|
Private _nationalityAtBorderCrossing As String
|
|
|
|
Private _conveyanceReferenceNumber As String
|
|
|
|
Private _customsOfficeAtBorderDeclared As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfIdentificationAtBorderCrossing() As String
|
|
Get
|
|
Return Me._typeOfIdentificationAtBorderCrossing
|
|
End Get
|
|
Set
|
|
Me._typeOfIdentificationAtBorderCrossing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumberAtBorderCrossing() As String
|
|
Get
|
|
Return Me._identificationNumberAtBorderCrossing
|
|
End Get
|
|
Set
|
|
Me._identificationNumberAtBorderCrossing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property nationalityAtBorderCrossing() As String
|
|
Get
|
|
Return Me._nationalityAtBorderCrossing
|
|
End Get
|
|
Set
|
|
Me._nationalityAtBorderCrossing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property conveyanceReferenceNumber() As String
|
|
Get
|
|
Return Me._conveyanceReferenceNumber
|
|
End Get
|
|
Set
|
|
Me._conveyanceReferenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeAtBorderDeclared() As String
|
|
Get
|
|
Return Me._customsOfficeAtBorderDeclared
|
|
End Get
|
|
Set
|
|
Me._customsOfficeAtBorderDeclared = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ActiveTransportMeansType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ActiveTransportMeansType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ActiveTransportMeansType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ActiveTransportMeansType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ActiveTransportMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ActiveTransportMeansType)
|
|
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 ActiveTransportMeansType) 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 ActiveTransportMeansType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ActiveTransportMeansType)
|
|
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 ActiveTransportMeansType
|
|
Return CType(SerializerXml.Deserialize(s), ActiveTransportMeansType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ActiveTransportMeansType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ActiveTransportMeansType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ActiveTransportMeansType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ActiveTransportMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ActiveTransportMeansType)
|
|
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 ActiveTransportMeansType) 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 ActiveTransportMeansType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class DepartureTransportMeansType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _typeOfIdentificationAtDeparture As String
|
|
|
|
Private _identificationNumberAtDeparture As String
|
|
|
|
Private _nationalityAtDeparture As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfIdentificationAtDeparture() As String
|
|
Get
|
|
Return Me._typeOfIdentificationAtDeparture
|
|
End Get
|
|
Set
|
|
Me._typeOfIdentificationAtDeparture = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumberAtDeparture() As String
|
|
Get
|
|
Return Me._identificationNumberAtDeparture
|
|
End Get
|
|
Set
|
|
Me._identificationNumberAtDeparture = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property nationalityAtDeparture() As String
|
|
Get
|
|
Return Me._nationalityAtDeparture
|
|
End Get
|
|
Set
|
|
Me._nationalityAtDeparture = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DepartureTransportMeansType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DepartureTransportMeansType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes DepartureTransportMeansType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DepartureTransportMeansType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DepartureTransportMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DepartureTransportMeansType)
|
|
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 DepartureTransportMeansType) 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 DepartureTransportMeansType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansType)
|
|
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 DepartureTransportMeansType
|
|
Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DepartureTransportMeansType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DepartureTransportMeansType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DepartureTransportMeansType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DepartureTransportMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DepartureTransportMeansType)
|
|
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 DepartureTransportMeansType) 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 DepartureTransportMeansType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class GoodsReferenceType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _transportEquipmentGoodsReferenceDeclarationGoodsItemNumber As Integer
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportEquipmentGoodsReferenceDeclarationGoodsItemNumber() As Integer
|
|
Get
|
|
Return Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber
|
|
End Get
|
|
Set
|
|
Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsReferenceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize GoodsReferenceType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes GoodsReferenceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output GoodsReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GoodsReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, GoodsReferenceType)
|
|
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 GoodsReferenceType) 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 GoodsReferenceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsReferenceType)
|
|
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 GoodsReferenceType
|
|
Return CType(SerializerXml.Deserialize(s), GoodsReferenceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current GoodsReferenceType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an GoodsReferenceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output GoodsReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GoodsReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, GoodsReferenceType)
|
|
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 GoodsReferenceType) 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 GoodsReferenceType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class SealType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _sealsIdentifier As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sealsIdentifier() As String
|
|
Get
|
|
Return Me._sealsIdentifier
|
|
End Get
|
|
Set
|
|
Me._sealsIdentifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SealType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SealType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes SealType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SealType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SealType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SealType)
|
|
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 SealType) 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 SealType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SealType)
|
|
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 SealType
|
|
Return CType(SerializerXml.Deserialize(s), SealType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SealType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an SealType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SealType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SealType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SealType)
|
|
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 SealType) 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 SealType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransportEquipmentType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _containerIdentificationNumber As String
|
|
|
|
Private _numberOfSeals As Integer
|
|
|
|
Private _seal As List(Of SealType)
|
|
|
|
Private _goodsReference As List(Of GoodsReferenceType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._goodsReference = New List(Of GoodsReferenceType)()
|
|
Me._seal = New List(Of SealType)()
|
|
End Sub
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerIdentificationNumber() As String
|
|
Get
|
|
Return Me._containerIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._containerIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property numberOfSeals() As Integer
|
|
Get
|
|
Return Me._numberOfSeals
|
|
End Get
|
|
Set
|
|
Me._numberOfSeals = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("seal")>
|
|
Public Property seal() As List(Of SealType)
|
|
Get
|
|
Return Me._seal
|
|
End Get
|
|
Set
|
|
Me._seal = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("goodsReference")>
|
|
Public Property goodsReference() As List(Of GoodsReferenceType)
|
|
Get
|
|
Return Me._goodsReference
|
|
End Get
|
|
Set
|
|
Me._goodsReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportEquipmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransportEquipmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransportEquipmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransportEquipmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransportEquipmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransportEquipmentType)
|
|
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 TransportEquipmentType) 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 TransportEquipmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentType)
|
|
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 TransportEquipmentType
|
|
Return CType(SerializerXml.Deserialize(s), TransportEquipmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransportEquipmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransportEquipmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransportEquipmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransportEquipmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransportEquipmentType)
|
|
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 TransportEquipmentType) 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 TransportEquipmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class PostCodeAddressType
|
|
|
|
#Region "Private fields"
|
|
Private _houseNumber As String
|
|
|
|
Private _postcode As String
|
|
|
|
Private _country As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property houseNumber() As String
|
|
Get
|
|
Return Me._houseNumber
|
|
End Get
|
|
Set
|
|
Me._houseNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property postcode() As String
|
|
Get
|
|
Return Me._postcode
|
|
End Get
|
|
Set
|
|
Me._postcode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property country() As String
|
|
Get
|
|
Return Me._country
|
|
End Get
|
|
Set
|
|
Me._country = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PostCodeAddressType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize PostCodeAddressType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes PostCodeAddressType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output PostCodeAddressType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PostCodeAddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PostCodeAddressType)
|
|
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 PostCodeAddressType) 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 PostCodeAddressType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PostCodeAddressType)
|
|
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 PostCodeAddressType
|
|
Return CType(SerializerXml.Deserialize(s), PostCodeAddressType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current PostCodeAddressType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an PostCodeAddressType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output PostCodeAddressType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PostCodeAddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PostCodeAddressType)
|
|
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 PostCodeAddressType) 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 PostCodeAddressType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class LocationOfGoodsType
|
|
|
|
#Region "Private fields"
|
|
Private _typeOfLocation As String
|
|
|
|
Private _qualifierOfIdentification As String
|
|
|
|
Private _additionalIdentifier As String
|
|
|
|
Private _unLocode As String
|
|
|
|
Private _authorisationNumber As String
|
|
|
|
Private _customsOffice As String
|
|
|
|
Private _gnssLatitude As String
|
|
|
|
Private _gnssLongitude As String
|
|
|
|
Private _economicOperatorIdentificationNumber As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _postCodeAddress As PostCodeAddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private _addressNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._postCodeAddress = New PostCodeAddressType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property typeOfLocation() As String
|
|
Get
|
|
Return Me._typeOfLocation
|
|
End Get
|
|
Set
|
|
Me._typeOfLocation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property qualifierOfIdentification() As String
|
|
Get
|
|
Return Me._qualifierOfIdentification
|
|
End Get
|
|
Set
|
|
Me._qualifierOfIdentification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalIdentifier() As String
|
|
Get
|
|
Return Me._additionalIdentifier
|
|
End Get
|
|
Set
|
|
Me._additionalIdentifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unLocode() As String
|
|
Get
|
|
Return Me._unLocode
|
|
End Get
|
|
Set
|
|
Me._unLocode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorisationNumber() As String
|
|
Get
|
|
Return Me._authorisationNumber
|
|
End Get
|
|
Set
|
|
Me._authorisationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOffice() As String
|
|
Get
|
|
Return Me._customsOffice
|
|
End Get
|
|
Set
|
|
Me._customsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property gnssLatitude() As String
|
|
Get
|
|
Return Me._gnssLatitude
|
|
End Get
|
|
Set
|
|
Me._gnssLatitude = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property gnssLongitude() As String
|
|
Get
|
|
Return Me._gnssLongitude
|
|
End Get
|
|
Set
|
|
Me._gnssLongitude = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property economicOperatorIdentificationNumber() As String
|
|
Get
|
|
Return Me._economicOperatorIdentificationNumber
|
|
End Get
|
|
Set
|
|
Me._economicOperatorIdentificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property postCodeAddress() As PostCodeAddressType
|
|
Get
|
|
Return Me._postCodeAddress
|
|
End Get
|
|
Set
|
|
Me._postCodeAddress = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LocationOfGoodsType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LocationOfGoodsType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes LocationOfGoodsType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LocationOfGoodsType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As LocationOfGoodsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LocationOfGoodsType)
|
|
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 LocationOfGoodsType) 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 LocationOfGoodsType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LocationOfGoodsType)
|
|
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 LocationOfGoodsType
|
|
Return CType(SerializerXml.Deserialize(s), LocationOfGoodsType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LocationOfGoodsType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an LocationOfGoodsType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LocationOfGoodsType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As LocationOfGoodsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LocationOfGoodsType)
|
|
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 LocationOfGoodsType) 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 LocationOfGoodsType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class LoadingType
|
|
|
|
#Region "Private fields"
|
|
Private _country As String
|
|
|
|
Private _location As String
|
|
|
|
Private _unlocode As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property country() As String
|
|
Get
|
|
Return Me._country
|
|
End Get
|
|
Set
|
|
Me._country = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property location() As String
|
|
Get
|
|
Return Me._location
|
|
End Get
|
|
Set
|
|
Me._location = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unlocode() As String
|
|
Get
|
|
Return Me._unlocode
|
|
End Get
|
|
Set
|
|
Me._unlocode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LoadingType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LoadingType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes LoadingType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LoadingType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As LoadingType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LoadingType)
|
|
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 LoadingType) 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 LoadingType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LoadingType)
|
|
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 LoadingType
|
|
Return CType(SerializerXml.Deserialize(s), LoadingType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LoadingType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an LoadingType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LoadingType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As LoadingType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LoadingType)
|
|
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 LoadingType) 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 LoadingType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransitDeclarationConsignmentType
|
|
|
|
#Region "Private fields"
|
|
Private _countryOfDispatch As String
|
|
|
|
Private _countryOfDestination As String
|
|
|
|
Private _containerIndicator As Boolean
|
|
|
|
Private _inlandModeOfTransport As String
|
|
|
|
Private _modeOfTransportAtTheBorder As String
|
|
|
|
Private _consignmentGrossMass As Decimal
|
|
|
|
Private _referenceNumberUniqueConsignmentReference As String
|
|
|
|
Private _placeOfLoading As LoadingType
|
|
|
|
Private _placeOfUnloading As LoadingType
|
|
|
|
Private _locationOfGoods As LocationOfGoodsType
|
|
|
|
Private _transportEquipment As List(Of TransportEquipmentType)
|
|
|
|
Private _departureTransportMeans As List(Of DepartureTransportMeansType)
|
|
|
|
Private _activeTransportMeans As List(Of ActiveTransportMeansType)
|
|
|
|
Private _customsOfficeOfTransitDeclared As List(Of CustomsOfficeOfTransitDeclaredType)
|
|
|
|
Private _countryOfRoutingOfConsignment As List(Of CountryOfRoutingOfConsignmentType)
|
|
|
|
Private _carrier As CarrierType
|
|
|
|
Private _consignor As OperatorWithContactAndSubsidiaryType
|
|
|
|
Private _consignee As OperatorWithContactAndSubsidiaryType
|
|
|
|
Private _previousDocument As List(Of PreviousDocumentType)
|
|
|
|
Private _supportingDocument As List(Of SupportingDocumentType)
|
|
|
|
Private _transportDocument As List(Of TransportDocumentType)
|
|
|
|
Private _additionalInformation As List(Of AdditionalInformationType)
|
|
|
|
Private _additionalReference As List(Of AdditionalReferenceType)
|
|
|
|
Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType)
|
|
|
|
Private _incident As List(Of IncidentType)
|
|
|
|
Private _partner As List(Of TransitDeclarationPartnerType)
|
|
|
|
Private _methodOfPayment As String
|
|
|
|
Private _customerFields As CustomerFieldsType
|
|
|
|
Private _closed As Boolean
|
|
|
|
Private _worklist As String
|
|
|
|
Private _portInformation As PortInformationType
|
|
|
|
Private _houseConsignment As List(Of HouseConsignmentType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._houseConsignment = New List(Of HouseConsignmentType)()
|
|
Me._portInformation = New PortInformationType()
|
|
Me._customerFields = New CustomerFieldsType()
|
|
Me._partner = New List(Of TransitDeclarationPartnerType)()
|
|
Me._incident = New List(Of IncidentType)()
|
|
Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)()
|
|
Me._additionalReference = New List(Of AdditionalReferenceType)()
|
|
Me._additionalInformation = New List(Of AdditionalInformationType)()
|
|
Me._transportDocument = New List(Of TransportDocumentType)()
|
|
Me._supportingDocument = New List(Of SupportingDocumentType)()
|
|
Me._previousDocument = New List(Of PreviousDocumentType)()
|
|
Me._consignee = New OperatorWithContactAndSubsidiaryType()
|
|
Me._consignor = New OperatorWithContactAndSubsidiaryType()
|
|
Me._carrier = New CarrierType()
|
|
Me._countryOfRoutingOfConsignment = New List(Of CountryOfRoutingOfConsignmentType)()
|
|
Me._customsOfficeOfTransitDeclared = New List(Of CustomsOfficeOfTransitDeclaredType)()
|
|
Me._activeTransportMeans = New List(Of ActiveTransportMeansType)()
|
|
Me._departureTransportMeans = New List(Of DepartureTransportMeansType)()
|
|
Me._transportEquipment = New List(Of TransportEquipmentType)()
|
|
Me._locationOfGoods = New LocationOfGoodsType()
|
|
Me._placeOfUnloading = New LoadingType()
|
|
Me._placeOfLoading = New LoadingType()
|
|
End Sub
|
|
|
|
Public Property countryOfDispatch() As String
|
|
Get
|
|
Return Me._countryOfDispatch
|
|
End Get
|
|
Set
|
|
Me._countryOfDispatch = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDestination() As String
|
|
Get
|
|
Return Me._countryOfDestination
|
|
End Get
|
|
Set
|
|
Me._countryOfDestination = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerIndicator() As Boolean
|
|
Get
|
|
Return Me._containerIndicator
|
|
End Get
|
|
Set
|
|
Me._containerIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property inlandModeOfTransport() As String
|
|
Get
|
|
Return Me._inlandModeOfTransport
|
|
End Get
|
|
Set
|
|
Me._inlandModeOfTransport = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modeOfTransportAtTheBorder() As String
|
|
Get
|
|
Return Me._modeOfTransportAtTheBorder
|
|
End Get
|
|
Set
|
|
Me._modeOfTransportAtTheBorder = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignmentGrossMass() As Decimal
|
|
Get
|
|
Return Me._consignmentGrossMass
|
|
End Get
|
|
Set
|
|
Me._consignmentGrossMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumberUniqueConsignmentReference() As String
|
|
Get
|
|
Return Me._referenceNumberUniqueConsignmentReference
|
|
End Get
|
|
Set
|
|
Me._referenceNumberUniqueConsignmentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property placeOfLoading() As LoadingType
|
|
Get
|
|
Return Me._placeOfLoading
|
|
End Get
|
|
Set
|
|
Me._placeOfLoading = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property placeOfUnloading() As LoadingType
|
|
Get
|
|
Return Me._placeOfUnloading
|
|
End Get
|
|
Set
|
|
Me._placeOfUnloading = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationOfGoods() As LocationOfGoodsType
|
|
Get
|
|
Return Me._locationOfGoods
|
|
End Get
|
|
Set
|
|
Me._locationOfGoods = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("transportEquipment")>
|
|
Public Property transportEquipment() As List(Of TransportEquipmentType)
|
|
Get
|
|
Return Me._transportEquipment
|
|
End Get
|
|
Set
|
|
Me._transportEquipment = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("departureTransportMeans")>
|
|
Public Property departureTransportMeans() As List(Of DepartureTransportMeansType)
|
|
Get
|
|
Return Me._departureTransportMeans
|
|
End Get
|
|
Set
|
|
Me._departureTransportMeans = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("activeTransportMeans")>
|
|
Public Property activeTransportMeans() As List(Of ActiveTransportMeansType)
|
|
Get
|
|
Return Me._activeTransportMeans
|
|
End Get
|
|
Set
|
|
Me._activeTransportMeans = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("customsOfficeOfTransitDeclared")>
|
|
Public Property customsOfficeOfTransitDeclared() As List(Of CustomsOfficeOfTransitDeclaredType)
|
|
Get
|
|
Return Me._customsOfficeOfTransitDeclared
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfTransitDeclared = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("countryOfRoutingOfConsignment")>
|
|
Public Property countryOfRoutingOfConsignment() As List(Of CountryOfRoutingOfConsignmentType)
|
|
Get
|
|
Return Me._countryOfRoutingOfConsignment
|
|
End Get
|
|
Set
|
|
Me._countryOfRoutingOfConsignment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property carrier() As CarrierType
|
|
Get
|
|
Return Me._carrier
|
|
End Get
|
|
Set
|
|
Me._carrier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignor() As OperatorWithContactAndSubsidiaryType
|
|
Get
|
|
Return Me._consignor
|
|
End Get
|
|
Set
|
|
Me._consignor = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignee() As OperatorWithContactAndSubsidiaryType
|
|
Get
|
|
Return Me._consignee
|
|
End Get
|
|
Set
|
|
Me._consignee = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("previousDocument")>
|
|
Public Property previousDocument() As List(Of PreviousDocumentType)
|
|
Get
|
|
Return Me._previousDocument
|
|
End Get
|
|
Set
|
|
Me._previousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("supportingDocument")>
|
|
Public Property supportingDocument() As List(Of SupportingDocumentType)
|
|
Get
|
|
Return Me._supportingDocument
|
|
End Get
|
|
Set
|
|
Me._supportingDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("transportDocument")>
|
|
Public Property transportDocument() As List(Of TransportDocumentType)
|
|
Get
|
|
Return Me._transportDocument
|
|
End Get
|
|
Set
|
|
Me._transportDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalInformation")>
|
|
Public Property additionalInformation() As List(Of AdditionalInformationType)
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalReference")>
|
|
Public Property additionalReference() As List(Of AdditionalReferenceType)
|
|
Get
|
|
Return Me._additionalReference
|
|
End Get
|
|
Set
|
|
Me._additionalReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("additionalSupplyChainActor")>
|
|
Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType)
|
|
Get
|
|
Return Me._additionalSupplyChainActor
|
|
End Get
|
|
Set
|
|
Me._additionalSupplyChainActor = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("incident")>
|
|
Public Property incident() As List(Of IncidentType)
|
|
Get
|
|
Return Me._incident
|
|
End Get
|
|
Set
|
|
Me._incident = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("partner")>
|
|
Public Property partner() As List(Of TransitDeclarationPartnerType)
|
|
Get
|
|
Return Me._partner
|
|
End Get
|
|
Set
|
|
Me._partner = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property methodOfPayment() As String
|
|
Get
|
|
Return Me._methodOfPayment
|
|
End Get
|
|
Set
|
|
Me._methodOfPayment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customerFields() As CustomerFieldsType
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property closed() As Boolean
|
|
Get
|
|
Return Me._closed
|
|
End Get
|
|
Set
|
|
Me._closed = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property worklist() As String
|
|
Get
|
|
Return Me._worklist
|
|
End Get
|
|
Set
|
|
Me._worklist = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property portInformation() As PortInformationType
|
|
Get
|
|
Return Me._portInformation
|
|
End Get
|
|
Set
|
|
Me._portInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("houseConsignment")>
|
|
Public Property houseConsignment() As List(Of HouseConsignmentType)
|
|
Get
|
|
Return Me._houseConsignment
|
|
End Get
|
|
Set
|
|
Me._houseConsignment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationConsignmentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclarationConsignmentType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclarationConsignmentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclarationConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationConsignmentType)
|
|
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 TransitDeclarationConsignmentType) 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 TransitDeclarationConsignmentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationConsignmentType)
|
|
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 TransitDeclarationConsignmentType
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclarationConsignmentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclarationConsignmentType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclarationConsignmentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationConsignmentType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclarationConsignmentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationConsignmentType)
|
|
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 TransitDeclarationConsignmentType) 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 TransitDeclarationConsignmentType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransitDeclarationGuaranteeReferenceType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _guaranteeReferenceNumber As String
|
|
|
|
Private _accessCode As String
|
|
|
|
Private _amountToBeCovered As Decimal
|
|
|
|
Private _currency As String
|
|
|
|
Private _customsOfficeOfGuarantee As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeReferenceNumber() As String
|
|
Get
|
|
Return Me._guaranteeReferenceNumber
|
|
End Get
|
|
Set
|
|
Me._guaranteeReferenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property accessCode() As String
|
|
Get
|
|
Return Me._accessCode
|
|
End Get
|
|
Set
|
|
Me._accessCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property amountToBeCovered() As Decimal
|
|
Get
|
|
Return Me._amountToBeCovered
|
|
End Get
|
|
Set
|
|
Me._amountToBeCovered = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property currency() As String
|
|
Get
|
|
Return Me._currency
|
|
End Get
|
|
Set
|
|
Me._currency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfGuarantee() As String
|
|
Get
|
|
Return Me._customsOfficeOfGuarantee
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfGuarantee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationGuaranteeReferenceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclarationGuaranteeReferenceType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclarationGuaranteeReferenceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationGuaranteeReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclarationGuaranteeReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationGuaranteeReferenceType)
|
|
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 TransitDeclarationGuaranteeReferenceType) 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 TransitDeclarationGuaranteeReferenceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationGuaranteeReferenceType)
|
|
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 TransitDeclarationGuaranteeReferenceType
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclarationGuaranteeReferenceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclarationGuaranteeReferenceType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclarationGuaranteeReferenceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationGuaranteeReferenceType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclarationGuaranteeReferenceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationGuaranteeReferenceType)
|
|
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 TransitDeclarationGuaranteeReferenceType) 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 TransitDeclarationGuaranteeReferenceType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class GuaranteeType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _guaranteeType As String
|
|
|
|
Private _otherGuaranteeReference As String
|
|
|
|
Private _kindOfCalculation As String
|
|
|
|
Private _guaranteeNotValidInCtry As String
|
|
|
|
Private _guaranteeReference As List(Of TransitDeclarationGuaranteeReferenceType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._guaranteeReference = New List(Of TransitDeclarationGuaranteeReferenceType)()
|
|
End Sub
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeType() As String
|
|
Get
|
|
Return Me._guaranteeType
|
|
End Get
|
|
Set
|
|
Me._guaranteeType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property otherGuaranteeReference() As String
|
|
Get
|
|
Return Me._otherGuaranteeReference
|
|
End Get
|
|
Set
|
|
Me._otherGuaranteeReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property kindOfCalculation() As String
|
|
Get
|
|
Return Me._kindOfCalculation
|
|
End Get
|
|
Set
|
|
Me._kindOfCalculation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeNotValidInCtry() As String
|
|
Get
|
|
Return Me._guaranteeNotValidInCtry
|
|
End Get
|
|
Set
|
|
Me._guaranteeNotValidInCtry = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("guaranteeReference")>
|
|
Public Property guaranteeReference() As List(Of TransitDeclarationGuaranteeReferenceType)
|
|
Get
|
|
Return Me._guaranteeReference
|
|
End Get
|
|
Set
|
|
Me._guaranteeReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize GuaranteeType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes GuaranteeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output GuaranteeType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GuaranteeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, GuaranteeType)
|
|
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 GuaranteeType) 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 GuaranteeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeType)
|
|
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 GuaranteeType
|
|
Return CType(SerializerXml.Deserialize(s), GuaranteeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current GuaranteeType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an GuaranteeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output GuaranteeType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GuaranteeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, GuaranteeType)
|
|
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 GuaranteeType) 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 GuaranteeType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class AuthorisationType
|
|
|
|
#Region "Private fields"
|
|
Private _sequenceNumber As Integer
|
|
|
|
Private _authorisationType As String
|
|
|
|
Private _authorisationNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property sequenceNumber() As Integer
|
|
Get
|
|
Return Me._sequenceNumber
|
|
End Get
|
|
Set
|
|
Me._sequenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorisationType() As String
|
|
Get
|
|
Return Me._authorisationType
|
|
End Get
|
|
Set
|
|
Me._authorisationType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorisationNumber() As String
|
|
Get
|
|
Return Me._authorisationNumber
|
|
End Get
|
|
Set
|
|
Me._authorisationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AuthorisationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AuthorisationType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes AuthorisationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AuthorisationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As AuthorisationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AuthorisationType)
|
|
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 AuthorisationType) 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 AuthorisationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AuthorisationType)
|
|
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 AuthorisationType
|
|
Return CType(SerializerXml.Deserialize(s), AuthorisationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AuthorisationType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an AuthorisationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AuthorisationType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AuthorisationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AuthorisationType)
|
|
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 AuthorisationType) 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 AuthorisationType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:http://www.mic-cust.com/MicNctsTransitDeclaration/1.0")>
|
|
Partial Public Class TransitDeclarationRepresentativeType
|
|
|
|
#Region "Private fields"
|
|
Private _addressNumber As String
|
|
|
|
Private _identificationNumber As String
|
|
|
|
Private _name As String
|
|
|
|
Private _address As AddressType
|
|
|
|
Private _contactPerson As ContactPersonType
|
|
|
|
Private _status As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New ContactPersonType()
|
|
Me._address = New AddressType()
|
|
End Sub
|
|
|
|
Public Property addressNumber() As String
|
|
Get
|
|
Return Me._addressNumber
|
|
End Get
|
|
Set
|
|
Me._addressNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identificationNumber() As String
|
|
Get
|
|
Return Me._identificationNumber
|
|
End Get
|
|
Set
|
|
Me._identificationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property address() As AddressType
|
|
Get
|
|
Return Me._address
|
|
End Get
|
|
Set
|
|
Me._address = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property contactPerson() As ContactPersonType
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property status() As String
|
|
Get
|
|
Return Me._status
|
|
End Get
|
|
Set
|
|
Me._status = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationRepresentativeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitDeclarationRepresentativeType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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()
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitDeclarationRepresentativeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationRepresentativeType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitDeclarationRepresentativeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationRepresentativeType)
|
|
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 TransitDeclarationRepresentativeType) 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 TransitDeclarationRepresentativeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationRepresentativeType)
|
|
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 TransitDeclarationRepresentativeType
|
|
Return CType(SerializerXml.Deserialize(s), TransitDeclarationRepresentativeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitDeclarationRepresentativeType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitDeclarationRepresentativeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitDeclarationRepresentativeType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitDeclarationRepresentativeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitDeclarationRepresentativeType)
|
|
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 TransitDeclarationRepresentativeType) 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 TransitDeclarationRepresentativeType
|
|
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
|