12839 lines
507 KiB
VB.net
12839 lines
507 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
|
|
'' {"TargetFramework":"Net48","NameSpace":"Factur_X_1_07_2_EN16931","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 Factur_X_1_07_2_EN16931
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"),
|
|
XmlRoot("CrossIndustryInvoice", [Namespace]:="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100", IsNullable:=False)>
|
|
Partial Public Class CrossIndustryInvoiceType
|
|
|
|
#Region "Private fields"
|
|
Private _exchangedDocumentContext As ExchangedDocumentContextType
|
|
|
|
Private _exchangedDocument As ExchangedDocumentType
|
|
|
|
Private _supplyChainTradeTransaction As SupplyChainTradeTransactionType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._supplyChainTradeTransaction = New SupplyChainTradeTransactionType()
|
|
Me._exchangedDocument = New ExchangedDocumentType()
|
|
Me._exchangedDocumentContext = New ExchangedDocumentContextType()
|
|
End Sub
|
|
|
|
Public Property ExchangedDocumentContext() As ExchangedDocumentContextType
|
|
Get
|
|
Return Me._exchangedDocumentContext
|
|
End Get
|
|
Set
|
|
Me._exchangedDocumentContext = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ExchangedDocument() As ExchangedDocumentType
|
|
Get
|
|
Return Me._exchangedDocument
|
|
End Get
|
|
Set
|
|
Me._exchangedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SupplyChainTradeTransaction() As SupplyChainTradeTransactionType
|
|
Get
|
|
Return Me._supplyChainTradeTransaction
|
|
End Get
|
|
Set
|
|
Me._supplyChainTradeTransaction = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CrossIndustryInvoiceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CrossIndustryInvoiceType 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 CrossIndustryInvoiceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CrossIndustryInvoiceType 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 CrossIndustryInvoiceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CrossIndustryInvoiceType)
|
|
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 CrossIndustryInvoiceType) 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 CrossIndustryInvoiceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CrossIndustryInvoiceType)
|
|
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 CrossIndustryInvoiceType
|
|
Return CType(SerializerXml.Deserialize(s), CrossIndustryInvoiceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CrossIndustryInvoiceType 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 CrossIndustryInvoiceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CrossIndustryInvoiceType 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 CrossIndustryInvoiceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CrossIndustryInvoiceType)
|
|
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 CrossIndustryInvoiceType) 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 CrossIndustryInvoiceType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ExchangedDocumentContextType
|
|
|
|
#Region "Private fields"
|
|
Private _businessProcessSpecifiedDocumentContextParameter As DocumentContextParameterType
|
|
|
|
Private _guidelineSpecifiedDocumentContextParameter As DocumentContextParameterType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._guidelineSpecifiedDocumentContextParameter = New DocumentContextParameterType()
|
|
Me._businessProcessSpecifiedDocumentContextParameter = New DocumentContextParameterType()
|
|
End Sub
|
|
|
|
Public Property BusinessProcessSpecifiedDocumentContextParameter() As DocumentContextParameterType
|
|
Get
|
|
Return Me._businessProcessSpecifiedDocumentContextParameter
|
|
End Get
|
|
Set
|
|
Me._businessProcessSpecifiedDocumentContextParameter = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property GuidelineSpecifiedDocumentContextParameter() As DocumentContextParameterType
|
|
Get
|
|
Return Me._guidelineSpecifiedDocumentContextParameter
|
|
End Get
|
|
Set
|
|
Me._guidelineSpecifiedDocumentContextParameter = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ExchangedDocumentContextType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ExchangedDocumentContextType 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 ExchangedDocumentContextType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ExchangedDocumentContextType 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 ExchangedDocumentContextType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ExchangedDocumentContextType)
|
|
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 ExchangedDocumentContextType) 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 ExchangedDocumentContextType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ExchangedDocumentContextType)
|
|
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 ExchangedDocumentContextType
|
|
Return CType(SerializerXml.Deserialize(s), ExchangedDocumentContextType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ExchangedDocumentContextType 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 ExchangedDocumentContextType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ExchangedDocumentContextType 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 ExchangedDocumentContextType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ExchangedDocumentContextType)
|
|
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 ExchangedDocumentContextType) 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 ExchangedDocumentContextType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class DocumentContextParameterType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DocumentContextParameterType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DocumentContextParameterType 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 DocumentContextParameterType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DocumentContextParameterType 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 DocumentContextParameterType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentContextParameterType)
|
|
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 DocumentContextParameterType) 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 DocumentContextParameterType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DocumentContextParameterType)
|
|
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 DocumentContextParameterType
|
|
Return CType(SerializerXml.Deserialize(s), DocumentContextParameterType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DocumentContextParameterType 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 DocumentContextParameterType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DocumentContextParameterType 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 DocumentContextParameterType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentContextParameterType)
|
|
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 DocumentContextParameterType) 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 DocumentContextParameterType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class IDType
|
|
|
|
#Region "Private fields"
|
|
Private _schemeID As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property schemeID() As String
|
|
Get
|
|
Return Me._schemeID
|
|
End Get
|
|
Set
|
|
Me._schemeID = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IDType 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 IDType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IDType 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 IDType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IDType)
|
|
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 IDType) 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 IDType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDType)
|
|
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 IDType
|
|
Return CType(SerializerXml.Deserialize(s), IDType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IDType 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 IDType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IDType 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 IDType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IDType)
|
|
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 IDType) 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 IDType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeSettlementHeaderMonetarySummationType
|
|
|
|
#Region "Private fields"
|
|
Private _lineTotalAmount As AmountType
|
|
|
|
Private _chargeTotalAmount As AmountType
|
|
|
|
Private _allowanceTotalAmount As AmountType
|
|
|
|
Private _taxBasisTotalAmount As AmountType
|
|
|
|
Private _taxTotalAmount As List(Of AmountType)
|
|
|
|
Private _roundingAmount As AmountType
|
|
|
|
Private _grandTotalAmount As AmountType
|
|
|
|
Private _totalPrepaidAmount As AmountType
|
|
|
|
Private _duePayableAmount As AmountType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._duePayableAmount = New AmountType()
|
|
Me._totalPrepaidAmount = New AmountType()
|
|
Me._grandTotalAmount = New AmountType()
|
|
Me._roundingAmount = New AmountType()
|
|
Me._taxTotalAmount = New List(Of AmountType)()
|
|
Me._taxBasisTotalAmount = New AmountType()
|
|
Me._allowanceTotalAmount = New AmountType()
|
|
Me._chargeTotalAmount = New AmountType()
|
|
Me._lineTotalAmount = New AmountType()
|
|
End Sub
|
|
|
|
Public Property LineTotalAmount() As AmountType
|
|
Get
|
|
Return Me._lineTotalAmount
|
|
End Get
|
|
Set
|
|
Me._lineTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ChargeTotalAmount() As AmountType
|
|
Get
|
|
Return Me._chargeTotalAmount
|
|
End Get
|
|
Set
|
|
Me._chargeTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AllowanceTotalAmount() As AmountType
|
|
Get
|
|
Return Me._allowanceTotalAmount
|
|
End Get
|
|
Set
|
|
Me._allowanceTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TaxBasisTotalAmount() As AmountType
|
|
Get
|
|
Return Me._taxBasisTotalAmount
|
|
End Get
|
|
Set
|
|
Me._taxBasisTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("TaxTotalAmount")>
|
|
Public Property TaxTotalAmount() As List(Of AmountType)
|
|
Get
|
|
Return Me._taxTotalAmount
|
|
End Get
|
|
Set
|
|
Me._taxTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property RoundingAmount() As AmountType
|
|
Get
|
|
Return Me._roundingAmount
|
|
End Get
|
|
Set
|
|
Me._roundingAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property GrandTotalAmount() As AmountType
|
|
Get
|
|
Return Me._grandTotalAmount
|
|
End Get
|
|
Set
|
|
Me._grandTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TotalPrepaidAmount() As AmountType
|
|
Get
|
|
Return Me._totalPrepaidAmount
|
|
End Get
|
|
Set
|
|
Me._totalPrepaidAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DuePayableAmount() As AmountType
|
|
Get
|
|
Return Me._duePayableAmount
|
|
End Get
|
|
Set
|
|
Me._duePayableAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeSettlementHeaderMonetarySummationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeSettlementHeaderMonetarySummationType 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 TradeSettlementHeaderMonetarySummationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementHeaderMonetarySummationType 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 TradeSettlementHeaderMonetarySummationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementHeaderMonetarySummationType)
|
|
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 TradeSettlementHeaderMonetarySummationType) 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 TradeSettlementHeaderMonetarySummationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeSettlementHeaderMonetarySummationType)
|
|
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 TradeSettlementHeaderMonetarySummationType
|
|
Return CType(SerializerXml.Deserialize(s), TradeSettlementHeaderMonetarySummationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeSettlementHeaderMonetarySummationType 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 TradeSettlementHeaderMonetarySummationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementHeaderMonetarySummationType 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 TradeSettlementHeaderMonetarySummationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementHeaderMonetarySummationType)
|
|
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 TradeSettlementHeaderMonetarySummationType) 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 TradeSettlementHeaderMonetarySummationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class AmountType
|
|
|
|
#Region "Private fields"
|
|
Private _currencyID As String
|
|
|
|
Private _value As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property currencyID() As String
|
|
Get
|
|
Return Me._currencyID
|
|
End Get
|
|
Set
|
|
Me._currencyID = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlText>
|
|
Public Property Value() As Decimal
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AmountType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AmountType 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 AmountType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AmountType 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 AmountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AmountType)
|
|
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 AmountType) 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 AmountType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AmountType)
|
|
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 AmountType
|
|
Return CType(SerializerXml.Deserialize(s), AmountType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AmountType 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 AmountType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AmountType 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 AmountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AmountType)
|
|
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 AmountType) 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 AmountType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradePaymentTermsType
|
|
|
|
#Region "Private fields"
|
|
Private _description As TextType
|
|
|
|
Private _dueDateDateTime As DateTimeType
|
|
|
|
Private _directDebitMandateID As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._directDebitMandateID = New IDType()
|
|
Me._dueDateDateTime = New DateTimeType()
|
|
Me._description = New TextType()
|
|
End Sub
|
|
|
|
Public Property Description() As TextType
|
|
Get
|
|
Return Me._description
|
|
End Get
|
|
Set
|
|
Me._description = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DueDateDateTime() As DateTimeType
|
|
Get
|
|
Return Me._dueDateDateTime
|
|
End Get
|
|
Set
|
|
Me._dueDateDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DirectDebitMandateID() As IDType
|
|
Get
|
|
Return Me._directDebitMandateID
|
|
End Get
|
|
Set
|
|
Me._directDebitMandateID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradePaymentTermsType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradePaymentTermsType 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 TradePaymentTermsType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradePaymentTermsType 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 TradePaymentTermsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePaymentTermsType)
|
|
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 TradePaymentTermsType) 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 TradePaymentTermsType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradePaymentTermsType)
|
|
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 TradePaymentTermsType
|
|
Return CType(SerializerXml.Deserialize(s), TradePaymentTermsType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradePaymentTermsType 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 TradePaymentTermsType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradePaymentTermsType 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 TradePaymentTermsType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePaymentTermsType)
|
|
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 TradePaymentTermsType) 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 TradePaymentTermsType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class TextType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlText>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TextType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TextType 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 TextType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TextType 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 TextType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TextType)
|
|
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 TextType) 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 TextType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TextType)
|
|
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 TextType
|
|
Return CType(SerializerXml.Deserialize(s), TextType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TextType 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 TextType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TextType 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 TextType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TextType)
|
|
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 TextType) 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 TextType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class DateTimeType
|
|
|
|
#Region "Private fields"
|
|
Private _item As DateTimeTypeDateTimeString
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._item = New DateTimeTypeDateTimeString()
|
|
End Sub
|
|
|
|
<XmlElement("DateTimeString")>
|
|
Public Property Item() As DateTimeTypeDateTimeString
|
|
Get
|
|
Return Me._item
|
|
End Get
|
|
Set
|
|
Me._item = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DateTimeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DateTimeType 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 DateTimeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DateTimeType 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 DateTimeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTimeType)
|
|
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 DateTimeType) 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 DateTimeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DateTimeType)
|
|
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 DateTimeType
|
|
Return CType(SerializerXml.Deserialize(s), DateTimeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DateTimeType 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 DateTimeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DateTimeType 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 DateTimeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTimeType)
|
|
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 DateTimeType) 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 DateTimeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class DateTimeTypeDateTimeString
|
|
|
|
#Region "Private fields"
|
|
Private _format As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute>
|
|
Public Property format() As String
|
|
Get
|
|
Return Me._format
|
|
End Get
|
|
Set
|
|
Me._format = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlText>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DateTimeTypeDateTimeString))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DateTimeTypeDateTimeString 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 DateTimeTypeDateTimeString object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DateTimeTypeDateTimeString 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 DateTimeTypeDateTimeString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTimeTypeDateTimeString)
|
|
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 DateTimeTypeDateTimeString) 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 DateTimeTypeDateTimeString
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DateTimeTypeDateTimeString)
|
|
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 DateTimeTypeDateTimeString
|
|
Return CType(SerializerXml.Deserialize(s), DateTimeTypeDateTimeString)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DateTimeTypeDateTimeString 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 DateTimeTypeDateTimeString object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DateTimeTypeDateTimeString 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 DateTimeTypeDateTimeString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTimeTypeDateTimeString)
|
|
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 DateTimeTypeDateTimeString) 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 DateTimeTypeDateTimeString
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class CreditorFinancialInstitutionType
|
|
|
|
#Region "Private fields"
|
|
Private _bICID As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._bICID = New IDType()
|
|
End Sub
|
|
|
|
Public Property BICID() As IDType
|
|
Get
|
|
Return Me._bICID
|
|
End Get
|
|
Set
|
|
Me._bICID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CreditorFinancialInstitutionType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CreditorFinancialInstitutionType 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 CreditorFinancialInstitutionType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CreditorFinancialInstitutionType 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 CreditorFinancialInstitutionType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CreditorFinancialInstitutionType)
|
|
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 CreditorFinancialInstitutionType) 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 CreditorFinancialInstitutionType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CreditorFinancialInstitutionType)
|
|
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 CreditorFinancialInstitutionType
|
|
Return CType(SerializerXml.Deserialize(s), CreditorFinancialInstitutionType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CreditorFinancialInstitutionType 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 CreditorFinancialInstitutionType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CreditorFinancialInstitutionType 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 CreditorFinancialInstitutionType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CreditorFinancialInstitutionType)
|
|
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 CreditorFinancialInstitutionType) 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 CreditorFinancialInstitutionType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class CreditorFinancialAccountType
|
|
|
|
#Region "Private fields"
|
|
Private _iBANID As IDType
|
|
|
|
Private _accountName As TextType
|
|
|
|
Private _proprietaryID As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._proprietaryID = New IDType()
|
|
Me._accountName = New TextType()
|
|
Me._iBANID = New IDType()
|
|
End Sub
|
|
|
|
Public Property IBANID() As IDType
|
|
Get
|
|
Return Me._iBANID
|
|
End Get
|
|
Set
|
|
Me._iBANID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AccountName() As TextType
|
|
Get
|
|
Return Me._accountName
|
|
End Get
|
|
Set
|
|
Me._accountName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ProprietaryID() As IDType
|
|
Get
|
|
Return Me._proprietaryID
|
|
End Get
|
|
Set
|
|
Me._proprietaryID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CreditorFinancialAccountType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CreditorFinancialAccountType 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 CreditorFinancialAccountType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CreditorFinancialAccountType 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 CreditorFinancialAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CreditorFinancialAccountType)
|
|
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 CreditorFinancialAccountType) 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 CreditorFinancialAccountType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CreditorFinancialAccountType)
|
|
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 CreditorFinancialAccountType
|
|
Return CType(SerializerXml.Deserialize(s), CreditorFinancialAccountType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CreditorFinancialAccountType 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 CreditorFinancialAccountType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CreditorFinancialAccountType 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 CreditorFinancialAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CreditorFinancialAccountType)
|
|
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 CreditorFinancialAccountType) 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 CreditorFinancialAccountType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class DebtorFinancialAccountType
|
|
|
|
#Region "Private fields"
|
|
Private _iBANID As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._iBANID = New IDType()
|
|
End Sub
|
|
|
|
Public Property IBANID() As IDType
|
|
Get
|
|
Return Me._iBANID
|
|
End Get
|
|
Set
|
|
Me._iBANID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DebtorFinancialAccountType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DebtorFinancialAccountType 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 DebtorFinancialAccountType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DebtorFinancialAccountType 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 DebtorFinancialAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DebtorFinancialAccountType)
|
|
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 DebtorFinancialAccountType) 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 DebtorFinancialAccountType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DebtorFinancialAccountType)
|
|
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 DebtorFinancialAccountType
|
|
Return CType(SerializerXml.Deserialize(s), DebtorFinancialAccountType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DebtorFinancialAccountType 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 DebtorFinancialAccountType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DebtorFinancialAccountType 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 DebtorFinancialAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DebtorFinancialAccountType)
|
|
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 DebtorFinancialAccountType) 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 DebtorFinancialAccountType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeSettlementFinancialCardType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private _cardholderName As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._cardholderName = New TextType()
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CardholderName() As TextType
|
|
Get
|
|
Return Me._cardholderName
|
|
End Get
|
|
Set
|
|
Me._cardholderName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeSettlementFinancialCardType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeSettlementFinancialCardType 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 TradeSettlementFinancialCardType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementFinancialCardType 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 TradeSettlementFinancialCardType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementFinancialCardType)
|
|
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 TradeSettlementFinancialCardType) 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 TradeSettlementFinancialCardType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeSettlementFinancialCardType)
|
|
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 TradeSettlementFinancialCardType
|
|
Return CType(SerializerXml.Deserialize(s), TradeSettlementFinancialCardType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeSettlementFinancialCardType 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 TradeSettlementFinancialCardType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementFinancialCardType 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 TradeSettlementFinancialCardType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementFinancialCardType)
|
|
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 TradeSettlementFinancialCardType) 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 TradeSettlementFinancialCardType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class PaymentMeansCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PaymentMeansCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize PaymentMeansCodeType 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 PaymentMeansCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output PaymentMeansCodeType 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 PaymentMeansCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PaymentMeansCodeType)
|
|
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 PaymentMeansCodeType) 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 PaymentMeansCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PaymentMeansCodeType)
|
|
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 PaymentMeansCodeType
|
|
Return CType(SerializerXml.Deserialize(s), PaymentMeansCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current PaymentMeansCodeType 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 PaymentMeansCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output PaymentMeansCodeType 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 PaymentMeansCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PaymentMeansCodeType)
|
|
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 PaymentMeansCodeType) 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 PaymentMeansCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeSettlementPaymentMeansType
|
|
|
|
#Region "Private fields"
|
|
Private _typeCode As PaymentMeansCodeType
|
|
|
|
Private _information As TextType
|
|
|
|
Private _applicableTradeSettlementFinancialCard As TradeSettlementFinancialCardType
|
|
|
|
Private _payerPartyDebtorFinancialAccount As DebtorFinancialAccountType
|
|
|
|
Private _payeePartyCreditorFinancialAccount As CreditorFinancialAccountType
|
|
|
|
Private _payeeSpecifiedCreditorFinancialInstitution As CreditorFinancialInstitutionType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._payeeSpecifiedCreditorFinancialInstitution = New CreditorFinancialInstitutionType()
|
|
Me._payeePartyCreditorFinancialAccount = New CreditorFinancialAccountType()
|
|
Me._payerPartyDebtorFinancialAccount = New DebtorFinancialAccountType()
|
|
Me._applicableTradeSettlementFinancialCard = New TradeSettlementFinancialCardType()
|
|
Me._information = New TextType()
|
|
Me._typeCode = New PaymentMeansCodeType()
|
|
End Sub
|
|
|
|
Public Property TypeCode() As PaymentMeansCodeType
|
|
Get
|
|
Return Me._typeCode
|
|
End Get
|
|
Set
|
|
Me._typeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Information() As TextType
|
|
Get
|
|
Return Me._information
|
|
End Get
|
|
Set
|
|
Me._information = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ApplicableTradeSettlementFinancialCard() As TradeSettlementFinancialCardType
|
|
Get
|
|
Return Me._applicableTradeSettlementFinancialCard
|
|
End Get
|
|
Set
|
|
Me._applicableTradeSettlementFinancialCard = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PayerPartyDebtorFinancialAccount() As DebtorFinancialAccountType
|
|
Get
|
|
Return Me._payerPartyDebtorFinancialAccount
|
|
End Get
|
|
Set
|
|
Me._payerPartyDebtorFinancialAccount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PayeePartyCreditorFinancialAccount() As CreditorFinancialAccountType
|
|
Get
|
|
Return Me._payeePartyCreditorFinancialAccount
|
|
End Get
|
|
Set
|
|
Me._payeePartyCreditorFinancialAccount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PayeeSpecifiedCreditorFinancialInstitution() As CreditorFinancialInstitutionType
|
|
Get
|
|
Return Me._payeeSpecifiedCreditorFinancialInstitution
|
|
End Get
|
|
Set
|
|
Me._payeeSpecifiedCreditorFinancialInstitution = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeSettlementPaymentMeansType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeSettlementPaymentMeansType 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 TradeSettlementPaymentMeansType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementPaymentMeansType 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 TradeSettlementPaymentMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementPaymentMeansType)
|
|
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 TradeSettlementPaymentMeansType) 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 TradeSettlementPaymentMeansType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeSettlementPaymentMeansType)
|
|
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 TradeSettlementPaymentMeansType
|
|
Return CType(SerializerXml.Deserialize(s), TradeSettlementPaymentMeansType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeSettlementPaymentMeansType 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 TradeSettlementPaymentMeansType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementPaymentMeansType 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 TradeSettlementPaymentMeansType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementPaymentMeansType)
|
|
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 TradeSettlementPaymentMeansType) 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 TradeSettlementPaymentMeansType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class CurrencyCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CurrencyCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CurrencyCodeType 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 CurrencyCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CurrencyCodeType 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 CurrencyCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CurrencyCodeType)
|
|
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 CurrencyCodeType) 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 CurrencyCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CurrencyCodeType)
|
|
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 CurrencyCodeType
|
|
Return CType(SerializerXml.Deserialize(s), CurrencyCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CurrencyCodeType 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 CurrencyCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CurrencyCodeType 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 CurrencyCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CurrencyCodeType)
|
|
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 CurrencyCodeType) 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 CurrencyCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class HeaderTradeSettlementType
|
|
|
|
#Region "Private fields"
|
|
Private _creditorReferenceID As IDType
|
|
|
|
Private _paymentReference As TextType
|
|
|
|
Private _taxCurrencyCode As CurrencyCodeType
|
|
|
|
Private _invoiceCurrencyCode As CurrencyCodeType
|
|
|
|
Private _payeeTradeParty As TradePartyType
|
|
|
|
Private _specifiedTradeSettlementPaymentMeans As List(Of TradeSettlementPaymentMeansType)
|
|
|
|
Private _applicableTradeTax As List(Of TradeTaxType)
|
|
|
|
Private _billingSpecifiedPeriod As SpecifiedPeriodType
|
|
|
|
Private _specifiedTradeAllowanceCharge As List(Of TradeAllowanceChargeType)
|
|
|
|
Private _specifiedTradePaymentTerms As TradePaymentTermsType
|
|
|
|
Private _specifiedTradeSettlementHeaderMonetarySummation As TradeSettlementHeaderMonetarySummationType
|
|
|
|
Private _invoiceReferencedDocument As List(Of ReferencedDocumentType)
|
|
|
|
Private _receivableSpecifiedTradeAccountingAccount As TradeAccountingAccountType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._receivableSpecifiedTradeAccountingAccount = New TradeAccountingAccountType()
|
|
Me._invoiceReferencedDocument = New List(Of ReferencedDocumentType)()
|
|
Me._specifiedTradeSettlementHeaderMonetarySummation = New TradeSettlementHeaderMonetarySummationType()
|
|
Me._specifiedTradePaymentTerms = New TradePaymentTermsType()
|
|
Me._specifiedTradeAllowanceCharge = New List(Of TradeAllowanceChargeType)()
|
|
Me._billingSpecifiedPeriod = New SpecifiedPeriodType()
|
|
Me._applicableTradeTax = New List(Of TradeTaxType)()
|
|
Me._specifiedTradeSettlementPaymentMeans = New List(Of TradeSettlementPaymentMeansType)()
|
|
Me._payeeTradeParty = New TradePartyType()
|
|
Me._invoiceCurrencyCode = New CurrencyCodeType()
|
|
Me._taxCurrencyCode = New CurrencyCodeType()
|
|
Me._paymentReference = New TextType()
|
|
Me._creditorReferenceID = New IDType()
|
|
End Sub
|
|
|
|
Public Property CreditorReferenceID() As IDType
|
|
Get
|
|
Return Me._creditorReferenceID
|
|
End Get
|
|
Set
|
|
Me._creditorReferenceID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PaymentReference() As TextType
|
|
Get
|
|
Return Me._paymentReference
|
|
End Get
|
|
Set
|
|
Me._paymentReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TaxCurrencyCode() As CurrencyCodeType
|
|
Get
|
|
Return Me._taxCurrencyCode
|
|
End Get
|
|
Set
|
|
Me._taxCurrencyCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InvoiceCurrencyCode() As CurrencyCodeType
|
|
Get
|
|
Return Me._invoiceCurrencyCode
|
|
End Get
|
|
Set
|
|
Me._invoiceCurrencyCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PayeeTradeParty() As TradePartyType
|
|
Get
|
|
Return Me._payeeTradeParty
|
|
End Get
|
|
Set
|
|
Me._payeeTradeParty = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("SpecifiedTradeSettlementPaymentMeans")>
|
|
Public Property SpecifiedTradeSettlementPaymentMeans() As List(Of TradeSettlementPaymentMeansType)
|
|
Get
|
|
Return Me._specifiedTradeSettlementPaymentMeans
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeSettlementPaymentMeans = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("ApplicableTradeTax")>
|
|
Public Property ApplicableTradeTax() As List(Of TradeTaxType)
|
|
Get
|
|
Return Me._applicableTradeTax
|
|
End Get
|
|
Set
|
|
Me._applicableTradeTax = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BillingSpecifiedPeriod() As SpecifiedPeriodType
|
|
Get
|
|
Return Me._billingSpecifiedPeriod
|
|
End Get
|
|
Set
|
|
Me._billingSpecifiedPeriod = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("SpecifiedTradeAllowanceCharge")>
|
|
Public Property SpecifiedTradeAllowanceCharge() As List(Of TradeAllowanceChargeType)
|
|
Get
|
|
Return Me._specifiedTradeAllowanceCharge
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeAllowanceCharge = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedTradePaymentTerms() As TradePaymentTermsType
|
|
Get
|
|
Return Me._specifiedTradePaymentTerms
|
|
End Get
|
|
Set
|
|
Me._specifiedTradePaymentTerms = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedTradeSettlementHeaderMonetarySummation() As TradeSettlementHeaderMonetarySummationType
|
|
Get
|
|
Return Me._specifiedTradeSettlementHeaderMonetarySummation
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeSettlementHeaderMonetarySummation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("InvoiceReferencedDocument")>
|
|
Public Property InvoiceReferencedDocument() As List(Of ReferencedDocumentType)
|
|
Get
|
|
Return Me._invoiceReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._invoiceReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReceivableSpecifiedTradeAccountingAccount() As TradeAccountingAccountType
|
|
Get
|
|
Return Me._receivableSpecifiedTradeAccountingAccount
|
|
End Get
|
|
Set
|
|
Me._receivableSpecifiedTradeAccountingAccount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HeaderTradeSettlementType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize HeaderTradeSettlementType 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 HeaderTradeSettlementType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeSettlementType 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 HeaderTradeSettlementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeSettlementType)
|
|
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 HeaderTradeSettlementType) 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 HeaderTradeSettlementType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HeaderTradeSettlementType)
|
|
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 HeaderTradeSettlementType
|
|
Return CType(SerializerXml.Deserialize(s), HeaderTradeSettlementType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current HeaderTradeSettlementType 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 HeaderTradeSettlementType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeSettlementType 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 HeaderTradeSettlementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeSettlementType)
|
|
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 HeaderTradeSettlementType) 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 HeaderTradeSettlementType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradePartyType
|
|
|
|
#Region "Private fields"
|
|
Private _id As List(Of IDType)
|
|
|
|
Private _globalID As List(Of IDType)
|
|
|
|
Private _name As TextType
|
|
|
|
Private _description As TextType
|
|
|
|
Private _specifiedLegalOrganization As LegalOrganizationType
|
|
|
|
Private _definedTradeContact As TradeContactType
|
|
|
|
Private _postalTradeAddress As TradeAddressType
|
|
|
|
Private _uRIUniversalCommunication As UniversalCommunicationType
|
|
|
|
Private _specifiedTaxRegistration As List(Of TaxRegistrationType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._specifiedTaxRegistration = New List(Of TaxRegistrationType)()
|
|
Me._uRIUniversalCommunication = New UniversalCommunicationType()
|
|
Me._postalTradeAddress = New TradeAddressType()
|
|
Me._definedTradeContact = New TradeContactType()
|
|
Me._specifiedLegalOrganization = New LegalOrganizationType()
|
|
Me._description = New TextType()
|
|
Me._name = New TextType()
|
|
Me._globalID = New List(Of IDType)()
|
|
Me._id = New List(Of IDType)()
|
|
End Sub
|
|
|
|
<XmlElement("ID")>
|
|
Public Property ID() As List(Of IDType)
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("GlobalID")>
|
|
Public Property GlobalID() As List(Of IDType)
|
|
Get
|
|
Return Me._globalID
|
|
End Get
|
|
Set
|
|
Me._globalID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Name() As TextType
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Description() As TextType
|
|
Get
|
|
Return Me._description
|
|
End Get
|
|
Set
|
|
Me._description = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedLegalOrganization() As LegalOrganizationType
|
|
Get
|
|
Return Me._specifiedLegalOrganization
|
|
End Get
|
|
Set
|
|
Me._specifiedLegalOrganization = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DefinedTradeContact() As TradeContactType
|
|
Get
|
|
Return Me._definedTradeContact
|
|
End Get
|
|
Set
|
|
Me._definedTradeContact = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PostalTradeAddress() As TradeAddressType
|
|
Get
|
|
Return Me._postalTradeAddress
|
|
End Get
|
|
Set
|
|
Me._postalTradeAddress = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property URIUniversalCommunication() As UniversalCommunicationType
|
|
Get
|
|
Return Me._uRIUniversalCommunication
|
|
End Get
|
|
Set
|
|
Me._uRIUniversalCommunication = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("SpecifiedTaxRegistration")>
|
|
Public Property SpecifiedTaxRegistration() As List(Of TaxRegistrationType)
|
|
Get
|
|
Return Me._specifiedTaxRegistration
|
|
End Get
|
|
Set
|
|
Me._specifiedTaxRegistration = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradePartyType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradePartyType 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 TradePartyType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradePartyType 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 TradePartyType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePartyType)
|
|
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 TradePartyType) 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 TradePartyType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradePartyType)
|
|
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 TradePartyType
|
|
Return CType(SerializerXml.Deserialize(s), TradePartyType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradePartyType 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 TradePartyType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradePartyType 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 TradePartyType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePartyType)
|
|
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 TradePartyType) 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 TradePartyType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class LegalOrganizationType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private _tradingBusinessName As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._tradingBusinessName = New TextType()
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TradingBusinessName() As TextType
|
|
Get
|
|
Return Me._tradingBusinessName
|
|
End Get
|
|
Set
|
|
Me._tradingBusinessName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LegalOrganizationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LegalOrganizationType 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 LegalOrganizationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LegalOrganizationType 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 LegalOrganizationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LegalOrganizationType)
|
|
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 LegalOrganizationType) 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 LegalOrganizationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LegalOrganizationType)
|
|
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 LegalOrganizationType
|
|
Return CType(SerializerXml.Deserialize(s), LegalOrganizationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LegalOrganizationType 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 LegalOrganizationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LegalOrganizationType 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 LegalOrganizationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LegalOrganizationType)
|
|
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 LegalOrganizationType) 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 LegalOrganizationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeContactType
|
|
|
|
#Region "Private fields"
|
|
Private _personName As TextType
|
|
|
|
Private _departmentName As TextType
|
|
|
|
Private _telephoneUniversalCommunication As UniversalCommunicationType
|
|
|
|
Private _emailURIUniversalCommunication As UniversalCommunicationType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._emailURIUniversalCommunication = New UniversalCommunicationType()
|
|
Me._telephoneUniversalCommunication = New UniversalCommunicationType()
|
|
Me._departmentName = New TextType()
|
|
Me._personName = New TextType()
|
|
End Sub
|
|
|
|
Public Property PersonName() As TextType
|
|
Get
|
|
Return Me._personName
|
|
End Get
|
|
Set
|
|
Me._personName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DepartmentName() As TextType
|
|
Get
|
|
Return Me._departmentName
|
|
End Get
|
|
Set
|
|
Me._departmentName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TelephoneUniversalCommunication() As UniversalCommunicationType
|
|
Get
|
|
Return Me._telephoneUniversalCommunication
|
|
End Get
|
|
Set
|
|
Me._telephoneUniversalCommunication = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property EmailURIUniversalCommunication() As UniversalCommunicationType
|
|
Get
|
|
Return Me._emailURIUniversalCommunication
|
|
End Get
|
|
Set
|
|
Me._emailURIUniversalCommunication = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeContactType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeContactType 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 TradeContactType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeContactType 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 TradeContactType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeContactType)
|
|
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 TradeContactType) 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 TradeContactType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeContactType)
|
|
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 TradeContactType
|
|
Return CType(SerializerXml.Deserialize(s), TradeContactType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeContactType 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 TradeContactType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeContactType 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 TradeContactType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeContactType)
|
|
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 TradeContactType) 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 TradeContactType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class UniversalCommunicationType
|
|
|
|
#Region "Private fields"
|
|
Private _uRIID As IDType
|
|
|
|
Private _completeNumber As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._completeNumber = New TextType()
|
|
Me._uRIID = New IDType()
|
|
End Sub
|
|
|
|
Public Property URIID() As IDType
|
|
Get
|
|
Return Me._uRIID
|
|
End Get
|
|
Set
|
|
Me._uRIID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CompleteNumber() As TextType
|
|
Get
|
|
Return Me._completeNumber
|
|
End Get
|
|
Set
|
|
Me._completeNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(UniversalCommunicationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize UniversalCommunicationType 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 UniversalCommunicationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output UniversalCommunicationType 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 UniversalCommunicationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, UniversalCommunicationType)
|
|
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 UniversalCommunicationType) 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 UniversalCommunicationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), UniversalCommunicationType)
|
|
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 UniversalCommunicationType
|
|
Return CType(SerializerXml.Deserialize(s), UniversalCommunicationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current UniversalCommunicationType 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 UniversalCommunicationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output UniversalCommunicationType 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 UniversalCommunicationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, UniversalCommunicationType)
|
|
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 UniversalCommunicationType) 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 UniversalCommunicationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeAddressType
|
|
|
|
#Region "Private fields"
|
|
Private _postcodeCode As CodeType
|
|
|
|
Private _lineOne As TextType
|
|
|
|
Private _lineTwo As TextType
|
|
|
|
Private _lineThree As TextType
|
|
|
|
Private _cityName As TextType
|
|
|
|
Private _countryID As CountryIDType
|
|
|
|
Private _countrySubDivisionName As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._countrySubDivisionName = New TextType()
|
|
Me._countryID = New CountryIDType()
|
|
Me._cityName = New TextType()
|
|
Me._lineThree = New TextType()
|
|
Me._lineTwo = New TextType()
|
|
Me._lineOne = New TextType()
|
|
Me._postcodeCode = New CodeType()
|
|
End Sub
|
|
|
|
Public Property PostcodeCode() As CodeType
|
|
Get
|
|
Return Me._postcodeCode
|
|
End Get
|
|
Set
|
|
Me._postcodeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LineOne() As TextType
|
|
Get
|
|
Return Me._lineOne
|
|
End Get
|
|
Set
|
|
Me._lineOne = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LineTwo() As TextType
|
|
Get
|
|
Return Me._lineTwo
|
|
End Get
|
|
Set
|
|
Me._lineTwo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LineThree() As TextType
|
|
Get
|
|
Return Me._lineThree
|
|
End Get
|
|
Set
|
|
Me._lineThree = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CityName() As TextType
|
|
Get
|
|
Return Me._cityName
|
|
End Get
|
|
Set
|
|
Me._cityName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CountryID() As CountryIDType
|
|
Get
|
|
Return Me._countryID
|
|
End Get
|
|
Set
|
|
Me._countryID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CountrySubDivisionName() As TextType
|
|
Get
|
|
Return Me._countrySubDivisionName
|
|
End Get
|
|
Set
|
|
Me._countrySubDivisionName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeAddressType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeAddressType 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 TradeAddressType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeAddressType 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 TradeAddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAddressType)
|
|
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 TradeAddressType) 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 TradeAddressType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeAddressType)
|
|
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 TradeAddressType
|
|
Return CType(SerializerXml.Deserialize(s), TradeAddressType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeAddressType 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 TradeAddressType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeAddressType 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 TradeAddressType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAddressType)
|
|
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 TradeAddressType) 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 TradeAddressType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class CodeType
|
|
|
|
#Region "Private fields"
|
|
Private _listID As String
|
|
|
|
Private _listVersionID As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property listID() As String
|
|
Get
|
|
Return Me._listID
|
|
End Get
|
|
Set
|
|
Me._listID = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property listVersionID() As String
|
|
Get
|
|
Return Me._listVersionID
|
|
End Get
|
|
Set
|
|
Me._listVersionID = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CodeType 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 CodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CodeType 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 CodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CodeType)
|
|
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 CodeType) 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 CodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CodeType)
|
|
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 CodeType
|
|
Return CType(SerializerXml.Deserialize(s), CodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CodeType 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 CodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CodeType 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 CodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CodeType)
|
|
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 CodeType) 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 CodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class CountryIDType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CountryIDType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize CountryIDType 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 CountryIDType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output CountryIDType 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 CountryIDType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CountryIDType)
|
|
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 CountryIDType) 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 CountryIDType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CountryIDType)
|
|
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 CountryIDType
|
|
Return CType(SerializerXml.Deserialize(s), CountryIDType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current CountryIDType 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 CountryIDType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output CountryIDType 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 CountryIDType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, CountryIDType)
|
|
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 CountryIDType) 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 CountryIDType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TaxRegistrationType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TaxRegistrationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TaxRegistrationType 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 TaxRegistrationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TaxRegistrationType 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 TaxRegistrationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxRegistrationType)
|
|
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 TaxRegistrationType) 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 TaxRegistrationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TaxRegistrationType)
|
|
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 TaxRegistrationType
|
|
Return CType(SerializerXml.Deserialize(s), TaxRegistrationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TaxRegistrationType 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 TaxRegistrationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TaxRegistrationType 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 TaxRegistrationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxRegistrationType)
|
|
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 TaxRegistrationType) 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 TaxRegistrationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeTaxType
|
|
|
|
#Region "Private fields"
|
|
Private _calculatedAmount As AmountType
|
|
|
|
Private _typeCode As TaxTypeCodeType
|
|
|
|
Private _exemptionReason As TextType
|
|
|
|
Private _basisAmount As AmountType
|
|
|
|
Private _categoryCode As TaxCategoryCodeType
|
|
|
|
Private _exemptionReasonCode As CodeType
|
|
|
|
Private _taxPointDate As DateType
|
|
|
|
Private _dueDateTypeCode As TimeReferenceCodeType
|
|
|
|
Private _rateApplicablePercent As PercentType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._rateApplicablePercent = New PercentType()
|
|
Me._dueDateTypeCode = New TimeReferenceCodeType()
|
|
Me._taxPointDate = New DateType()
|
|
Me._exemptionReasonCode = New CodeType()
|
|
Me._categoryCode = New TaxCategoryCodeType()
|
|
Me._basisAmount = New AmountType()
|
|
Me._exemptionReason = New TextType()
|
|
Me._typeCode = New TaxTypeCodeType()
|
|
Me._calculatedAmount = New AmountType()
|
|
End Sub
|
|
|
|
Public Property CalculatedAmount() As AmountType
|
|
Get
|
|
Return Me._calculatedAmount
|
|
End Get
|
|
Set
|
|
Me._calculatedAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TypeCode() As TaxTypeCodeType
|
|
Get
|
|
Return Me._typeCode
|
|
End Get
|
|
Set
|
|
Me._typeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ExemptionReason() As TextType
|
|
Get
|
|
Return Me._exemptionReason
|
|
End Get
|
|
Set
|
|
Me._exemptionReason = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BasisAmount() As AmountType
|
|
Get
|
|
Return Me._basisAmount
|
|
End Get
|
|
Set
|
|
Me._basisAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CategoryCode() As TaxCategoryCodeType
|
|
Get
|
|
Return Me._categoryCode
|
|
End Get
|
|
Set
|
|
Me._categoryCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ExemptionReasonCode() As CodeType
|
|
Get
|
|
Return Me._exemptionReasonCode
|
|
End Get
|
|
Set
|
|
Me._exemptionReasonCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TaxPointDate() As DateType
|
|
Get
|
|
Return Me._taxPointDate
|
|
End Get
|
|
Set
|
|
Me._taxPointDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DueDateTypeCode() As TimeReferenceCodeType
|
|
Get
|
|
Return Me._dueDateTypeCode
|
|
End Get
|
|
Set
|
|
Me._dueDateTypeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property RateApplicablePercent() As PercentType
|
|
Get
|
|
Return Me._rateApplicablePercent
|
|
End Get
|
|
Set
|
|
Me._rateApplicablePercent = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeTaxType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeTaxType 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 TradeTaxType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeTaxType 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 TradeTaxType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeTaxType)
|
|
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 TradeTaxType) 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 TradeTaxType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeTaxType)
|
|
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 TradeTaxType
|
|
Return CType(SerializerXml.Deserialize(s), TradeTaxType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeTaxType 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 TradeTaxType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeTaxType 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 TradeTaxType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeTaxType)
|
|
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 TradeTaxType) 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 TradeTaxType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class TaxTypeCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TaxTypeCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TaxTypeCodeType 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 TaxTypeCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TaxTypeCodeType 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 TaxTypeCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxTypeCodeType)
|
|
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 TaxTypeCodeType) 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 TaxTypeCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TaxTypeCodeType)
|
|
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 TaxTypeCodeType
|
|
Return CType(SerializerXml.Deserialize(s), TaxTypeCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TaxTypeCodeType 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 TaxTypeCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TaxTypeCodeType 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 TaxTypeCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxTypeCodeType)
|
|
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 TaxTypeCodeType) 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 TaxTypeCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class TaxCategoryCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TaxCategoryCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TaxCategoryCodeType 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 TaxCategoryCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TaxCategoryCodeType 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 TaxCategoryCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxCategoryCodeType)
|
|
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 TaxCategoryCodeType) 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 TaxCategoryCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TaxCategoryCodeType)
|
|
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 TaxCategoryCodeType
|
|
Return CType(SerializerXml.Deserialize(s), TaxCategoryCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TaxCategoryCodeType 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 TaxCategoryCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TaxCategoryCodeType 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 TaxCategoryCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TaxCategoryCodeType)
|
|
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 TaxCategoryCodeType) 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 TaxCategoryCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class DateType
|
|
|
|
#Region "Private fields"
|
|
Private _item As DateTypeDateString
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._item = New DateTypeDateString()
|
|
End Sub
|
|
|
|
<XmlElement("DateString")>
|
|
Public Property Item() As DateTypeDateString
|
|
Get
|
|
Return Me._item
|
|
End Get
|
|
Set
|
|
Me._item = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DateType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DateType 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 DateType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DateType 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 DateType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateType)
|
|
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 DateType) 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 DateType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DateType)
|
|
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 DateType
|
|
Return CType(SerializerXml.Deserialize(s), DateType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DateType 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 DateType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DateType 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 DateType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateType)
|
|
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 DateType) 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 DateType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class DateTypeDateString
|
|
|
|
#Region "Private fields"
|
|
Private _format As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute>
|
|
Public Property format() As String
|
|
Get
|
|
Return Me._format
|
|
End Get
|
|
Set
|
|
Me._format = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlText>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DateTypeDateString))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DateTypeDateString 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 DateTypeDateString object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DateTypeDateString 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 DateTypeDateString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTypeDateString)
|
|
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 DateTypeDateString) 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 DateTypeDateString
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DateTypeDateString)
|
|
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 DateTypeDateString
|
|
Return CType(SerializerXml.Deserialize(s), DateTypeDateString)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DateTypeDateString 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 DateTypeDateString object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DateTypeDateString 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 DateTypeDateString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DateTypeDateString)
|
|
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 DateTypeDateString) 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 DateTypeDateString
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class TimeReferenceCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TimeReferenceCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TimeReferenceCodeType 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 TimeReferenceCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TimeReferenceCodeType 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 TimeReferenceCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TimeReferenceCodeType)
|
|
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 TimeReferenceCodeType) 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 TimeReferenceCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TimeReferenceCodeType)
|
|
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 TimeReferenceCodeType
|
|
Return CType(SerializerXml.Deserialize(s), TimeReferenceCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TimeReferenceCodeType 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 TimeReferenceCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TimeReferenceCodeType 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 TimeReferenceCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TimeReferenceCodeType)
|
|
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 TimeReferenceCodeType) 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 TimeReferenceCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class PercentType
|
|
|
|
#Region "Private fields"
|
|
Private _value As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlText>
|
|
Public Property Value() As Decimal
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PercentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize PercentType 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 PercentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output PercentType 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 PercentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PercentType)
|
|
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 PercentType) 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 PercentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PercentType)
|
|
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 PercentType
|
|
Return CType(SerializerXml.Deserialize(s), PercentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current PercentType 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 PercentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output PercentType 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 PercentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, PercentType)
|
|
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 PercentType) 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 PercentType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class SpecifiedPeriodType
|
|
|
|
#Region "Private fields"
|
|
Private _startDateTime As DateTimeType
|
|
|
|
Private _endDateTime As DateTimeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._endDateTime = New DateTimeType()
|
|
Me._startDateTime = New DateTimeType()
|
|
End Sub
|
|
|
|
Public Property StartDateTime() As DateTimeType
|
|
Get
|
|
Return Me._startDateTime
|
|
End Get
|
|
Set
|
|
Me._startDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property EndDateTime() As DateTimeType
|
|
Get
|
|
Return Me._endDateTime
|
|
End Get
|
|
Set
|
|
Me._endDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SpecifiedPeriodType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SpecifiedPeriodType 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 SpecifiedPeriodType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SpecifiedPeriodType 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 SpecifiedPeriodType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SpecifiedPeriodType)
|
|
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 SpecifiedPeriodType) 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 SpecifiedPeriodType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SpecifiedPeriodType)
|
|
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 SpecifiedPeriodType
|
|
Return CType(SerializerXml.Deserialize(s), SpecifiedPeriodType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SpecifiedPeriodType 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 SpecifiedPeriodType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SpecifiedPeriodType 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 SpecifiedPeriodType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SpecifiedPeriodType)
|
|
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 SpecifiedPeriodType) 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 SpecifiedPeriodType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeAllowanceChargeType
|
|
|
|
#Region "Private fields"
|
|
Private _chargeIndicator As IndicatorType
|
|
|
|
Private _calculationPercent As PercentType
|
|
|
|
Private _basisAmount As AmountType
|
|
|
|
Private _actualAmount As AmountType
|
|
|
|
Private _reasonCode As AllowanceChargeReasonCodeType
|
|
|
|
Private _reason As TextType
|
|
|
|
Private _categoryTradeTax As TradeTaxType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._categoryTradeTax = New TradeTaxType()
|
|
Me._reason = New TextType()
|
|
Me._reasonCode = New AllowanceChargeReasonCodeType()
|
|
Me._actualAmount = New AmountType()
|
|
Me._basisAmount = New AmountType()
|
|
Me._calculationPercent = New PercentType()
|
|
Me._chargeIndicator = New IndicatorType()
|
|
End Sub
|
|
|
|
Public Property ChargeIndicator() As IndicatorType
|
|
Get
|
|
Return Me._chargeIndicator
|
|
End Get
|
|
Set
|
|
Me._chargeIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CalculationPercent() As PercentType
|
|
Get
|
|
Return Me._calculationPercent
|
|
End Get
|
|
Set
|
|
Me._calculationPercent = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BasisAmount() As AmountType
|
|
Get
|
|
Return Me._basisAmount
|
|
End Get
|
|
Set
|
|
Me._basisAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ActualAmount() As AmountType
|
|
Get
|
|
Return Me._actualAmount
|
|
End Get
|
|
Set
|
|
Me._actualAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReasonCode() As AllowanceChargeReasonCodeType
|
|
Get
|
|
Return Me._reasonCode
|
|
End Get
|
|
Set
|
|
Me._reasonCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Reason() As TextType
|
|
Get
|
|
Return Me._reason
|
|
End Get
|
|
Set
|
|
Me._reason = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CategoryTradeTax() As TradeTaxType
|
|
Get
|
|
Return Me._categoryTradeTax
|
|
End Get
|
|
Set
|
|
Me._categoryTradeTax = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeAllowanceChargeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeAllowanceChargeType 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 TradeAllowanceChargeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeAllowanceChargeType 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 TradeAllowanceChargeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAllowanceChargeType)
|
|
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 TradeAllowanceChargeType) 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 TradeAllowanceChargeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeAllowanceChargeType)
|
|
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 TradeAllowanceChargeType
|
|
Return CType(SerializerXml.Deserialize(s), TradeAllowanceChargeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeAllowanceChargeType 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 TradeAllowanceChargeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeAllowanceChargeType 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 TradeAllowanceChargeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAllowanceChargeType)
|
|
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 TradeAllowanceChargeType) 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 TradeAllowanceChargeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class IndicatorType
|
|
|
|
#Region "Private fields"
|
|
Private _item As Boolean
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlElement("Indicator")>
|
|
Public Property Item() As Boolean
|
|
Get
|
|
Return Me._item
|
|
End Get
|
|
Set
|
|
Me._item = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IndicatorType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize IndicatorType 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 IndicatorType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output IndicatorType 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 IndicatorType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IndicatorType)
|
|
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 IndicatorType) 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 IndicatorType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IndicatorType)
|
|
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 IndicatorType
|
|
Return CType(SerializerXml.Deserialize(s), IndicatorType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current IndicatorType 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 IndicatorType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output IndicatorType 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 IndicatorType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, IndicatorType)
|
|
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 IndicatorType) 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 IndicatorType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class AllowanceChargeReasonCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AllowanceChargeReasonCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize AllowanceChargeReasonCodeType 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 AllowanceChargeReasonCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output AllowanceChargeReasonCodeType 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 AllowanceChargeReasonCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AllowanceChargeReasonCodeType)
|
|
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 AllowanceChargeReasonCodeType) 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 AllowanceChargeReasonCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AllowanceChargeReasonCodeType)
|
|
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 AllowanceChargeReasonCodeType
|
|
Return CType(SerializerXml.Deserialize(s), AllowanceChargeReasonCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current AllowanceChargeReasonCodeType 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 AllowanceChargeReasonCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output AllowanceChargeReasonCodeType 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 AllowanceChargeReasonCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, AllowanceChargeReasonCodeType)
|
|
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 AllowanceChargeReasonCodeType) 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 AllowanceChargeReasonCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ReferencedDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _issuerAssignedID As IDType
|
|
|
|
Private _uRIID As IDType
|
|
|
|
Private _lineID As IDType
|
|
|
|
Private _typeCode As DocumentCodeType
|
|
|
|
Private _name As TextType
|
|
|
|
Private _attachmentBinaryObject As BinaryObjectType
|
|
|
|
Private _referenceTypeCode As ReferenceCodeType
|
|
|
|
Private _formattedIssueDateTime As FormattedDateTimeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._formattedIssueDateTime = New FormattedDateTimeType()
|
|
Me._referenceTypeCode = New ReferenceCodeType()
|
|
Me._attachmentBinaryObject = New BinaryObjectType()
|
|
Me._name = New TextType()
|
|
Me._typeCode = New DocumentCodeType()
|
|
Me._lineID = New IDType()
|
|
Me._uRIID = New IDType()
|
|
Me._issuerAssignedID = New IDType()
|
|
End Sub
|
|
|
|
Public Property IssuerAssignedID() As IDType
|
|
Get
|
|
Return Me._issuerAssignedID
|
|
End Get
|
|
Set
|
|
Me._issuerAssignedID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property URIID() As IDType
|
|
Get
|
|
Return Me._uRIID
|
|
End Get
|
|
Set
|
|
Me._uRIID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LineID() As IDType
|
|
Get
|
|
Return Me._lineID
|
|
End Get
|
|
Set
|
|
Me._lineID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TypeCode() As DocumentCodeType
|
|
Get
|
|
Return Me._typeCode
|
|
End Get
|
|
Set
|
|
Me._typeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Name() As TextType
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AttachmentBinaryObject() As BinaryObjectType
|
|
Get
|
|
Return Me._attachmentBinaryObject
|
|
End Get
|
|
Set
|
|
Me._attachmentBinaryObject = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReferenceTypeCode() As ReferenceCodeType
|
|
Get
|
|
Return Me._referenceTypeCode
|
|
End Get
|
|
Set
|
|
Me._referenceTypeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property FormattedIssueDateTime() As FormattedDateTimeType
|
|
Get
|
|
Return Me._formattedIssueDateTime
|
|
End Get
|
|
Set
|
|
Me._formattedIssueDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ReferencedDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ReferencedDocumentType 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 ReferencedDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ReferencedDocumentType 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 ReferencedDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ReferencedDocumentType)
|
|
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 ReferencedDocumentType) 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 ReferencedDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ReferencedDocumentType)
|
|
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 ReferencedDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), ReferencedDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ReferencedDocumentType 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 ReferencedDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ReferencedDocumentType 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 ReferencedDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ReferencedDocumentType)
|
|
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 ReferencedDocumentType) 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 ReferencedDocumentType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class DocumentCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DocumentCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DocumentCodeType 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 DocumentCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DocumentCodeType 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 DocumentCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentCodeType)
|
|
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 DocumentCodeType) 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 DocumentCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DocumentCodeType)
|
|
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 DocumentCodeType
|
|
Return CType(SerializerXml.Deserialize(s), DocumentCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DocumentCodeType 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 DocumentCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DocumentCodeType 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 DocumentCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentCodeType)
|
|
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 DocumentCodeType) 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 DocumentCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class BinaryObjectType
|
|
|
|
#Region "Private fields"
|
|
Private _mimeCode As String
|
|
|
|
Private _filename As String
|
|
|
|
Private _value() As Byte
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property mimeCode() As String
|
|
Get
|
|
Return Me._mimeCode
|
|
End Get
|
|
Set
|
|
Me._mimeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlAttribute>
|
|
Public Property filename() As String
|
|
Get
|
|
Return Me._filename
|
|
End Get
|
|
Set
|
|
Me._filename = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlAttribute>
|
|
Public Property Value() As Byte()
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BinaryObjectType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize BinaryObjectType 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 BinaryObjectType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output BinaryObjectType 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 BinaryObjectType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, BinaryObjectType)
|
|
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 BinaryObjectType) 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 BinaryObjectType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BinaryObjectType)
|
|
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 BinaryObjectType
|
|
Return CType(SerializerXml.Deserialize(s), BinaryObjectType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current BinaryObjectType 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 BinaryObjectType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output BinaryObjectType 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 BinaryObjectType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, BinaryObjectType)
|
|
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 BinaryObjectType) 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 BinaryObjectType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class ReferenceCodeType
|
|
|
|
#Region "Private fields"
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ReferenceCodeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ReferenceCodeType 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 ReferenceCodeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ReferenceCodeType 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 ReferenceCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ReferenceCodeType)
|
|
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 ReferenceCodeType) 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 ReferenceCodeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ReferenceCodeType)
|
|
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 ReferenceCodeType
|
|
Return CType(SerializerXml.Deserialize(s), ReferenceCodeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ReferenceCodeType 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 ReferenceCodeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ReferenceCodeType 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 ReferenceCodeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ReferenceCodeType)
|
|
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 ReferenceCodeType) 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 ReferenceCodeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class FormattedDateTimeType
|
|
|
|
#Region "Private fields"
|
|
Private _dateTimeString As FormattedDateTimeTypeDateTimeString
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._dateTimeString = New FormattedDateTimeTypeDateTimeString()
|
|
End Sub
|
|
|
|
Public Property DateTimeString() As FormattedDateTimeTypeDateTimeString
|
|
Get
|
|
Return Me._dateTimeString
|
|
End Get
|
|
Set
|
|
Me._dateTimeString = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FormattedDateTimeType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize FormattedDateTimeType 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 FormattedDateTimeType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output FormattedDateTimeType 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 FormattedDateTimeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, FormattedDateTimeType)
|
|
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 FormattedDateTimeType) 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 FormattedDateTimeType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), FormattedDateTimeType)
|
|
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 FormattedDateTimeType
|
|
Return CType(SerializerXml.Deserialize(s), FormattedDateTimeType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current FormattedDateTimeType 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 FormattedDateTimeType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output FormattedDateTimeType 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 FormattedDateTimeType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, FormattedDateTimeType)
|
|
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 FormattedDateTimeType) 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 FormattedDateTimeType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="urn:un:unece:uncefact:data:standard:QualifiedDataType:100")>
|
|
Partial Public Class FormattedDateTimeTypeDateTimeString
|
|
|
|
#Region "Private fields"
|
|
Private _format As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute>
|
|
Public Property format() As String
|
|
Get
|
|
Return Me._format
|
|
End Get
|
|
Set
|
|
Me._format = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlText>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FormattedDateTimeTypeDateTimeString))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize FormattedDateTimeTypeDateTimeString 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 FormattedDateTimeTypeDateTimeString object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output FormattedDateTimeTypeDateTimeString 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 FormattedDateTimeTypeDateTimeString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, FormattedDateTimeTypeDateTimeString)
|
|
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 FormattedDateTimeTypeDateTimeString) 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 FormattedDateTimeTypeDateTimeString
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), FormattedDateTimeTypeDateTimeString)
|
|
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 FormattedDateTimeTypeDateTimeString
|
|
Return CType(SerializerXml.Deserialize(s), FormattedDateTimeTypeDateTimeString)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current FormattedDateTimeTypeDateTimeString 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 FormattedDateTimeTypeDateTimeString object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output FormattedDateTimeTypeDateTimeString 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 FormattedDateTimeTypeDateTimeString, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, FormattedDateTimeTypeDateTimeString)
|
|
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 FormattedDateTimeTypeDateTimeString) 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 FormattedDateTimeTypeDateTimeString
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeAccountingAccountType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeAccountingAccountType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeAccountingAccountType 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 TradeAccountingAccountType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeAccountingAccountType 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 TradeAccountingAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAccountingAccountType)
|
|
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 TradeAccountingAccountType) 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 TradeAccountingAccountType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeAccountingAccountType)
|
|
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 TradeAccountingAccountType
|
|
Return CType(SerializerXml.Deserialize(s), TradeAccountingAccountType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeAccountingAccountType 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 TradeAccountingAccountType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeAccountingAccountType 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 TradeAccountingAccountType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeAccountingAccountType)
|
|
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 TradeAccountingAccountType) 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 TradeAccountingAccountType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class SupplyChainEventType
|
|
|
|
#Region "Private fields"
|
|
Private _occurrenceDateTime As DateTimeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._occurrenceDateTime = New DateTimeType()
|
|
End Sub
|
|
|
|
Public Property OccurrenceDateTime() As DateTimeType
|
|
Get
|
|
Return Me._occurrenceDateTime
|
|
End Get
|
|
Set
|
|
Me._occurrenceDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupplyChainEventType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SupplyChainEventType 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 SupplyChainEventType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SupplyChainEventType 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 SupplyChainEventType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainEventType)
|
|
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 SupplyChainEventType) 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 SupplyChainEventType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupplyChainEventType)
|
|
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 SupplyChainEventType
|
|
Return CType(SerializerXml.Deserialize(s), SupplyChainEventType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SupplyChainEventType 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 SupplyChainEventType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SupplyChainEventType 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 SupplyChainEventType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainEventType)
|
|
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 SupplyChainEventType) 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 SupplyChainEventType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class HeaderTradeDeliveryType
|
|
|
|
#Region "Private fields"
|
|
Private _shipToTradeParty As TradePartyType
|
|
|
|
Private _actualDeliverySupplyChainEvent As SupplyChainEventType
|
|
|
|
Private _despatchAdviceReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _receivingAdviceReferencedDocument As ReferencedDocumentType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._receivingAdviceReferencedDocument = New ReferencedDocumentType()
|
|
Me._despatchAdviceReferencedDocument = New ReferencedDocumentType()
|
|
Me._actualDeliverySupplyChainEvent = New SupplyChainEventType()
|
|
Me._shipToTradeParty = New TradePartyType()
|
|
End Sub
|
|
|
|
Public Property ShipToTradeParty() As TradePartyType
|
|
Get
|
|
Return Me._shipToTradeParty
|
|
End Get
|
|
Set
|
|
Me._shipToTradeParty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ActualDeliverySupplyChainEvent() As SupplyChainEventType
|
|
Get
|
|
Return Me._actualDeliverySupplyChainEvent
|
|
End Get
|
|
Set
|
|
Me._actualDeliverySupplyChainEvent = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DespatchAdviceReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._despatchAdviceReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._despatchAdviceReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReceivingAdviceReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._receivingAdviceReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._receivingAdviceReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HeaderTradeDeliveryType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize HeaderTradeDeliveryType 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 HeaderTradeDeliveryType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeDeliveryType 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 HeaderTradeDeliveryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeDeliveryType)
|
|
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 HeaderTradeDeliveryType) 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 HeaderTradeDeliveryType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HeaderTradeDeliveryType)
|
|
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 HeaderTradeDeliveryType
|
|
Return CType(SerializerXml.Deserialize(s), HeaderTradeDeliveryType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current HeaderTradeDeliveryType 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 HeaderTradeDeliveryType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeDeliveryType 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 HeaderTradeDeliveryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeDeliveryType)
|
|
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 HeaderTradeDeliveryType) 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 HeaderTradeDeliveryType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ProcuringProjectType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private _name As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._name = New TextType()
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Name() As TextType
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProcuringProjectType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ProcuringProjectType 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 ProcuringProjectType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ProcuringProjectType 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 ProcuringProjectType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProcuringProjectType)
|
|
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 ProcuringProjectType) 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 ProcuringProjectType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProcuringProjectType)
|
|
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 ProcuringProjectType
|
|
Return CType(SerializerXml.Deserialize(s), ProcuringProjectType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ProcuringProjectType 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 ProcuringProjectType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ProcuringProjectType 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 ProcuringProjectType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProcuringProjectType)
|
|
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 ProcuringProjectType) 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 ProcuringProjectType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class HeaderTradeAgreementType
|
|
|
|
#Region "Private fields"
|
|
Private _buyerReference As TextType
|
|
|
|
Private _sellerTradeParty As TradePartyType
|
|
|
|
Private _buyerTradeParty As TradePartyType
|
|
|
|
Private _sellerTaxRepresentativeTradeParty As TradePartyType
|
|
|
|
Private _sellerOrderReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _buyerOrderReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _contractReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _additionalReferencedDocument As List(Of ReferencedDocumentType)
|
|
|
|
Private _specifiedProcuringProject As ProcuringProjectType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._specifiedProcuringProject = New ProcuringProjectType()
|
|
Me._additionalReferencedDocument = New List(Of ReferencedDocumentType)()
|
|
Me._contractReferencedDocument = New ReferencedDocumentType()
|
|
Me._buyerOrderReferencedDocument = New ReferencedDocumentType()
|
|
Me._sellerOrderReferencedDocument = New ReferencedDocumentType()
|
|
Me._sellerTaxRepresentativeTradeParty = New TradePartyType()
|
|
Me._buyerTradeParty = New TradePartyType()
|
|
Me._sellerTradeParty = New TradePartyType()
|
|
Me._buyerReference = New TextType()
|
|
End Sub
|
|
|
|
Public Property BuyerReference() As TextType
|
|
Get
|
|
Return Me._buyerReference
|
|
End Get
|
|
Set
|
|
Me._buyerReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SellerTradeParty() As TradePartyType
|
|
Get
|
|
Return Me._sellerTradeParty
|
|
End Get
|
|
Set
|
|
Me._sellerTradeParty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BuyerTradeParty() As TradePartyType
|
|
Get
|
|
Return Me._buyerTradeParty
|
|
End Get
|
|
Set
|
|
Me._buyerTradeParty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SellerTaxRepresentativeTradeParty() As TradePartyType
|
|
Get
|
|
Return Me._sellerTaxRepresentativeTradeParty
|
|
End Get
|
|
Set
|
|
Me._sellerTaxRepresentativeTradeParty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SellerOrderReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._sellerOrderReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._sellerOrderReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BuyerOrderReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._buyerOrderReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._buyerOrderReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ContractReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._contractReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._contractReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("AdditionalReferencedDocument")>
|
|
Public Property AdditionalReferencedDocument() As List(Of ReferencedDocumentType)
|
|
Get
|
|
Return Me._additionalReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._additionalReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedProcuringProject() As ProcuringProjectType
|
|
Get
|
|
Return Me._specifiedProcuringProject
|
|
End Get
|
|
Set
|
|
Me._specifiedProcuringProject = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HeaderTradeAgreementType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize HeaderTradeAgreementType 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 HeaderTradeAgreementType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeAgreementType 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 HeaderTradeAgreementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeAgreementType)
|
|
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 HeaderTradeAgreementType) 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 HeaderTradeAgreementType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HeaderTradeAgreementType)
|
|
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 HeaderTradeAgreementType
|
|
Return CType(SerializerXml.Deserialize(s), HeaderTradeAgreementType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current HeaderTradeAgreementType 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 HeaderTradeAgreementType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output HeaderTradeAgreementType 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 HeaderTradeAgreementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, HeaderTradeAgreementType)
|
|
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 HeaderTradeAgreementType) 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 HeaderTradeAgreementType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeSettlementLineMonetarySummationType
|
|
|
|
#Region "Private fields"
|
|
Private _lineTotalAmount As AmountType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._lineTotalAmount = New AmountType()
|
|
End Sub
|
|
|
|
Public Property LineTotalAmount() As AmountType
|
|
Get
|
|
Return Me._lineTotalAmount
|
|
End Get
|
|
Set
|
|
Me._lineTotalAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeSettlementLineMonetarySummationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeSettlementLineMonetarySummationType 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 TradeSettlementLineMonetarySummationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementLineMonetarySummationType 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 TradeSettlementLineMonetarySummationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementLineMonetarySummationType)
|
|
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 TradeSettlementLineMonetarySummationType) 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 TradeSettlementLineMonetarySummationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeSettlementLineMonetarySummationType)
|
|
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 TradeSettlementLineMonetarySummationType
|
|
Return CType(SerializerXml.Deserialize(s), TradeSettlementLineMonetarySummationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeSettlementLineMonetarySummationType 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 TradeSettlementLineMonetarySummationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeSettlementLineMonetarySummationType 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 TradeSettlementLineMonetarySummationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeSettlementLineMonetarySummationType)
|
|
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 TradeSettlementLineMonetarySummationType) 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 TradeSettlementLineMonetarySummationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class LineTradeSettlementType
|
|
|
|
#Region "Private fields"
|
|
Private _applicableTradeTax As TradeTaxType
|
|
|
|
Private _billingSpecifiedPeriod As SpecifiedPeriodType
|
|
|
|
Private _specifiedTradeAllowanceCharge As List(Of TradeAllowanceChargeType)
|
|
|
|
Private _specifiedTradeSettlementLineMonetarySummation As TradeSettlementLineMonetarySummationType
|
|
|
|
Private _additionalReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _receivableSpecifiedTradeAccountingAccount As TradeAccountingAccountType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._receivableSpecifiedTradeAccountingAccount = New TradeAccountingAccountType()
|
|
Me._additionalReferencedDocument = New ReferencedDocumentType()
|
|
Me._specifiedTradeSettlementLineMonetarySummation = New TradeSettlementLineMonetarySummationType()
|
|
Me._specifiedTradeAllowanceCharge = New List(Of TradeAllowanceChargeType)()
|
|
Me._billingSpecifiedPeriod = New SpecifiedPeriodType()
|
|
Me._applicableTradeTax = New TradeTaxType()
|
|
End Sub
|
|
|
|
Public Property ApplicableTradeTax() As TradeTaxType
|
|
Get
|
|
Return Me._applicableTradeTax
|
|
End Get
|
|
Set
|
|
Me._applicableTradeTax = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BillingSpecifiedPeriod() As SpecifiedPeriodType
|
|
Get
|
|
Return Me._billingSpecifiedPeriod
|
|
End Get
|
|
Set
|
|
Me._billingSpecifiedPeriod = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("SpecifiedTradeAllowanceCharge")>
|
|
Public Property SpecifiedTradeAllowanceCharge() As List(Of TradeAllowanceChargeType)
|
|
Get
|
|
Return Me._specifiedTradeAllowanceCharge
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeAllowanceCharge = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedTradeSettlementLineMonetarySummation() As TradeSettlementLineMonetarySummationType
|
|
Get
|
|
Return Me._specifiedTradeSettlementLineMonetarySummation
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeSettlementLineMonetarySummation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AdditionalReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._additionalReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._additionalReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReceivableSpecifiedTradeAccountingAccount() As TradeAccountingAccountType
|
|
Get
|
|
Return Me._receivableSpecifiedTradeAccountingAccount
|
|
End Get
|
|
Set
|
|
Me._receivableSpecifiedTradeAccountingAccount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LineTradeSettlementType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LineTradeSettlementType 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 LineTradeSettlementType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LineTradeSettlementType 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 LineTradeSettlementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeSettlementType)
|
|
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 LineTradeSettlementType) 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 LineTradeSettlementType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LineTradeSettlementType)
|
|
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 LineTradeSettlementType
|
|
Return CType(SerializerXml.Deserialize(s), LineTradeSettlementType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LineTradeSettlementType 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 LineTradeSettlementType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LineTradeSettlementType 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 LineTradeSettlementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeSettlementType)
|
|
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 LineTradeSettlementType) 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 LineTradeSettlementType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class LineTradeDeliveryType
|
|
|
|
#Region "Private fields"
|
|
Private _billedQuantity As QuantityType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._billedQuantity = New QuantityType()
|
|
End Sub
|
|
|
|
Public Property BilledQuantity() As QuantityType
|
|
Get
|
|
Return Me._billedQuantity
|
|
End Get
|
|
Set
|
|
Me._billedQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LineTradeDeliveryType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LineTradeDeliveryType 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 LineTradeDeliveryType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LineTradeDeliveryType 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 LineTradeDeliveryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeDeliveryType)
|
|
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 LineTradeDeliveryType) 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 LineTradeDeliveryType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LineTradeDeliveryType)
|
|
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 LineTradeDeliveryType
|
|
Return CType(SerializerXml.Deserialize(s), LineTradeDeliveryType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LineTradeDeliveryType 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 LineTradeDeliveryType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LineTradeDeliveryType 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 LineTradeDeliveryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeDeliveryType)
|
|
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 LineTradeDeliveryType) 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 LineTradeDeliveryType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")>
|
|
Partial Public Class QuantityType
|
|
|
|
#Region "Private fields"
|
|
Private _unitCode As String
|
|
|
|
Private _value As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlAttribute(DataType:="token")>
|
|
Public Property unitCode() As String
|
|
Get
|
|
Return Me._unitCode
|
|
End Get
|
|
Set
|
|
Me._unitCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlText>
|
|
Public Property Value() As Decimal
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(QuantityType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize QuantityType 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 QuantityType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output QuantityType 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 QuantityType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, QuantityType)
|
|
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 QuantityType) 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 QuantityType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), QuantityType)
|
|
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 QuantityType
|
|
Return CType(SerializerXml.Deserialize(s), QuantityType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current QuantityType 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 QuantityType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output QuantityType 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 QuantityType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, QuantityType)
|
|
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 QuantityType) 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 QuantityType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradePriceType
|
|
|
|
#Region "Private fields"
|
|
Private _chargeAmount As AmountType
|
|
|
|
Private _basisQuantity As QuantityType
|
|
|
|
Private _appliedTradeAllowanceCharge As TradeAllowanceChargeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._appliedTradeAllowanceCharge = New TradeAllowanceChargeType()
|
|
Me._basisQuantity = New QuantityType()
|
|
Me._chargeAmount = New AmountType()
|
|
End Sub
|
|
|
|
Public Property ChargeAmount() As AmountType
|
|
Get
|
|
Return Me._chargeAmount
|
|
End Get
|
|
Set
|
|
Me._chargeAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BasisQuantity() As QuantityType
|
|
Get
|
|
Return Me._basisQuantity
|
|
End Get
|
|
Set
|
|
Me._basisQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AppliedTradeAllowanceCharge() As TradeAllowanceChargeType
|
|
Get
|
|
Return Me._appliedTradeAllowanceCharge
|
|
End Get
|
|
Set
|
|
Me._appliedTradeAllowanceCharge = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradePriceType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradePriceType 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 TradePriceType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradePriceType 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 TradePriceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePriceType)
|
|
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 TradePriceType) 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 TradePriceType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradePriceType)
|
|
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 TradePriceType
|
|
Return CType(SerializerXml.Deserialize(s), TradePriceType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradePriceType 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 TradePriceType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradePriceType 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 TradePriceType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradePriceType)
|
|
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 TradePriceType) 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 TradePriceType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class LineTradeAgreementType
|
|
|
|
#Region "Private fields"
|
|
Private _buyerOrderReferencedDocument As ReferencedDocumentType
|
|
|
|
Private _grossPriceProductTradePrice As TradePriceType
|
|
|
|
Private _netPriceProductTradePrice As TradePriceType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._netPriceProductTradePrice = New TradePriceType()
|
|
Me._grossPriceProductTradePrice = New TradePriceType()
|
|
Me._buyerOrderReferencedDocument = New ReferencedDocumentType()
|
|
End Sub
|
|
|
|
Public Property BuyerOrderReferencedDocument() As ReferencedDocumentType
|
|
Get
|
|
Return Me._buyerOrderReferencedDocument
|
|
End Get
|
|
Set
|
|
Me._buyerOrderReferencedDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property GrossPriceProductTradePrice() As TradePriceType
|
|
Get
|
|
Return Me._grossPriceProductTradePrice
|
|
End Get
|
|
Set
|
|
Me._grossPriceProductTradePrice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property NetPriceProductTradePrice() As TradePriceType
|
|
Get
|
|
Return Me._netPriceProductTradePrice
|
|
End Get
|
|
Set
|
|
Me._netPriceProductTradePrice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LineTradeAgreementType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize LineTradeAgreementType 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 LineTradeAgreementType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output LineTradeAgreementType 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 LineTradeAgreementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeAgreementType)
|
|
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 LineTradeAgreementType) 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 LineTradeAgreementType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LineTradeAgreementType)
|
|
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 LineTradeAgreementType
|
|
Return CType(SerializerXml.Deserialize(s), LineTradeAgreementType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current LineTradeAgreementType 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 LineTradeAgreementType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output LineTradeAgreementType 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 LineTradeAgreementType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, LineTradeAgreementType)
|
|
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 LineTradeAgreementType) 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 LineTradeAgreementType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeCountryType
|
|
|
|
#Region "Private fields"
|
|
Private _id As CountryIDType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._id = New CountryIDType()
|
|
End Sub
|
|
|
|
Public Property ID() As CountryIDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeCountryType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeCountryType 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 TradeCountryType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeCountryType 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 TradeCountryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeCountryType)
|
|
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 TradeCountryType) 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 TradeCountryType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeCountryType)
|
|
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 TradeCountryType
|
|
Return CType(SerializerXml.Deserialize(s), TradeCountryType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeCountryType 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 TradeCountryType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeCountryType 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 TradeCountryType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeCountryType)
|
|
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 TradeCountryType) 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 TradeCountryType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ProductClassificationType
|
|
|
|
#Region "Private fields"
|
|
Private _classCode As CodeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._classCode = New CodeType()
|
|
End Sub
|
|
|
|
Public Property ClassCode() As CodeType
|
|
Get
|
|
Return Me._classCode
|
|
End Get
|
|
Set
|
|
Me._classCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProductClassificationType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ProductClassificationType 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 ProductClassificationType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ProductClassificationType 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 ProductClassificationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProductClassificationType)
|
|
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 ProductClassificationType) 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 ProductClassificationType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProductClassificationType)
|
|
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 ProductClassificationType
|
|
Return CType(SerializerXml.Deserialize(s), ProductClassificationType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ProductClassificationType 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 ProductClassificationType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ProductClassificationType 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 ProductClassificationType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProductClassificationType)
|
|
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 ProductClassificationType) 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 ProductClassificationType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ProductCharacteristicType
|
|
|
|
#Region "Private fields"
|
|
Private _description As TextType
|
|
|
|
Private _value As TextType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._value = New TextType()
|
|
Me._description = New TextType()
|
|
End Sub
|
|
|
|
Public Property Description() As TextType
|
|
Get
|
|
Return Me._description
|
|
End Get
|
|
Set
|
|
Me._description = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Value() As TextType
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProductCharacteristicType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ProductCharacteristicType 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 ProductCharacteristicType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ProductCharacteristicType 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 ProductCharacteristicType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProductCharacteristicType)
|
|
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 ProductCharacteristicType) 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 ProductCharacteristicType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProductCharacteristicType)
|
|
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 ProductCharacteristicType
|
|
Return CType(SerializerXml.Deserialize(s), ProductCharacteristicType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ProductCharacteristicType 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 ProductCharacteristicType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ProductCharacteristicType 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 ProductCharacteristicType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ProductCharacteristicType)
|
|
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 ProductCharacteristicType) 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 ProductCharacteristicType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class TradeProductType
|
|
|
|
#Region "Private fields"
|
|
Private _globalID As IDType
|
|
|
|
Private _sellerAssignedID As IDType
|
|
|
|
Private _buyerAssignedID As IDType
|
|
|
|
Private _name As TextType
|
|
|
|
Private _description As TextType
|
|
|
|
Private _applicableProductCharacteristic As List(Of ProductCharacteristicType)
|
|
|
|
Private _designatedProductClassification As List(Of ProductClassificationType)
|
|
|
|
Private _originTradeCountry As TradeCountryType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._originTradeCountry = New TradeCountryType()
|
|
Me._designatedProductClassification = New List(Of ProductClassificationType)()
|
|
Me._applicableProductCharacteristic = New List(Of ProductCharacteristicType)()
|
|
Me._description = New TextType()
|
|
Me._name = New TextType()
|
|
Me._buyerAssignedID = New IDType()
|
|
Me._sellerAssignedID = New IDType()
|
|
Me._globalID = New IDType()
|
|
End Sub
|
|
|
|
Public Property GlobalID() As IDType
|
|
Get
|
|
Return Me._globalID
|
|
End Get
|
|
Set
|
|
Me._globalID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SellerAssignedID() As IDType
|
|
Get
|
|
Return Me._sellerAssignedID
|
|
End Get
|
|
Set
|
|
Me._sellerAssignedID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BuyerAssignedID() As IDType
|
|
Get
|
|
Return Me._buyerAssignedID
|
|
End Get
|
|
Set
|
|
Me._buyerAssignedID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Name() As TextType
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Description() As TextType
|
|
Get
|
|
Return Me._description
|
|
End Get
|
|
Set
|
|
Me._description = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("ApplicableProductCharacteristic")>
|
|
Public Property ApplicableProductCharacteristic() As List(Of ProductCharacteristicType)
|
|
Get
|
|
Return Me._applicableProductCharacteristic
|
|
End Get
|
|
Set
|
|
Me._applicableProductCharacteristic = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("DesignatedProductClassification")>
|
|
Public Property DesignatedProductClassification() As List(Of ProductClassificationType)
|
|
Get
|
|
Return Me._designatedProductClassification
|
|
End Get
|
|
Set
|
|
Me._designatedProductClassification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property OriginTradeCountry() As TradeCountryType
|
|
Get
|
|
Return Me._originTradeCountry
|
|
End Get
|
|
Set
|
|
Me._originTradeCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TradeProductType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TradeProductType 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 TradeProductType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TradeProductType 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 TradeProductType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeProductType)
|
|
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 TradeProductType) 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 TradeProductType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TradeProductType)
|
|
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 TradeProductType
|
|
Return CType(SerializerXml.Deserialize(s), TradeProductType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TradeProductType 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 TradeProductType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TradeProductType 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 TradeProductType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TradeProductType)
|
|
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 TradeProductType) 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 TradeProductType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class DocumentLineDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _lineID As IDType
|
|
|
|
Private _includedNote As NoteType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._includedNote = New NoteType()
|
|
Me._lineID = New IDType()
|
|
End Sub
|
|
|
|
Public Property LineID() As IDType
|
|
Get
|
|
Return Me._lineID
|
|
End Get
|
|
Set
|
|
Me._lineID = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property IncludedNote() As NoteType
|
|
Get
|
|
Return Me._includedNote
|
|
End Get
|
|
Set
|
|
Me._includedNote = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DocumentLineDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize DocumentLineDocumentType 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 DocumentLineDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DocumentLineDocumentType 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 DocumentLineDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentLineDocumentType)
|
|
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 DocumentLineDocumentType) 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 DocumentLineDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DocumentLineDocumentType)
|
|
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 DocumentLineDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), DocumentLineDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DocumentLineDocumentType 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 DocumentLineDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DocumentLineDocumentType 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 DocumentLineDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DocumentLineDocumentType)
|
|
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 DocumentLineDocumentType) 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 DocumentLineDocumentType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class NoteType
|
|
|
|
#Region "Private fields"
|
|
Private _content As TextType
|
|
|
|
Private _subjectCode As CodeType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._subjectCode = New CodeType()
|
|
Me._content = New TextType()
|
|
End Sub
|
|
|
|
Public Property Content() As TextType
|
|
Get
|
|
Return Me._content
|
|
End Get
|
|
Set
|
|
Me._content = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SubjectCode() As CodeType
|
|
Get
|
|
Return Me._subjectCode
|
|
End Get
|
|
Set
|
|
Me._subjectCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(NoteType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize NoteType 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 NoteType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output NoteType 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 NoteType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, NoteType)
|
|
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 NoteType) 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 NoteType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), NoteType)
|
|
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 NoteType
|
|
Return CType(SerializerXml.Deserialize(s), NoteType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current NoteType 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 NoteType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output NoteType 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 NoteType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, NoteType)
|
|
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 NoteType) 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 NoteType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class SupplyChainTradeLineItemType
|
|
|
|
#Region "Private fields"
|
|
Private _associatedDocumentLineDocument As DocumentLineDocumentType
|
|
|
|
Private _specifiedTradeProduct As TradeProductType
|
|
|
|
Private _specifiedLineTradeAgreement As LineTradeAgreementType
|
|
|
|
Private _specifiedLineTradeDelivery As LineTradeDeliveryType
|
|
|
|
Private _specifiedLineTradeSettlement As LineTradeSettlementType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._specifiedLineTradeSettlement = New LineTradeSettlementType()
|
|
Me._specifiedLineTradeDelivery = New LineTradeDeliveryType()
|
|
Me._specifiedLineTradeAgreement = New LineTradeAgreementType()
|
|
Me._specifiedTradeProduct = New TradeProductType()
|
|
Me._associatedDocumentLineDocument = New DocumentLineDocumentType()
|
|
End Sub
|
|
|
|
Public Property AssociatedDocumentLineDocument() As DocumentLineDocumentType
|
|
Get
|
|
Return Me._associatedDocumentLineDocument
|
|
End Get
|
|
Set
|
|
Me._associatedDocumentLineDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedTradeProduct() As TradeProductType
|
|
Get
|
|
Return Me._specifiedTradeProduct
|
|
End Get
|
|
Set
|
|
Me._specifiedTradeProduct = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedLineTradeAgreement() As LineTradeAgreementType
|
|
Get
|
|
Return Me._specifiedLineTradeAgreement
|
|
End Get
|
|
Set
|
|
Me._specifiedLineTradeAgreement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedLineTradeDelivery() As LineTradeDeliveryType
|
|
Get
|
|
Return Me._specifiedLineTradeDelivery
|
|
End Get
|
|
Set
|
|
Me._specifiedLineTradeDelivery = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SpecifiedLineTradeSettlement() As LineTradeSettlementType
|
|
Get
|
|
Return Me._specifiedLineTradeSettlement
|
|
End Get
|
|
Set
|
|
Me._specifiedLineTradeSettlement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupplyChainTradeLineItemType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SupplyChainTradeLineItemType 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 SupplyChainTradeLineItemType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SupplyChainTradeLineItemType 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 SupplyChainTradeLineItemType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainTradeLineItemType)
|
|
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 SupplyChainTradeLineItemType) 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 SupplyChainTradeLineItemType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupplyChainTradeLineItemType)
|
|
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 SupplyChainTradeLineItemType
|
|
Return CType(SerializerXml.Deserialize(s), SupplyChainTradeLineItemType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SupplyChainTradeLineItemType 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 SupplyChainTradeLineItemType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SupplyChainTradeLineItemType 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 SupplyChainTradeLineItemType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainTradeLineItemType)
|
|
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 SupplyChainTradeLineItemType) 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 SupplyChainTradeLineItemType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class SupplyChainTradeTransactionType
|
|
|
|
#Region "Private fields"
|
|
Private _includedSupplyChainTradeLineItem As List(Of SupplyChainTradeLineItemType)
|
|
|
|
Private _applicableHeaderTradeAgreement As HeaderTradeAgreementType
|
|
|
|
Private _applicableHeaderTradeDelivery As HeaderTradeDeliveryType
|
|
|
|
Private _applicableHeaderTradeSettlement As HeaderTradeSettlementType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._applicableHeaderTradeSettlement = New HeaderTradeSettlementType()
|
|
Me._applicableHeaderTradeDelivery = New HeaderTradeDeliveryType()
|
|
Me._applicableHeaderTradeAgreement = New HeaderTradeAgreementType()
|
|
Me._includedSupplyChainTradeLineItem = New List(Of SupplyChainTradeLineItemType)()
|
|
End Sub
|
|
|
|
<XmlElement("IncludedSupplyChainTradeLineItem")>
|
|
Public Property IncludedSupplyChainTradeLineItem() As List(Of SupplyChainTradeLineItemType)
|
|
Get
|
|
Return Me._includedSupplyChainTradeLineItem
|
|
End Get
|
|
Set
|
|
Me._includedSupplyChainTradeLineItem = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ApplicableHeaderTradeAgreement() As HeaderTradeAgreementType
|
|
Get
|
|
Return Me._applicableHeaderTradeAgreement
|
|
End Get
|
|
Set
|
|
Me._applicableHeaderTradeAgreement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ApplicableHeaderTradeDelivery() As HeaderTradeDeliveryType
|
|
Get
|
|
Return Me._applicableHeaderTradeDelivery
|
|
End Get
|
|
Set
|
|
Me._applicableHeaderTradeDelivery = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ApplicableHeaderTradeSettlement() As HeaderTradeSettlementType
|
|
Get
|
|
Return Me._applicableHeaderTradeSettlement
|
|
End Get
|
|
Set
|
|
Me._applicableHeaderTradeSettlement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupplyChainTradeTransactionType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize SupplyChainTradeTransactionType 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 SupplyChainTradeTransactionType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output SupplyChainTradeTransactionType 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 SupplyChainTradeTransactionType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainTradeTransactionType)
|
|
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 SupplyChainTradeTransactionType) 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 SupplyChainTradeTransactionType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupplyChainTradeTransactionType)
|
|
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 SupplyChainTradeTransactionType
|
|
Return CType(SerializerXml.Deserialize(s), SupplyChainTradeTransactionType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current SupplyChainTradeTransactionType 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 SupplyChainTradeTransactionType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output SupplyChainTradeTransactionType 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 SupplyChainTradeTransactionType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, SupplyChainTradeTransactionType)
|
|
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 SupplyChainTradeTransactionType) 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 SupplyChainTradeTransactionType
|
|
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.9037.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:10" &
|
|
"0")>
|
|
Partial Public Class ExchangedDocumentType
|
|
|
|
#Region "Private fields"
|
|
Private _id As IDType
|
|
|
|
Private _typeCode As DocumentCodeType
|
|
|
|
Private _issueDateTime As DateTimeType
|
|
|
|
Private _includedNote As List(Of NoteType)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._includedNote = New List(Of NoteType)()
|
|
Me._issueDateTime = New DateTimeType()
|
|
Me._typeCode = New DocumentCodeType()
|
|
Me._id = New IDType()
|
|
End Sub
|
|
|
|
Public Property ID() As IDType
|
|
Get
|
|
Return Me._id
|
|
End Get
|
|
Set
|
|
Me._id = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TypeCode() As DocumentCodeType
|
|
Get
|
|
Return Me._typeCode
|
|
End Get
|
|
Set
|
|
Me._typeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property IssueDateTime() As DateTimeType
|
|
Get
|
|
Return Me._issueDateTime
|
|
End Get
|
|
Set
|
|
Me._issueDateTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("IncludedNote")>
|
|
Public Property IncludedNote() As List(Of NoteType)
|
|
Get
|
|
Return Me._includedNote
|
|
End Get
|
|
Set
|
|
Me._includedNote = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ExchangedDocumentType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ExchangedDocumentType 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 ExchangedDocumentType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ExchangedDocumentType 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 ExchangedDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ExchangedDocumentType)
|
|
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 ExchangedDocumentType) 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 ExchangedDocumentType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ExchangedDocumentType)
|
|
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 ExchangedDocumentType
|
|
Return CType(SerializerXml.Deserialize(s), ExchangedDocumentType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ExchangedDocumentType 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 ExchangedDocumentType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ExchangedDocumentType 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 ExchangedDocumentType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ExchangedDocumentType)
|
|
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 ExchangedDocumentType) 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 ExchangedDocumentType
|
|
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
|