This commit is contained in:
2019-11-06 16:33:03 +01:00
parent c5595a729a
commit 99ba5f4513
17 changed files with 521 additions and 92 deletions

View File

@@ -38,11 +38,14 @@ Namespace VERAG_OUT_NCTS
Private _nCTS_Data As VERAG_out_nctsNCTS_Data
Private _attachments As List(Of VERAG_out_nctsAttachment)
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._attachments = New List(Of VERAG_out_nctsAttachment)()
Me._nCTS_Data = New VERAG_out_nctsNCTS_Data()
Me._processData = New VERAG_out_nctsProcessData()
Me._internalReference = New VERAG_out_nctsInternalReference()
@@ -102,6 +105,16 @@ Namespace VERAG_OUT_NCTS
End Set
End Property
<System.Xml.Serialization.XmlArrayItemAttribute("Attachment", IsNullable:=False)>
Public Property Attachments() As List(Of VERAG_out_nctsAttachment)
Get
Return Me._attachments
End Get
Set
Me._attachments = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
@@ -694,7 +707,7 @@ Namespace VERAG_OUT_NCTS
Private _carrier As VERAG_out_nctsNCTS_DataCarrier
Private _garantee As VERAG_out_nctsNCTS_DataGarantee
Private _guarantee As VERAG_out_nctsNCTS_DataGuarantee
Private _sumGrossWeight As Decimal
@@ -706,7 +719,7 @@ Namespace VERAG_OUT_NCTS
Public Sub New()
MyBase.New
Me._position = New List(Of VERAG_out_nctsNCTS_DataPosition)()
Me._garantee = New VERAG_out_nctsNCTS_DataGarantee()
Me._guarantee = New VERAG_out_nctsNCTS_DataGuarantee()
Me._carrier = New VERAG_out_nctsNCTS_DataCarrier()
Me._consignee = New VERAG_out_nctsNCTS_DataConsignee()
Me._sender = New VERAG_out_nctsNCTS_DataSender()
@@ -794,12 +807,12 @@ Namespace VERAG_OUT_NCTS
End Set
End Property
Public Property Garantee() As VERAG_out_nctsNCTS_DataGarantee
Public Property Guarantee() As VERAG_out_nctsNCTS_DataGuarantee
Get
Return Me._garantee
Return Me._guarantee
End Get
Set
Me._garantee = Value
Me._guarantee = Value
End Set
End Property
@@ -2290,7 +2303,7 @@ Namespace VERAG_OUT_NCTS
System.Diagnostics.DebuggerStepThroughAttribute(),
System.ComponentModel.DesignerCategoryAttribute("code"),
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
Partial Public Class VERAG_out_nctsNCTS_DataGarantee
Partial Public Class VERAG_out_nctsNCTS_DataGuarantee
#Region "Private fields"
Private _gRN As Object
@@ -2321,7 +2334,7 @@ Namespace VERAG_OUT_NCTS
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(VERAG_out_nctsNCTS_DataGarantee))
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(VERAG_out_nctsNCTS_DataGuarantee))
End If
Return sSerializer
End Get
@@ -2329,7 +2342,7 @@ Namespace VERAG_OUT_NCTS
#Region "Serialize/Deserialize"
''' <summary>
''' Serializes current VERAG_out_nctsNCTS_DataGarantee object into an XML string
''' Serializes current VERAG_out_nctsNCTS_DataGuarantee object into an XML string
''' </summary>
''' <returns>string XML value</returns>
Public Overridable Function Serialize() As String
@@ -2356,15 +2369,15 @@ Namespace VERAG_OUT_NCTS
End Function
''' <summary>
''' Deserializes workflow markup into an VERAG_out_nctsNCTS_DataGarantee object
''' Deserializes workflow markup into an VERAG_out_nctsNCTS_DataGuarantee object
''' </summary>
''' <param name="input">string workflow markup to deserialize</param>
''' <param name="obj">Output VERAG_out_nctsNCTS_DataGarantee object</param>
''' <param name="obj">Output VERAG_out_nctsNCTS_DataGuarantee 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 VERAG_out_nctsNCTS_DataGarantee, ByRef exception As System.Exception) As Boolean
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As VERAG_out_nctsNCTS_DataGuarantee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, VERAG_out_nctsNCTS_DataGarantee)
obj = CType(Nothing, VERAG_out_nctsNCTS_DataGuarantee)
Try
obj = Deserialize(input)
Return True
@@ -2374,16 +2387,16 @@ Namespace VERAG_OUT_NCTS
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As VERAG_out_nctsNCTS_DataGarantee) As Boolean
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As VERAG_out_nctsNCTS_DataGuarantee) 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 VERAG_out_nctsNCTS_DataGarantee
Public Overloads Shared Function Deserialize(ByVal input As String) As VERAG_out_nctsNCTS_DataGuarantee
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), VERAG_out_nctsNCTS_DataGarantee)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), VERAG_out_nctsNCTS_DataGuarantee)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
@@ -2391,13 +2404,13 @@ Namespace VERAG_OUT_NCTS
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As VERAG_out_nctsNCTS_DataGarantee
Return CType(Serializer.Deserialize(s), VERAG_out_nctsNCTS_DataGarantee)
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As VERAG_out_nctsNCTS_DataGuarantee
Return CType(Serializer.Deserialize(s), VERAG_out_nctsNCTS_DataGuarantee)
End Function
#End Region
''' <summary>
''' Serializes current VERAG_out_nctsNCTS_DataGarantee object into file
''' Serializes current VERAG_out_nctsNCTS_DataGuarantee object into file
''' </summary>
''' <param name="fileName">full path of outupt xml file</param>
''' <param name="exception">output Exception value if failed</param>
@@ -2429,15 +2442,15 @@ Namespace VERAG_OUT_NCTS
End Sub
''' <summary>
''' Deserializes xml markup from file into an VERAG_out_nctsNCTS_DataGarantee object
''' Deserializes xml markup from file into an VERAG_out_nctsNCTS_DataGuarantee object
''' </summary>
''' <param name="fileName">string xml file to load and deserialize</param>
''' <param name="obj">Output VERAG_out_nctsNCTS_DataGarantee object</param>
''' <param name="obj">Output VERAG_out_nctsNCTS_DataGuarantee 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 VERAG_out_nctsNCTS_DataGarantee, ByRef exception As System.Exception) As Boolean
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As VERAG_out_nctsNCTS_DataGuarantee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, VERAG_out_nctsNCTS_DataGarantee)
obj = CType(Nothing, VERAG_out_nctsNCTS_DataGuarantee)
Try
obj = LoadFromFile(fileName)
Return True
@@ -2447,12 +2460,12 @@ Namespace VERAG_OUT_NCTS
End Try
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As VERAG_out_nctsNCTS_DataGarantee) As Boolean
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As VERAG_out_nctsNCTS_DataGuarantee) 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 VERAG_out_nctsNCTS_DataGarantee
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As VERAG_out_nctsNCTS_DataGuarantee
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
@@ -2693,4 +2706,238 @@ Namespace VERAG_OUT_NCTS
End Try
End Function
End Class
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
System.SerializableAttribute(),
System.Diagnostics.DebuggerStepThroughAttribute(),
System.ComponentModel.DesignerCategoryAttribute("code"),
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
Partial Public Class VERAG_out_nctsAttachment
#Region "Private fields"
Private _name As Object
Private _fileType As Object
Private _description As Object
Private _documentType As VERAG_out_nctsAttachmentDocumentType
Private _base64BinaryStream() As Byte
Private Shared sSerializer As XmlSerializer
#End Region
Public Property Name() As Object
Get
Return Me._name
End Get
Set
Me._name = Value
End Set
End Property
Public Property FileType() As Object
Get
Return Me._fileType
End Get
Set
Me._fileType = Value
End Set
End Property
Public Property Description() As Object
Get
Return Me._description
End Get
Set
Me._description = Value
End Set
End Property
Public Property DocumentType() As VERAG_out_nctsAttachmentDocumentType
Get
Return Me._documentType
End Get
Set
Me._documentType = Value
End Set
End Property
<System.Xml.Serialization.XmlElementAttribute(DataType:="base64Binary")>
Public Property base64BinaryStream() As Byte()
Get
Return Me._base64BinaryStream
End Get
Set
Me._base64BinaryStream = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(VERAG_out_nctsAttachment))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
''' <summary>
''' Serializes current VERAG_out_nctsAttachment object into an XML string
''' </summary>
''' <returns>string XML value</returns>
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.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 workflow markup into an VERAG_out_nctsAttachment object
''' </summary>
''' <param name="input">string workflow markup to deserialize</param>
''' <param name="obj">Output VERAG_out_nctsAttachment 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 VERAG_out_nctsAttachment, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, VERAG_out_nctsAttachment)
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 VERAG_out_nctsAttachment) 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 VERAG_out_nctsAttachment
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), VERAG_out_nctsAttachment)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As VERAG_out_nctsAttachment
Return CType(Serializer.Deserialize(s), VERAG_out_nctsAttachment)
End Function
#End Region
''' <summary>
''' Serializes current VERAG_out_nctsAttachment 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 System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
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 VERAG_out_nctsAttachment object
''' </summary>
''' <param name="fileName">string xml file to load and deserialize</param>
''' <param name="obj">Output VERAG_out_nctsAttachment 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 VERAG_out_nctsAttachment, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, VERAG_out_nctsAttachment)
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 VERAG_out_nctsAttachment) 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 VERAG_out_nctsAttachment
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
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.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
System.SerializableAttribute(),
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
Public Enum VERAG_out_nctsAttachmentDocumentType
'''<remarks/>
NCTS
'''<remarks/>
OTHER
End Enum
End Namespace

View File

@@ -4,7 +4,7 @@
<xs:element name="VERAG_out_ncts">
<xs:complexType>
<xs:sequence>
<xs:element name="Version" default="1.0.2"/>
<xs:element name="Version" default="2.0.0"/>
<xs:element name="Company"/>
<xs:element name="Department" minOccurs="0"/>
<xs:element name="InternalReference" minOccurs="0">
@@ -99,7 +99,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Garantee" minOccurs="0">
<xs:element name="Guarantee" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="GRN"/>
@@ -128,6 +128,30 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Attachments" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Attachment" minOccurs="0" maxOccurs="999">
<xs:complexType>
<xs:sequence>
<xs:element name="Name"/>
<xs:element name="FileType"/>
<xs:element name="Description"/>
<xs:element name="DocumentType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="NCTS"/>
<xs:enumeration value="OTHER"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="base64BinaryStream" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>