'------------------------------------------------------------------------------ ' ' Dieser Code wurde von einem Tool generiert. ' Laufzeitversion:4.0.30319.42000 ' ' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn ' der Code erneut generiert wird. ' '------------------------------------------------------------------------------ Option Strict Off Option Explicit On ''' '''Represents a strongly typed in-memory cache of data. ''' _ Partial Public Class DS_DD_ECM Inherits Global.System.Data.DataSet Private tableTBEDI_XML_ITEMS As TBEDI_XML_ITEMSDataTable Private tableTBEDI_XML_TYPES As TBEDI_XML_TYPESDataTable Private tableTBEDI_XML_TEMPLATES As TBEDI_XML_TEMPLATESDataTable Private tableTBEDI_XML_NODES As TBEDI_XML_NODESDataTable Private tableTBEDI_XML_FUNCTIONS As TBEDI_XML_FUNCTIONSDataTable Private tableTBEDI_XML_CONFIG As TBEDI_XML_CONFIGDataTable Private relationTBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS As Global.System.Data.DataRelation Private relationTBEDI_XML_ITEMS_TBEDI_XML_TYPES As Global.System.Data.DataRelation Private relationTBEDI_XML_NODES_TBEDI_XML_TEMPLATES As Global.System.Data.DataRelation Private relationFK_TBEDI_XML_TYPES As Global.System.Data.DataRelation Private relationFK_TBEDI_XML_NODES As Global.System.Data.DataRelation Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("TBEDI_XML_ITEMS")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_ITEMSDataTable(ds.Tables("TBEDI_XML_ITEMS"))) End If If (Not (ds.Tables("TBEDI_XML_TYPES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_TYPESDataTable(ds.Tables("TBEDI_XML_TYPES"))) End If If (Not (ds.Tables("TBEDI_XML_TEMPLATES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_TEMPLATESDataTable(ds.Tables("TBEDI_XML_TEMPLATES"))) End If If (Not (ds.Tables("TBEDI_XML_NODES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_NODESDataTable(ds.Tables("TBEDI_XML_NODES"))) End If If (Not (ds.Tables("TBEDI_XML_FUNCTIONS")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_FUNCTIONSDataTable(ds.Tables("TBEDI_XML_FUNCTIONS"))) End If If (Not (ds.Tables("TBEDI_XML_CONFIG")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_CONFIGDataTable(ds.Tables("TBEDI_XML_CONFIG"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub _ Public ReadOnly Property TBEDI_XML_ITEMS() As TBEDI_XML_ITEMSDataTable Get Return Me.tableTBEDI_XML_ITEMS End Get End Property _ Public ReadOnly Property TBEDI_XML_TYPES() As TBEDI_XML_TYPESDataTable Get Return Me.tableTBEDI_XML_TYPES End Get End Property _ Public ReadOnly Property TBEDI_XML_TEMPLATES() As TBEDI_XML_TEMPLATESDataTable Get Return Me.tableTBEDI_XML_TEMPLATES End Get End Property _ Public ReadOnly Property TBEDI_XML_NODES() As TBEDI_XML_NODESDataTable Get Return Me.tableTBEDI_XML_NODES End Get End Property _ Public ReadOnly Property TBEDI_XML_FUNCTIONS() As TBEDI_XML_FUNCTIONSDataTable Get Return Me.tableTBEDI_XML_FUNCTIONS End Get End Property _ Public ReadOnly Property TBEDI_XML_CONFIG() As TBEDI_XML_CONFIGDataTable Get Return Me.tableTBEDI_XML_CONFIG End Get End Property _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As DS_DD_ECM = CType(MyBase.Clone,DS_DD_ECM) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("TBEDI_XML_ITEMS")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_ITEMSDataTable(ds.Tables("TBEDI_XML_ITEMS"))) End If If (Not (ds.Tables("TBEDI_XML_TYPES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_TYPESDataTable(ds.Tables("TBEDI_XML_TYPES"))) End If If (Not (ds.Tables("TBEDI_XML_TEMPLATES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_TEMPLATESDataTable(ds.Tables("TBEDI_XML_TEMPLATES"))) End If If (Not (ds.Tables("TBEDI_XML_NODES")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_NODESDataTable(ds.Tables("TBEDI_XML_NODES"))) End If If (Not (ds.Tables("TBEDI_XML_FUNCTIONS")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_FUNCTIONSDataTable(ds.Tables("TBEDI_XML_FUNCTIONS"))) End If If (Not (ds.Tables("TBEDI_XML_CONFIG")) Is Nothing) Then MyBase.Tables.Add(New TBEDI_XML_CONFIGDataTable(ds.Tables("TBEDI_XML_CONFIG"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tableTBEDI_XML_ITEMS = CType(MyBase.Tables("TBEDI_XML_ITEMS"),TBEDI_XML_ITEMSDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_ITEMS) Is Nothing) Then Me.tableTBEDI_XML_ITEMS.InitVars End If End If Me.tableTBEDI_XML_TYPES = CType(MyBase.Tables("TBEDI_XML_TYPES"),TBEDI_XML_TYPESDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_TYPES) Is Nothing) Then Me.tableTBEDI_XML_TYPES.InitVars End If End If Me.tableTBEDI_XML_TEMPLATES = CType(MyBase.Tables("TBEDI_XML_TEMPLATES"),TBEDI_XML_TEMPLATESDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_TEMPLATES) Is Nothing) Then Me.tableTBEDI_XML_TEMPLATES.InitVars End If End If Me.tableTBEDI_XML_NODES = CType(MyBase.Tables("TBEDI_XML_NODES"),TBEDI_XML_NODESDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_NODES) Is Nothing) Then Me.tableTBEDI_XML_NODES.InitVars End If End If Me.tableTBEDI_XML_FUNCTIONS = CType(MyBase.Tables("TBEDI_XML_FUNCTIONS"),TBEDI_XML_FUNCTIONSDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_FUNCTIONS) Is Nothing) Then Me.tableTBEDI_XML_FUNCTIONS.InitVars End If End If Me.tableTBEDI_XML_CONFIG = CType(MyBase.Tables("TBEDI_XML_CONFIG"),TBEDI_XML_CONFIGDataTable) If (initTable = true) Then If (Not (Me.tableTBEDI_XML_CONFIG) Is Nothing) Then Me.tableTBEDI_XML_CONFIG.InitVars End If End If Me.relationTBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS = Me.Relations("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS") Me.relationTBEDI_XML_ITEMS_TBEDI_XML_TYPES = Me.Relations("TBEDI_XML_ITEMS_TBEDI_XML_TYPES") Me.relationTBEDI_XML_NODES_TBEDI_XML_TEMPLATES = Me.Relations("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES") Me.relationFK_TBEDI_XML_TYPES = Me.Relations("FK_TBEDI_XML_TYPES") Me.relationFK_TBEDI_XML_NODES = Me.Relations("FK_TBEDI_XML_NODES") End Sub _ Private Sub InitClass() Me.DataSetName = "DS_DD_ECM" Me.Prefix = "" Me.Namespace = "http://tempuri.org/DS_DD_ECM.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tableTBEDI_XML_ITEMS = New TBEDI_XML_ITEMSDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_ITEMS) Me.tableTBEDI_XML_TYPES = New TBEDI_XML_TYPESDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_TYPES) Me.tableTBEDI_XML_TEMPLATES = New TBEDI_XML_TEMPLATESDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_TEMPLATES) Me.tableTBEDI_XML_NODES = New TBEDI_XML_NODESDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_NODES) Me.tableTBEDI_XML_FUNCTIONS = New TBEDI_XML_FUNCTIONSDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_FUNCTIONS) Me.tableTBEDI_XML_CONFIG = New TBEDI_XML_CONFIGDataTable() MyBase.Tables.Add(Me.tableTBEDI_XML_CONFIG) Me.relationTBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS = New Global.System.Data.DataRelation("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS", New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.FUNCTION_IDColumn}, New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_FUNCTIONS.GUIDColumn}, false) Me.Relations.Add(Me.relationTBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS) Me.relationTBEDI_XML_ITEMS_TBEDI_XML_TYPES = New Global.System.Data.DataRelation("TBEDI_XML_ITEMS_TBEDI_XML_TYPES", New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.XML_TYPE_IDColumn}, New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_TYPES.GUIDColumn}, false) Me.Relations.Add(Me.relationTBEDI_XML_ITEMS_TBEDI_XML_TYPES) Me.relationTBEDI_XML_NODES_TBEDI_XML_TEMPLATES = New Global.System.Data.DataRelation("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES", New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_NODES.TEMPLATE_IDColumn}, New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_TEMPLATES.GUIDColumn}, false) Me.Relations.Add(Me.relationTBEDI_XML_NODES_TBEDI_XML_TEMPLATES) Me.relationFK_TBEDI_XML_TYPES = New Global.System.Data.DataRelation("FK_TBEDI_XML_TYPES", New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.GUIDColumn}, New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.XML_TYPE_IDColumn}, false) Me.Relations.Add(Me.relationFK_TBEDI_XML_TYPES) Me.relationFK_TBEDI_XML_NODES = New Global.System.Data.DataRelation("FK_TBEDI_XML_NODES", New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.GUIDColumn}, New Global.System.Data.DataColumn() {Me.tableTBEDI_XML_ITEMS.XML_TABLE_IDColumn}, false) Me.Relations.Add(Me.relationFK_TBEDI_XML_NODES) End Sub _ Private Function ShouldSerializeTBEDI_XML_ITEMS() As Boolean Return false End Function _ Private Function ShouldSerializeTBEDI_XML_TYPES() As Boolean Return false End Function _ Private Function ShouldSerializeTBEDI_XML_TEMPLATES() As Boolean Return false End Function _ Private Function ShouldSerializeTBEDI_XML_NODES() As Boolean Return false End Function _ Private Function ShouldSerializeTBEDI_XML_FUNCTIONS() As Boolean Return false End Function _ Private Function ShouldSerializeTBEDI_XML_CONFIG() As Boolean Return false End Function _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function _ Public Delegate Sub TBEDI_XML_ITEMSRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_ITEMSRowChangeEvent) _ Public Delegate Sub TBEDI_XML_TYPESRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_TYPESRowChangeEvent) _ Public Delegate Sub TBEDI_XML_TEMPLATESRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_TEMPLATESRowChangeEvent) _ Public Delegate Sub TBEDI_XML_NODESRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_NODESRowChangeEvent) _ Public Delegate Sub TBEDI_XML_FUNCTIONSRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_FUNCTIONSRowChangeEvent) _ Public Delegate Sub TBEDI_XML_CONFIGRowChangeEventHandler(ByVal sender As Object, ByVal e As TBEDI_XML_CONFIGRowChangeEvent) ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_ITEMSDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_ITEMSRow) Private columnGUID As Global.System.Data.DataColumn Private columnXML_NAME As Global.System.Data.DataColumn Private columnXML_TYPE_ID As Global.System.Data.DataColumn Private columnIS_READ_ONLY As Global.System.Data.DataColumn Private columnIS_VISIBLE As Global.System.Data.DataColumn Private columnORDER_KEY As Global.System.Data.DataColumn Private columnFUNCTION_ID As Global.System.Data.DataColumn Private columnIS_REQUIRED As Global.System.Data.DataColumn Private columnXML_TABLE_ID As Global.System.Data.DataColumn Private columnIS_VIRTUAL As Global.System.Data.DataColumn Private columnFUNCTION_PARAMETERS As Global.System.Data.DataColumn Private columnADDED_WHO As Global.System.Data.DataColumn Private columnADDED_WHEN As Global.System.Data.DataColumn Private columnCHANGED_WHO As Global.System.Data.DataColumn Private columnCHANGED_WHEN As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_ITEMS" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property XML_NAMEColumn() As Global.System.Data.DataColumn Get Return Me.columnXML_NAME End Get End Property _ Public ReadOnly Property XML_TYPE_IDColumn() As Global.System.Data.DataColumn Get Return Me.columnXML_TYPE_ID End Get End Property _ Public ReadOnly Property IS_READ_ONLYColumn() As Global.System.Data.DataColumn Get Return Me.columnIS_READ_ONLY End Get End Property _ Public ReadOnly Property IS_VISIBLEColumn() As Global.System.Data.DataColumn Get Return Me.columnIS_VISIBLE End Get End Property _ Public ReadOnly Property ORDER_KEYColumn() As Global.System.Data.DataColumn Get Return Me.columnORDER_KEY End Get End Property _ Public ReadOnly Property FUNCTION_IDColumn() As Global.System.Data.DataColumn Get Return Me.columnFUNCTION_ID End Get End Property _ Public ReadOnly Property IS_REQUIREDColumn() As Global.System.Data.DataColumn Get Return Me.columnIS_REQUIRED End Get End Property _ Public ReadOnly Property XML_TABLE_IDColumn() As Global.System.Data.DataColumn Get Return Me.columnXML_TABLE_ID End Get End Property _ Public ReadOnly Property IS_VIRTUALColumn() As Global.System.Data.DataColumn Get Return Me.columnIS_VIRTUAL End Get End Property _ Public ReadOnly Property FUNCTION_PARAMETERSColumn() As Global.System.Data.DataColumn Get Return Me.columnFUNCTION_PARAMETERS End Get End Property _ Public ReadOnly Property ADDED_WHOColumn() As Global.System.Data.DataColumn Get Return Me.columnADDED_WHO End Get End Property _ Public ReadOnly Property ADDED_WHENColumn() As Global.System.Data.DataColumn Get Return Me.columnADDED_WHEN End Get End Property _ Public ReadOnly Property CHANGED_WHOColumn() As Global.System.Data.DataColumn Get Return Me.columnCHANGED_WHO End Get End Property _ Public ReadOnly Property CHANGED_WHENColumn() As Global.System.Data.DataColumn Get Return Me.columnCHANGED_WHEN End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_ITEMSRow Get Return CType(Me.Rows(index),TBEDI_XML_ITEMSRow) End Get End Property _ Public Event TBEDI_XML_ITEMSRowChanging As TBEDI_XML_ITEMSRowChangeEventHandler _ Public Event TBEDI_XML_ITEMSRowChanged As TBEDI_XML_ITEMSRowChangeEventHandler _ Public Event TBEDI_XML_ITEMSRowDeleting As TBEDI_XML_ITEMSRowChangeEventHandler _ Public Event TBEDI_XML_ITEMSRowDeleted As TBEDI_XML_ITEMSRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_ITEMSRow(ByVal row As TBEDI_XML_ITEMSRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_ITEMSRow(ByVal XML_NAME As String, ByVal parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_TYPES As TBEDI_XML_ITEMSRow, ByVal IS_READ_ONLY As Boolean, ByVal IS_VISIBLE As Boolean, ByVal ORDER_KEY As Integer, ByVal FUNCTION_ID As Integer, ByVal IS_REQUIRED As Boolean, ByVal parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_NODES As TBEDI_XML_ITEMSRow, ByVal IS_VIRTUAL As Boolean, ByVal FUNCTION_PARAMETERS As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Date, ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Date) As TBEDI_XML_ITEMSRow Dim rowTBEDI_XML_ITEMSRow As TBEDI_XML_ITEMSRow = CType(Me.NewRow,TBEDI_XML_ITEMSRow) Dim columnValuesArray() As Object = New Object() {Nothing, XML_NAME, Nothing, IS_READ_ONLY, IS_VISIBLE, ORDER_KEY, FUNCTION_ID, IS_REQUIRED, Nothing, IS_VIRTUAL, FUNCTION_PARAMETERS, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN} If (Not (parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_TYPES) Is Nothing) Then columnValuesArray(2) = parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_TYPES(0) End If If (Not (parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_NODES) Is Nothing) Then columnValuesArray(8) = parentTBEDI_XML_ITEMSRowByFK_TBEDI_XML_NODES(0) End If rowTBEDI_XML_ITEMSRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_ITEMSRow) Return rowTBEDI_XML_ITEMSRow End Function _ Public Function FindByGUID(ByVal GUID As Integer) As TBEDI_XML_ITEMSRow Return CType(Me.Rows.Find(New Object() {GUID}),TBEDI_XML_ITEMSRow) End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_ITEMSDataTable = CType(MyBase.Clone,TBEDI_XML_ITEMSDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_ITEMSDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnXML_NAME = MyBase.Columns("XML_NAME") Me.columnXML_TYPE_ID = MyBase.Columns("XML_TYPE_ID") Me.columnIS_READ_ONLY = MyBase.Columns("IS_READ_ONLY") Me.columnIS_VISIBLE = MyBase.Columns("IS_VISIBLE") Me.columnORDER_KEY = MyBase.Columns("ORDER_KEY") Me.columnFUNCTION_ID = MyBase.Columns("FUNCTION_ID") Me.columnIS_REQUIRED = MyBase.Columns("IS_REQUIRED") Me.columnXML_TABLE_ID = MyBase.Columns("XML_TABLE_ID") Me.columnIS_VIRTUAL = MyBase.Columns("IS_VIRTUAL") Me.columnFUNCTION_PARAMETERS = MyBase.Columns("FUNCTION_PARAMETERS") Me.columnADDED_WHO = MyBase.Columns("ADDED_WHO") Me.columnADDED_WHEN = MyBase.Columns("ADDED_WHEN") Me.columnCHANGED_WHO = MyBase.Columns("CHANGED_WHO") Me.columnCHANGED_WHEN = MyBase.Columns("CHANGED_WHEN") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnXML_NAME = New Global.System.Data.DataColumn("XML_NAME", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnXML_NAME) Me.columnXML_TYPE_ID = New Global.System.Data.DataColumn("XML_TYPE_ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnXML_TYPE_ID) Me.columnIS_READ_ONLY = New Global.System.Data.DataColumn("IS_READ_ONLY", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIS_READ_ONLY) Me.columnIS_VISIBLE = New Global.System.Data.DataColumn("IS_VISIBLE", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIS_VISIBLE) Me.columnORDER_KEY = New Global.System.Data.DataColumn("ORDER_KEY", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnORDER_KEY) Me.columnFUNCTION_ID = New Global.System.Data.DataColumn("FUNCTION_ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnFUNCTION_ID) Me.columnIS_REQUIRED = New Global.System.Data.DataColumn("IS_REQUIRED", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIS_REQUIRED) Me.columnXML_TABLE_ID = New Global.System.Data.DataColumn("XML_TABLE_ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnXML_TABLE_ID) Me.columnIS_VIRTUAL = New Global.System.Data.DataColumn("IS_VIRTUAL", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIS_VIRTUAL) Me.columnFUNCTION_PARAMETERS = New Global.System.Data.DataColumn("FUNCTION_PARAMETERS", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnFUNCTION_PARAMETERS) Me.columnADDED_WHO = New Global.System.Data.DataColumn("ADDED_WHO", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnADDED_WHO) Me.columnADDED_WHEN = New Global.System.Data.DataColumn("ADDED_WHEN", GetType(Date), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnADDED_WHEN) Me.columnCHANGED_WHO = New Global.System.Data.DataColumn("CHANGED_WHO", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCHANGED_WHO) Me.columnCHANGED_WHEN = New Global.System.Data.DataColumn("CHANGED_WHEN", GetType(Date), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCHANGED_WHEN) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnGUID}, true)) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnGUID.Unique = true Me.columnXML_NAME.AllowDBNull = false Me.columnXML_NAME.MaxLength = 50 Me.columnXML_TYPE_ID.AllowDBNull = false Me.columnIS_READ_ONLY.AllowDBNull = false Me.columnIS_VISIBLE.AllowDBNull = false Me.columnORDER_KEY.AllowDBNull = false Me.columnIS_REQUIRED.AllowDBNull = false Me.columnXML_TABLE_ID.AllowDBNull = false Me.columnIS_VIRTUAL.AllowDBNull = false Me.columnFUNCTION_PARAMETERS.MaxLength = 2147483647 Me.columnADDED_WHO.AllowDBNull = false Me.columnADDED_WHO.MaxLength = 50 Me.columnCHANGED_WHO.MaxLength = 50 End Sub _ Public Function NewTBEDI_XML_ITEMSRow() As TBEDI_XML_ITEMSRow Return CType(Me.NewRow,TBEDI_XML_ITEMSRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_ITEMSRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_ITEMSRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_ITEMSRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_ITEMSRowChanged(Me, New TBEDI_XML_ITEMSRowChangeEvent(CType(e.Row,TBEDI_XML_ITEMSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_ITEMSRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_ITEMSRowChanging(Me, New TBEDI_XML_ITEMSRowChangeEvent(CType(e.Row,TBEDI_XML_ITEMSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_ITEMSRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_ITEMSRowDeleted(Me, New TBEDI_XML_ITEMSRowChangeEvent(CType(e.Row,TBEDI_XML_ITEMSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_ITEMSRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_ITEMSRowDeleting(Me, New TBEDI_XML_ITEMSRowChangeEvent(CType(e.Row,TBEDI_XML_ITEMSRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_ITEMSRow(ByVal row As TBEDI_XML_ITEMSRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_ITEMSDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_TYPESDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_TYPESRow) Private columnGUID As Global.System.Data.DataColumn Private columnNAME As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_TYPES" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property NAMEColumn() As Global.System.Data.DataColumn Get Return Me.columnNAME End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_TYPESRow Get Return CType(Me.Rows(index),TBEDI_XML_TYPESRow) End Get End Property _ Public Event TBEDI_XML_TYPESRowChanging As TBEDI_XML_TYPESRowChangeEventHandler _ Public Event TBEDI_XML_TYPESRowChanged As TBEDI_XML_TYPESRowChangeEventHandler _ Public Event TBEDI_XML_TYPESRowDeleting As TBEDI_XML_TYPESRowChangeEventHandler _ Public Event TBEDI_XML_TYPESRowDeleted As TBEDI_XML_TYPESRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_TYPESRow(ByVal row As TBEDI_XML_TYPESRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_TYPESRow(ByVal NAME As String) As TBEDI_XML_TYPESRow Dim rowTBEDI_XML_TYPESRow As TBEDI_XML_TYPESRow = CType(Me.NewRow,TBEDI_XML_TYPESRow) Dim columnValuesArray() As Object = New Object() {Nothing, NAME} rowTBEDI_XML_TYPESRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_TYPESRow) Return rowTBEDI_XML_TYPESRow End Function _ Public Function FindByGUID(ByVal GUID As Integer) As TBEDI_XML_TYPESRow Return CType(Me.Rows.Find(New Object() {GUID}),TBEDI_XML_TYPESRow) End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_TYPESDataTable = CType(MyBase.Clone,TBEDI_XML_TYPESDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_TYPESDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnNAME = MyBase.Columns("NAME") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnNAME = New Global.System.Data.DataColumn("NAME", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnNAME) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnGUID}, true)) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnGUID.Unique = true Me.columnNAME.AllowDBNull = false Me.columnNAME.MaxLength = 20 End Sub _ Public Function NewTBEDI_XML_TYPESRow() As TBEDI_XML_TYPESRow Return CType(Me.NewRow,TBEDI_XML_TYPESRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_TYPESRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_TYPESRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_TYPESRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TYPESRowChanged(Me, New TBEDI_XML_TYPESRowChangeEvent(CType(e.Row,TBEDI_XML_TYPESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_TYPESRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TYPESRowChanging(Me, New TBEDI_XML_TYPESRowChangeEvent(CType(e.Row,TBEDI_XML_TYPESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_TYPESRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TYPESRowDeleted(Me, New TBEDI_XML_TYPESRowChangeEvent(CType(e.Row,TBEDI_XML_TYPESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_TYPESRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TYPESRowDeleting(Me, New TBEDI_XML_TYPESRowChangeEvent(CType(e.Row,TBEDI_XML_TYPESRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_TYPESRow(ByVal row As TBEDI_XML_TYPESRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_TYPESDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_TEMPLATESDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_TEMPLATESRow) Private columnGUID As Global.System.Data.DataColumn Private columnNAME As Global.System.Data.DataColumn Private columnDESCRIPTION As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_TEMPLATES" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property NAMEColumn() As Global.System.Data.DataColumn Get Return Me.columnNAME End Get End Property _ Public ReadOnly Property DESCRIPTIONColumn() As Global.System.Data.DataColumn Get Return Me.columnDESCRIPTION End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_TEMPLATESRow Get Return CType(Me.Rows(index),TBEDI_XML_TEMPLATESRow) End Get End Property _ Public Event TBEDI_XML_TEMPLATESRowChanging As TBEDI_XML_TEMPLATESRowChangeEventHandler _ Public Event TBEDI_XML_TEMPLATESRowChanged As TBEDI_XML_TEMPLATESRowChangeEventHandler _ Public Event TBEDI_XML_TEMPLATESRowDeleting As TBEDI_XML_TEMPLATESRowChangeEventHandler _ Public Event TBEDI_XML_TEMPLATESRowDeleted As TBEDI_XML_TEMPLATESRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_TEMPLATESRow(ByVal row As TBEDI_XML_TEMPLATESRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_TEMPLATESRow(ByVal NAME As String, ByVal DESCRIPTION As String) As TBEDI_XML_TEMPLATESRow Dim rowTBEDI_XML_TEMPLATESRow As TBEDI_XML_TEMPLATESRow = CType(Me.NewRow,TBEDI_XML_TEMPLATESRow) Dim columnValuesArray() As Object = New Object() {Nothing, NAME, DESCRIPTION} rowTBEDI_XML_TEMPLATESRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_TEMPLATESRow) Return rowTBEDI_XML_TEMPLATESRow End Function _ Public Function FindByGUID(ByVal GUID As Integer) As TBEDI_XML_TEMPLATESRow Return CType(Me.Rows.Find(New Object() {GUID}),TBEDI_XML_TEMPLATESRow) End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_TEMPLATESDataTable = CType(MyBase.Clone,TBEDI_XML_TEMPLATESDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_TEMPLATESDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnNAME = MyBase.Columns("NAME") Me.columnDESCRIPTION = MyBase.Columns("DESCRIPTION") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnNAME = New Global.System.Data.DataColumn("NAME", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnNAME) Me.columnDESCRIPTION = New Global.System.Data.DataColumn("DESCRIPTION", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnDESCRIPTION) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnGUID}, true)) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnGUID.Unique = true Me.columnNAME.AllowDBNull = false Me.columnNAME.MaxLength = 20 Me.columnDESCRIPTION.MaxLength = 2147483647 End Sub _ Public Function NewTBEDI_XML_TEMPLATESRow() As TBEDI_XML_TEMPLATESRow Return CType(Me.NewRow,TBEDI_XML_TEMPLATESRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_TEMPLATESRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_TEMPLATESRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_TEMPLATESRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TEMPLATESRowChanged(Me, New TBEDI_XML_TEMPLATESRowChangeEvent(CType(e.Row,TBEDI_XML_TEMPLATESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_TEMPLATESRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TEMPLATESRowChanging(Me, New TBEDI_XML_TEMPLATESRowChangeEvent(CType(e.Row,TBEDI_XML_TEMPLATESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_TEMPLATESRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TEMPLATESRowDeleted(Me, New TBEDI_XML_TEMPLATESRowChangeEvent(CType(e.Row,TBEDI_XML_TEMPLATESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_TEMPLATESRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_TEMPLATESRowDeleting(Me, New TBEDI_XML_TEMPLATESRowChangeEvent(CType(e.Row,TBEDI_XML_TEMPLATESRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_TEMPLATESRow(ByVal row As TBEDI_XML_TEMPLATESRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_TEMPLATESDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_NODESDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_NODESRow) Private columnGUID As Global.System.Data.DataColumn Private columnNAME As Global.System.Data.DataColumn Private columnTEMPLATE_ID As Global.System.Data.DataColumn Private columnIS_HEAD As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_NODES" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property NAMEColumn() As Global.System.Data.DataColumn Get Return Me.columnNAME End Get End Property _ Public ReadOnly Property TEMPLATE_IDColumn() As Global.System.Data.DataColumn Get Return Me.columnTEMPLATE_ID End Get End Property _ Public ReadOnly Property IS_HEADColumn() As Global.System.Data.DataColumn Get Return Me.columnIS_HEAD End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_NODESRow Get Return CType(Me.Rows(index),TBEDI_XML_NODESRow) End Get End Property _ Public Event TBEDI_XML_NODESRowChanging As TBEDI_XML_NODESRowChangeEventHandler _ Public Event TBEDI_XML_NODESRowChanged As TBEDI_XML_NODESRowChangeEventHandler _ Public Event TBEDI_XML_NODESRowDeleting As TBEDI_XML_NODESRowChangeEventHandler _ Public Event TBEDI_XML_NODESRowDeleted As TBEDI_XML_NODESRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_NODESRow(ByVal row As TBEDI_XML_NODESRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_NODESRow(ByVal NAME As String, ByVal TEMPLATE_ID As Integer, ByVal IS_HEAD As Boolean) As TBEDI_XML_NODESRow Dim rowTBEDI_XML_NODESRow As TBEDI_XML_NODESRow = CType(Me.NewRow,TBEDI_XML_NODESRow) Dim columnValuesArray() As Object = New Object() {Nothing, NAME, TEMPLATE_ID, IS_HEAD} rowTBEDI_XML_NODESRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_NODESRow) Return rowTBEDI_XML_NODESRow End Function _ Public Function FindByGUID(ByVal GUID As Integer) As TBEDI_XML_NODESRow Return CType(Me.Rows.Find(New Object() {GUID}),TBEDI_XML_NODESRow) End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_NODESDataTable = CType(MyBase.Clone,TBEDI_XML_NODESDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_NODESDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnNAME = MyBase.Columns("NAME") Me.columnTEMPLATE_ID = MyBase.Columns("TEMPLATE_ID") Me.columnIS_HEAD = MyBase.Columns("IS_HEAD") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnNAME = New Global.System.Data.DataColumn("NAME", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnNAME) Me.columnTEMPLATE_ID = New Global.System.Data.DataColumn("TEMPLATE_ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnTEMPLATE_ID) Me.columnIS_HEAD = New Global.System.Data.DataColumn("IS_HEAD", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIS_HEAD) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnGUID}, true)) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnGUID.Unique = true Me.columnNAME.AllowDBNull = false Me.columnNAME.MaxLength = 2147483647 Me.columnTEMPLATE_ID.AllowDBNull = false Me.columnIS_HEAD.AllowDBNull = false End Sub _ Public Function NewTBEDI_XML_NODESRow() As TBEDI_XML_NODESRow Return CType(Me.NewRow,TBEDI_XML_NODESRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_NODESRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_NODESRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_NODESRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_NODESRowChanged(Me, New TBEDI_XML_NODESRowChangeEvent(CType(e.Row,TBEDI_XML_NODESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_NODESRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_NODESRowChanging(Me, New TBEDI_XML_NODESRowChangeEvent(CType(e.Row,TBEDI_XML_NODESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_NODESRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_NODESRowDeleted(Me, New TBEDI_XML_NODESRowChangeEvent(CType(e.Row,TBEDI_XML_NODESRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_NODESRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_NODESRowDeleting(Me, New TBEDI_XML_NODESRowChangeEvent(CType(e.Row,TBEDI_XML_NODESRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_NODESRow(ByVal row As TBEDI_XML_NODESRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_NODESDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_FUNCTIONSDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_FUNCTIONSRow) Private columnGUID As Global.System.Data.DataColumn Private columnNAME As Global.System.Data.DataColumn Private columnDESCRIPTION As Global.System.Data.DataColumn Private columnPARAMETERS As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_FUNCTIONS" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property NAMEColumn() As Global.System.Data.DataColumn Get Return Me.columnNAME End Get End Property _ Public ReadOnly Property DESCRIPTIONColumn() As Global.System.Data.DataColumn Get Return Me.columnDESCRIPTION End Get End Property _ Public ReadOnly Property PARAMETERSColumn() As Global.System.Data.DataColumn Get Return Me.columnPARAMETERS End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_FUNCTIONSRow Get Return CType(Me.Rows(index),TBEDI_XML_FUNCTIONSRow) End Get End Property _ Public Event TBEDI_XML_FUNCTIONSRowChanging As TBEDI_XML_FUNCTIONSRowChangeEventHandler _ Public Event TBEDI_XML_FUNCTIONSRowChanged As TBEDI_XML_FUNCTIONSRowChangeEventHandler _ Public Event TBEDI_XML_FUNCTIONSRowDeleting As TBEDI_XML_FUNCTIONSRowChangeEventHandler _ Public Event TBEDI_XML_FUNCTIONSRowDeleted As TBEDI_XML_FUNCTIONSRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_FUNCTIONSRow(ByVal row As TBEDI_XML_FUNCTIONSRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_FUNCTIONSRow(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal PARAMETERS As String) As TBEDI_XML_FUNCTIONSRow Dim rowTBEDI_XML_FUNCTIONSRow As TBEDI_XML_FUNCTIONSRow = CType(Me.NewRow,TBEDI_XML_FUNCTIONSRow) Dim columnValuesArray() As Object = New Object() {Nothing, NAME, DESCRIPTION, PARAMETERS} rowTBEDI_XML_FUNCTIONSRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_FUNCTIONSRow) Return rowTBEDI_XML_FUNCTIONSRow End Function _ Public Function FindByGUID(ByVal GUID As Integer) As TBEDI_XML_FUNCTIONSRow Return CType(Me.Rows.Find(New Object() {GUID}),TBEDI_XML_FUNCTIONSRow) End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_FUNCTIONSDataTable = CType(MyBase.Clone,TBEDI_XML_FUNCTIONSDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_FUNCTIONSDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnNAME = MyBase.Columns("NAME") Me.columnDESCRIPTION = MyBase.Columns("DESCRIPTION") Me.columnPARAMETERS = MyBase.Columns("PARAMETERS") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnNAME = New Global.System.Data.DataColumn("NAME", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnNAME) Me.columnDESCRIPTION = New Global.System.Data.DataColumn("DESCRIPTION", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnDESCRIPTION) Me.columnPARAMETERS = New Global.System.Data.DataColumn("PARAMETERS", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnPARAMETERS) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnGUID}, true)) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnGUID.Unique = true Me.columnNAME.AllowDBNull = false Me.columnNAME.MaxLength = 2147483647 Me.columnDESCRIPTION.AllowDBNull = false Me.columnDESCRIPTION.MaxLength = 2147483647 Me.columnPARAMETERS.MaxLength = 2147483647 End Sub _ Public Function NewTBEDI_XML_FUNCTIONSRow() As TBEDI_XML_FUNCTIONSRow Return CType(Me.NewRow,TBEDI_XML_FUNCTIONSRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_FUNCTIONSRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_FUNCTIONSRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_FUNCTIONSRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_FUNCTIONSRowChanged(Me, New TBEDI_XML_FUNCTIONSRowChangeEvent(CType(e.Row,TBEDI_XML_FUNCTIONSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_FUNCTIONSRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_FUNCTIONSRowChanging(Me, New TBEDI_XML_FUNCTIONSRowChangeEvent(CType(e.Row,TBEDI_XML_FUNCTIONSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_FUNCTIONSRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_FUNCTIONSRowDeleted(Me, New TBEDI_XML_FUNCTIONSRowChangeEvent(CType(e.Row,TBEDI_XML_FUNCTIONSRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_FUNCTIONSRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_FUNCTIONSRowDeleting(Me, New TBEDI_XML_FUNCTIONSRowChangeEvent(CType(e.Row,TBEDI_XML_FUNCTIONSRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_FUNCTIONSRow(ByVal row As TBEDI_XML_FUNCTIONSRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_FUNCTIONSDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class TBEDI_XML_CONFIGDataTable Inherits Global.System.Data.TypedTableBase(Of TBEDI_XML_CONFIGRow) Private columnGUID As Global.System.Data.DataColumn Private columnKEY As Global.System.Data.DataColumn Private columnVALUE As Global.System.Data.DataColumn Private columnADDED_WHO As Global.System.Data.DataColumn Private columnADDED_WHEN As Global.System.Data.DataColumn Private columnCHANGED_WHO As Global.System.Data.DataColumn Private columnCHANGED_WHEN As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "TBEDI_XML_CONFIG" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property GUIDColumn() As Global.System.Data.DataColumn Get Return Me.columnGUID End Get End Property _ Public ReadOnly Property KEYColumn() As Global.System.Data.DataColumn Get Return Me.columnKEY End Get End Property _ Public ReadOnly Property VALUEColumn() As Global.System.Data.DataColumn Get Return Me.columnVALUE End Get End Property _ Public ReadOnly Property ADDED_WHOColumn() As Global.System.Data.DataColumn Get Return Me.columnADDED_WHO End Get End Property _ Public ReadOnly Property ADDED_WHENColumn() As Global.System.Data.DataColumn Get Return Me.columnADDED_WHEN End Get End Property _ Public ReadOnly Property CHANGED_WHOColumn() As Global.System.Data.DataColumn Get Return Me.columnCHANGED_WHO End Get End Property _ Public ReadOnly Property CHANGED_WHENColumn() As Global.System.Data.DataColumn Get Return Me.columnCHANGED_WHEN End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As TBEDI_XML_CONFIGRow Get Return CType(Me.Rows(index),TBEDI_XML_CONFIGRow) End Get End Property _ Public Event TBEDI_XML_CONFIGRowChanging As TBEDI_XML_CONFIGRowChangeEventHandler _ Public Event TBEDI_XML_CONFIGRowChanged As TBEDI_XML_CONFIGRowChangeEventHandler _ Public Event TBEDI_XML_CONFIGRowDeleting As TBEDI_XML_CONFIGRowChangeEventHandler _ Public Event TBEDI_XML_CONFIGRowDeleted As TBEDI_XML_CONFIGRowChangeEventHandler _ Public Overloads Sub AddTBEDI_XML_CONFIGRow(ByVal row As TBEDI_XML_CONFIGRow) Me.Rows.Add(row) End Sub _ Public Overloads Function AddTBEDI_XML_CONFIGRow(ByVal KEY As String, ByVal VALUE As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Date, ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Date) As TBEDI_XML_CONFIGRow Dim rowTBEDI_XML_CONFIGRow As TBEDI_XML_CONFIGRow = CType(Me.NewRow,TBEDI_XML_CONFIGRow) Dim columnValuesArray() As Object = New Object() {Nothing, KEY, VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN} rowTBEDI_XML_CONFIGRow.ItemArray = columnValuesArray Me.Rows.Add(rowTBEDI_XML_CONFIGRow) Return rowTBEDI_XML_CONFIGRow End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As TBEDI_XML_CONFIGDataTable = CType(MyBase.Clone,TBEDI_XML_CONFIGDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New TBEDI_XML_CONFIGDataTable() End Function _ Friend Sub InitVars() Me.columnGUID = MyBase.Columns("GUID") Me.columnKEY = MyBase.Columns("KEY") Me.columnVALUE = MyBase.Columns("VALUE") Me.columnADDED_WHO = MyBase.Columns("ADDED_WHO") Me.columnADDED_WHEN = MyBase.Columns("ADDED_WHEN") Me.columnCHANGED_WHO = MyBase.Columns("CHANGED_WHO") Me.columnCHANGED_WHEN = MyBase.Columns("CHANGED_WHEN") End Sub _ Private Sub InitClass() Me.columnGUID = New Global.System.Data.DataColumn("GUID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnGUID) Me.columnKEY = New Global.System.Data.DataColumn("KEY", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnKEY) Me.columnVALUE = New Global.System.Data.DataColumn("VALUE", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnVALUE) Me.columnADDED_WHO = New Global.System.Data.DataColumn("ADDED_WHO", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnADDED_WHO) Me.columnADDED_WHEN = New Global.System.Data.DataColumn("ADDED_WHEN", GetType(Date), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnADDED_WHEN) Me.columnCHANGED_WHO = New Global.System.Data.DataColumn("CHANGED_WHO", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCHANGED_WHO) Me.columnCHANGED_WHEN = New Global.System.Data.DataColumn("CHANGED_WHEN", GetType(Date), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCHANGED_WHEN) Me.columnGUID.AutoIncrement = true Me.columnGUID.AutoIncrementSeed = -1 Me.columnGUID.AutoIncrementStep = -1 Me.columnGUID.AllowDBNull = false Me.columnGUID.ReadOnly = true Me.columnKEY.AllowDBNull = false Me.columnKEY.MaxLength = 100 Me.columnVALUE.AllowDBNull = false Me.columnVALUE.MaxLength = 500 Me.columnADDED_WHO.AllowDBNull = false Me.columnADDED_WHO.MaxLength = 50 Me.columnCHANGED_WHO.MaxLength = 50 End Sub _ Public Function NewTBEDI_XML_CONFIGRow() As TBEDI_XML_CONFIGRow Return CType(Me.NewRow,TBEDI_XML_CONFIGRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New TBEDI_XML_CONFIGRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(TBEDI_XML_CONFIGRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.TBEDI_XML_CONFIGRowChangedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_CONFIGRowChanged(Me, New TBEDI_XML_CONFIGRowChangeEvent(CType(e.Row,TBEDI_XML_CONFIGRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.TBEDI_XML_CONFIGRowChangingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_CONFIGRowChanging(Me, New TBEDI_XML_CONFIGRowChangeEvent(CType(e.Row,TBEDI_XML_CONFIGRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.TBEDI_XML_CONFIGRowDeletedEvent) Is Nothing) Then RaiseEvent TBEDI_XML_CONFIGRowDeleted(Me, New TBEDI_XML_CONFIGRowChangeEvent(CType(e.Row,TBEDI_XML_CONFIGRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.TBEDI_XML_CONFIGRowDeletingEvent) Is Nothing) Then RaiseEvent TBEDI_XML_CONFIGRowDeleting(Me, New TBEDI_XML_CONFIGRowChangeEvent(CType(e.Row,TBEDI_XML_CONFIGRow), e.Action)) End If End Sub _ Public Sub RemoveTBEDI_XML_CONFIGRow(ByVal row As TBEDI_XML_CONFIGRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As DS_DD_ECM = New DS_DD_ECM() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "TBEDI_XML_CONFIGDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_ITEMSRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_ITEMS As TBEDI_XML_ITEMSDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_ITEMS = CType(Me.Table,TBEDI_XML_ITEMSDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_ITEMS.GUIDColumn) = value End Set End Property _ Public Property XML_NAME() As String Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.XML_NAMEColumn),String) End Get Set Me(Me.tableTBEDI_XML_ITEMS.XML_NAMEColumn) = value End Set End Property _ Public Property XML_TYPE_ID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.XML_TYPE_IDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_ITEMS.XML_TYPE_IDColumn) = value End Set End Property _ Public Property IS_READ_ONLY() As Boolean Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.IS_READ_ONLYColumn),Boolean) End Get Set Me(Me.tableTBEDI_XML_ITEMS.IS_READ_ONLYColumn) = value End Set End Property _ Public Property IS_VISIBLE() As Boolean Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.IS_VISIBLEColumn),Boolean) End Get Set Me(Me.tableTBEDI_XML_ITEMS.IS_VISIBLEColumn) = value End Set End Property _ Public Property ORDER_KEY() As Integer Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.ORDER_KEYColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_ITEMS.ORDER_KEYColumn) = value End Set End Property _ Public Property FUNCTION_ID() As Integer Get Try Return CType(Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_IDColumn),Integer) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte FUNCTION_ID in Tabelle TBEDI_XML_ITEMS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_IDColumn) = value End Set End Property _ Public Property IS_REQUIRED() As Boolean Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.IS_REQUIREDColumn),Boolean) End Get Set Me(Me.tableTBEDI_XML_ITEMS.IS_REQUIREDColumn) = value End Set End Property _ Public Property XML_TABLE_ID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.XML_TABLE_IDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_ITEMS.XML_TABLE_IDColumn) = value End Set End Property _ Public Property IS_VIRTUAL() As Boolean Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.IS_VIRTUALColumn),Boolean) End Get Set Me(Me.tableTBEDI_XML_ITEMS.IS_VIRTUALColumn) = value End Set End Property _ Public Property FUNCTION_PARAMETERS() As String Get Try Return CType(Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_PARAMETERSColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte FUNCTION_PARAMETERS in Tabelle TBEDI_XML_ITEMS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_PARAMETERSColumn) = value End Set End Property _ Public Property ADDED_WHO() As String Get Return CType(Me(Me.tableTBEDI_XML_ITEMS.ADDED_WHOColumn),String) End Get Set Me(Me.tableTBEDI_XML_ITEMS.ADDED_WHOColumn) = value End Set End Property _ Public Property ADDED_WHEN() As Date Get Try Return CType(Me(Me.tableTBEDI_XML_ITEMS.ADDED_WHENColumn),Date) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ADDED_WHEN in Tabelle TBEDI_XML_ITEMS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_ITEMS.ADDED_WHENColumn) = value End Set End Property _ Public Property CHANGED_WHO() As String Get Try Return CType(Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHOColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CHANGED_WHO in Tabelle TBEDI_XML_ITEMS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHOColumn) = value End Set End Property _ Public Property CHANGED_WHEN() As Date Get Try Return CType(Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHENColumn),Date) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CHANGED_WHEN in Tabelle TBEDI_XML_ITEMS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHENColumn) = value End Set End Property _ Public Property TBEDI_XML_ITEMSRowParentByFK_TBEDI_XML_TYPES() As TBEDI_XML_ITEMSRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("FK_TBEDI_XML_TYPES")),TBEDI_XML_ITEMSRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("FK_TBEDI_XML_TYPES")) End Set End Property _ Public Property TBEDI_XML_ITEMSRowParentByFK_TBEDI_XML_NODES() As TBEDI_XML_ITEMSRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("FK_TBEDI_XML_NODES")),TBEDI_XML_ITEMSRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("FK_TBEDI_XML_NODES")) End Set End Property _ Public Function IsFUNCTION_IDNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_ITEMS.FUNCTION_IDColumn) End Function _ Public Sub SetFUNCTION_IDNull() Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_IDColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsFUNCTION_PARAMETERSNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_ITEMS.FUNCTION_PARAMETERSColumn) End Function _ Public Sub SetFUNCTION_PARAMETERSNull() Me(Me.tableTBEDI_XML_ITEMS.FUNCTION_PARAMETERSColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsADDED_WHENNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_ITEMS.ADDED_WHENColumn) End Function _ Public Sub SetADDED_WHENNull() Me(Me.tableTBEDI_XML_ITEMS.ADDED_WHENColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsCHANGED_WHONull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_ITEMS.CHANGED_WHOColumn) End Function _ Public Sub SetCHANGED_WHONull() Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHOColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsCHANGED_WHENNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_ITEMS.CHANGED_WHENColumn) End Function _ Public Sub SetCHANGED_WHENNull() Me(Me.tableTBEDI_XML_ITEMS.CHANGED_WHENColumn) = Global.System.Convert.DBNull End Sub _ Public Function GetTBEDI_XML_FUNCTIONSRows() As TBEDI_XML_FUNCTIONSRow() If (Me.Table.ChildRelations("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS") Is Nothing) Then Return New TBEDI_XML_FUNCTIONSRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS")),TBEDI_XML_FUNCTIONSRow()) End If End Function _ Public Function GetTBEDI_XML_TYPESRows() As TBEDI_XML_TYPESRow() If (Me.Table.ChildRelations("TBEDI_XML_ITEMS_TBEDI_XML_TYPES") Is Nothing) Then Return New TBEDI_XML_TYPESRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("TBEDI_XML_ITEMS_TBEDI_XML_TYPES")),TBEDI_XML_TYPESRow()) End If End Function _ Public Function GetTBEDI_XML_ITEMSRowsByFK_TBEDI_XML_TYPES() As TBEDI_XML_ITEMSRow() If (Me.Table.ChildRelations("FK_TBEDI_XML_TYPES") Is Nothing) Then Return New TBEDI_XML_ITEMSRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("FK_TBEDI_XML_TYPES")),TBEDI_XML_ITEMSRow()) End If End Function _ Public Function GetTBEDI_XML_ITEMSRowsByFK_TBEDI_XML_NODES() As TBEDI_XML_ITEMSRow() If (Me.Table.ChildRelations("FK_TBEDI_XML_NODES") Is Nothing) Then Return New TBEDI_XML_ITEMSRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("FK_TBEDI_XML_NODES")),TBEDI_XML_ITEMSRow()) End If End Function End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_TYPESRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_TYPES As TBEDI_XML_TYPESDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_TYPES = CType(Me.Table,TBEDI_XML_TYPESDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_TYPES.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_TYPES.GUIDColumn) = value End Set End Property _ Public Property NAME() As String Get Return CType(Me(Me.tableTBEDI_XML_TYPES.NAMEColumn),String) End Get Set Me(Me.tableTBEDI_XML_TYPES.NAMEColumn) = value End Set End Property _ Public Property TBEDI_XML_ITEMSRow() As TBEDI_XML_ITEMSRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("TBEDI_XML_ITEMS_TBEDI_XML_TYPES")),TBEDI_XML_ITEMSRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("TBEDI_XML_ITEMS_TBEDI_XML_TYPES")) End Set End Property End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_TEMPLATESRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_TEMPLATES As TBEDI_XML_TEMPLATESDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_TEMPLATES = CType(Me.Table,TBEDI_XML_TEMPLATESDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_TEMPLATES.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_TEMPLATES.GUIDColumn) = value End Set End Property _ Public Property NAME() As String Get Return CType(Me(Me.tableTBEDI_XML_TEMPLATES.NAMEColumn),String) End Get Set Me(Me.tableTBEDI_XML_TEMPLATES.NAMEColumn) = value End Set End Property _ Public Property DESCRIPTION() As String Get Try Return CType(Me(Me.tableTBEDI_XML_TEMPLATES.DESCRIPTIONColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte DESCRIPTION in Tabelle TBEDI_XML_TEMPLATES ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_TEMPLATES.DESCRIPTIONColumn) = value End Set End Property _ Public Property TBEDI_XML_NODESRow() As TBEDI_XML_NODESRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES")),TBEDI_XML_NODESRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES")) End Set End Property _ Public Function IsDESCRIPTIONNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_TEMPLATES.DESCRIPTIONColumn) End Function _ Public Sub SetDESCRIPTIONNull() Me(Me.tableTBEDI_XML_TEMPLATES.DESCRIPTIONColumn) = Global.System.Convert.DBNull End Sub End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_NODESRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_NODES As TBEDI_XML_NODESDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_NODES = CType(Me.Table,TBEDI_XML_NODESDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_NODES.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_NODES.GUIDColumn) = value End Set End Property _ Public Property NAME() As String Get Return CType(Me(Me.tableTBEDI_XML_NODES.NAMEColumn),String) End Get Set Me(Me.tableTBEDI_XML_NODES.NAMEColumn) = value End Set End Property _ Public Property TEMPLATE_ID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_NODES.TEMPLATE_IDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_NODES.TEMPLATE_IDColumn) = value End Set End Property _ Public Property IS_HEAD() As Boolean Get Return CType(Me(Me.tableTBEDI_XML_NODES.IS_HEADColumn),Boolean) End Get Set Me(Me.tableTBEDI_XML_NODES.IS_HEADColumn) = value End Set End Property _ Public Function GetTBEDI_XML_TEMPLATESRows() As TBEDI_XML_TEMPLATESRow() If (Me.Table.ChildRelations("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES") Is Nothing) Then Return New TBEDI_XML_TEMPLATESRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("TBEDI_XML_NODES_TBEDI_XML_TEMPLATES")),TBEDI_XML_TEMPLATESRow()) End If End Function End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_FUNCTIONSRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_FUNCTIONS As TBEDI_XML_FUNCTIONSDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_FUNCTIONS = CType(Me.Table,TBEDI_XML_FUNCTIONSDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_FUNCTIONS.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_FUNCTIONS.GUIDColumn) = value End Set End Property _ Public Property NAME() As String Get Return CType(Me(Me.tableTBEDI_XML_FUNCTIONS.NAMEColumn),String) End Get Set Me(Me.tableTBEDI_XML_FUNCTIONS.NAMEColumn) = value End Set End Property _ Public Property DESCRIPTION() As String Get Return CType(Me(Me.tableTBEDI_XML_FUNCTIONS.DESCRIPTIONColumn),String) End Get Set Me(Me.tableTBEDI_XML_FUNCTIONS.DESCRIPTIONColumn) = value End Set End Property _ Public Property PARAMETERS() As String Get Try Return CType(Me(Me.tableTBEDI_XML_FUNCTIONS.PARAMETERSColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte PARAMETERS in Tabelle TBEDI_XML_FUNCTIONS ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_FUNCTIONS.PARAMETERSColumn) = value End Set End Property _ Public Property TBEDI_XML_ITEMSRow() As TBEDI_XML_ITEMSRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS")),TBEDI_XML_ITEMSRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("TBEDI_XML_ITEMS_TBEDI_XML_FUNCTIONS")) End Set End Property _ Public Function IsPARAMETERSNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_FUNCTIONS.PARAMETERSColumn) End Function _ Public Sub SetPARAMETERSNull() Me(Me.tableTBEDI_XML_FUNCTIONS.PARAMETERSColumn) = Global.System.Convert.DBNull End Sub End Class ''' '''Represents strongly named DataRow class. ''' Partial Public Class TBEDI_XML_CONFIGRow Inherits Global.System.Data.DataRow Private tableTBEDI_XML_CONFIG As TBEDI_XML_CONFIGDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableTBEDI_XML_CONFIG = CType(Me.Table,TBEDI_XML_CONFIGDataTable) End Sub _ Public Property GUID() As Integer Get Return CType(Me(Me.tableTBEDI_XML_CONFIG.GUIDColumn),Integer) End Get Set Me(Me.tableTBEDI_XML_CONFIG.GUIDColumn) = value End Set End Property _ Public Property KEY() As String Get Return CType(Me(Me.tableTBEDI_XML_CONFIG.KEYColumn),String) End Get Set Me(Me.tableTBEDI_XML_CONFIG.KEYColumn) = value End Set End Property _ Public Property VALUE() As String Get Return CType(Me(Me.tableTBEDI_XML_CONFIG.VALUEColumn),String) End Get Set Me(Me.tableTBEDI_XML_CONFIG.VALUEColumn) = value End Set End Property _ Public Property ADDED_WHO() As String Get Return CType(Me(Me.tableTBEDI_XML_CONFIG.ADDED_WHOColumn),String) End Get Set Me(Me.tableTBEDI_XML_CONFIG.ADDED_WHOColumn) = value End Set End Property _ Public Property ADDED_WHEN() As Date Get Try Return CType(Me(Me.tableTBEDI_XML_CONFIG.ADDED_WHENColumn),Date) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ADDED_WHEN in Tabelle TBEDI_XML_CONFIG ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_CONFIG.ADDED_WHENColumn) = value End Set End Property _ Public Property CHANGED_WHO() As String Get Try Return CType(Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHOColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CHANGED_WHO in Tabelle TBEDI_XML_CONFIG ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHOColumn) = value End Set End Property _ Public Property CHANGED_WHEN() As Date Get Try Return CType(Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHENColumn),Date) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CHANGED_WHEN in Tabelle TBEDI_XML_CONFIG ist DBNull.", e) End Try End Get Set Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHENColumn) = value End Set End Property _ Public Function IsADDED_WHENNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_CONFIG.ADDED_WHENColumn) End Function _ Public Sub SetADDED_WHENNull() Me(Me.tableTBEDI_XML_CONFIG.ADDED_WHENColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsCHANGED_WHONull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_CONFIG.CHANGED_WHOColumn) End Function _ Public Sub SetCHANGED_WHONull() Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHOColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsCHANGED_WHENNull() As Boolean Return Me.IsNull(Me.tableTBEDI_XML_CONFIG.CHANGED_WHENColumn) End Function _ Public Sub SetCHANGED_WHENNull() Me(Me.tableTBEDI_XML_CONFIG.CHANGED_WHENColumn) = Global.System.Convert.DBNull End Sub End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_ITEMSRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_ITEMSRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_ITEMSRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_ITEMSRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_TYPESRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_TYPESRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_TYPESRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_TYPESRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_TEMPLATESRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_TEMPLATESRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_TEMPLATESRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_TEMPLATESRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_NODESRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_NODESRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_NODESRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_NODESRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_FUNCTIONSRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_FUNCTIONSRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_FUNCTIONSRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_FUNCTIONSRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class TBEDI_XML_CONFIGRowChangeEvent Inherits Global.System.EventArgs Private eventRow As TBEDI_XML_CONFIGRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As TBEDI_XML_CONFIGRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As TBEDI_XML_CONFIGRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace DS_DD_ECMTableAdapters ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_ITEMSTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_ITEMS" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("XML_NAME", "XML_NAME") tableMapping.ColumnMappings.Add("XML_TYPE_ID", "XML_TYPE_ID") tableMapping.ColumnMappings.Add("IS_READ_ONLY", "IS_READ_ONLY") tableMapping.ColumnMappings.Add("IS_VISIBLE", "IS_VISIBLE") tableMapping.ColumnMappings.Add("ORDER_KEY", "ORDER_KEY") tableMapping.ColumnMappings.Add("FUNCTION_ID", "FUNCTION_ID") tableMapping.ColumnMappings.Add("IS_REQUIRED", "IS_REQUIRED") tableMapping.ColumnMappings.Add("XML_TABLE_ID", "XML_TABLE_ID") tableMapping.ColumnMappings.Add("IS_VIRTUAL", "IS_VIRTUAL") tableMapping.ColumnMappings.Add("FUNCTION_PARAMETERS", "FUNCTION_PARAMETERS") tableMapping.ColumnMappings.Add("ADDED_WHO", "ADDED_WHO") tableMapping.ColumnMappings.Add("ADDED_WHEN", "ADDED_WHEN") tableMapping.ColumnMappings.Add("CHANGED_WHO", "CHANGED_WHO") tableMapping.ColumnMappings.Add("CHANGED_WHEN", "CHANGED_WHEN") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBEDI_XML_ITEMS"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @Original_GUID)" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [TBEDI_XML_ITEMS] ([ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE"& _ "_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], "& _ "[FUNCTION_PARAMETERS], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN])"& _ " VALUES (@ORDER_KEY, @XML_NAME, @XML_TABLE_ID, @XML_TYPE_ID, @IS_READ_ONLY, @IS_"& _ "VISIBLE, @IS_REQUIRED, @IS_VIRTUAL, @FUNCTION_ID, @FUNCTION_PARAMETERS, @ADDED_W"& _ "HO, @ADDED_WHEN, @CHANGED_WHO, @CHANGED_WHEN);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, ORDER_KEY, XML_NAME"& _ ", XML_TABLE_ID, XML_TYPE_ID, IS_READ_ONLY, IS_VISIBLE, IS_REQUIRED, IS_VIRTUAL, "& _ "FUNCTION_ID, FUNCTION_PARAMETERS, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WH"& _ "EN FROM TBEDI_XML_ITEMS WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ORDER_KEY", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ORDER_KEY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_TABLE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_TABLE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_TYPE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_TYPE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_READ_ONLY", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_READ_ONLY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_VISIBLE", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_VISIBLE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_REQUIRED", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_REQUIRED", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_VIRTUAL", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_VIRTUAL", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FUNCTION_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "FUNCTION_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FUNCTION_PARAMETERS", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "FUNCTION_PARAMETERS", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHO", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE TBEDI_XML_ITEMS"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SET ORDER_KEY = @ORDER_KEY, XML_NAME"& _ " = @XML_NAME, XML_TABLE_ID = @XML_TABLE_ID, XML_TYPE_ID = @XML_TYPE_ID, IS_READ_"& _ "ONLY = @IS_READ_ONLY, IS_VISIBLE = @IS_VISIBLE, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" IS_RE"& _ "QUIRED = @IS_REQUIRED, IS_VIRTUAL = @IS_VIRTUAL, FUNCTION_ID = @FUNCTION_ID, FUN"& _ "CTION_PARAMETERS = @FUNCTION_PARAMETERS, ADDED_WHO = @ADDED_WHO, ADDED_WHEN = @A"& _ "DDED_WHEN, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" CHANGED_WHO = @CHANGED_WHO, CHANGED_WHEN ="& _ " @CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @Original_GUID); "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, ORDER_KEY, "& _ "XML_NAME, XML_TABLE_ID, XML_TYPE_ID, IS_READ_ONLY, IS_VISIBLE, IS_REQUIRED, IS_V"& _ "IRTUAL, FUNCTION_ID, FUNCTION_PARAMETERS, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CH"& _ "ANGED_WHEN FROM TBEDI_XML_ITEMS WHERE (GUID = @GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ORDER_KEY", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "ORDER_KEY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_NAME", Global.System.Data.SqlDbType.NVarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_TABLE_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_TABLE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@XML_TYPE_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "XML_TYPE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_READ_ONLY", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_READ_ONLY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_VISIBLE", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_VISIBLE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_REQUIRED", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_REQUIRED", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_VIRTUAL", Global.System.Data.SqlDbType.Bit, 1, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_VIRTUAL", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FUNCTION_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "FUNCTION_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@FUNCTION_PARAMETERS", Global.System.Data.SqlDbType.NVarChar, 2147483647, Global.System.Data.ParameterDirection.Input, 0, 0, "FUNCTION_PARAMETERS", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.NVarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 8, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHO", Global.System.Data.SqlDbType.NVarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 8, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT TBEDI_XML_ITEMS.*"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBEDI_XML_ITEMS" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_ITEMSDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_ITEMSDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_ITEMSDataTable = New DS_DD_ECM.TBEDI_XML_ITEMSDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_ITEMSDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_ITEMS") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal ORDER_KEY As Integer, ByVal XML_NAME As String, ByVal XML_TABLE_ID As Integer, ByVal XML_TYPE_ID As Integer, ByVal IS_READ_ONLY As Boolean, ByVal IS_VISIBLE As Boolean, ByVal IS_REQUIRED As Boolean, ByVal IS_VIRTUAL As Boolean, ByVal FUNCTION_ID As Global.System.Nullable(Of Integer), ByVal FUNCTION_PARAMETERS As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Global.System.Nullable(Of Date), ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Global.System.Nullable(Of Date)) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(ORDER_KEY,Integer) If (XML_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("XML_NAME") Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(XML_NAME,String) End If Me.Adapter.InsertCommand.Parameters(2).Value = CType(XML_TABLE_ID,Integer) Me.Adapter.InsertCommand.Parameters(3).Value = CType(XML_TYPE_ID,Integer) Me.Adapter.InsertCommand.Parameters(4).Value = CType(IS_READ_ONLY,Boolean) Me.Adapter.InsertCommand.Parameters(5).Value = CType(IS_VISIBLE,Boolean) Me.Adapter.InsertCommand.Parameters(6).Value = CType(IS_REQUIRED,Boolean) Me.Adapter.InsertCommand.Parameters(7).Value = CType(IS_VIRTUAL,Boolean) If (FUNCTION_ID.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(8).Value = CType(FUNCTION_ID.Value,Integer) Else Me.Adapter.InsertCommand.Parameters(8).Value = Global.System.DBNull.Value End If If (FUNCTION_PARAMETERS Is Nothing) Then Me.Adapter.InsertCommand.Parameters(9).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(9).Value = CType(FUNCTION_PARAMETERS,String) End If If (ADDED_WHO Is Nothing) Then Throw New Global.System.ArgumentNullException("ADDED_WHO") Else Me.Adapter.InsertCommand.Parameters(10).Value = CType(ADDED_WHO,String) End If If (ADDED_WHEN.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(11).Value = CType(ADDED_WHEN.Value,Date) Else Me.Adapter.InsertCommand.Parameters(11).Value = Global.System.DBNull.Value End If If (CHANGED_WHO Is Nothing) Then Me.Adapter.InsertCommand.Parameters(12).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(12).Value = CType(CHANGED_WHO,String) End If If (CHANGED_WHEN.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(13).Value = CType(CHANGED_WHEN.Value,Date) Else Me.Adapter.InsertCommand.Parameters(13).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update( _ ByVal ORDER_KEY As Integer, _ ByVal XML_NAME As String, _ ByVal XML_TABLE_ID As Integer, _ ByVal XML_TYPE_ID As Integer, _ ByVal IS_READ_ONLY As Boolean, _ ByVal IS_VISIBLE As Boolean, _ ByVal IS_REQUIRED As Boolean, _ ByVal IS_VIRTUAL As Boolean, _ ByVal FUNCTION_ID As Global.System.Nullable(Of Integer), _ ByVal FUNCTION_PARAMETERS As String, _ ByVal ADDED_WHO As String, _ ByVal ADDED_WHEN As Global.System.Nullable(Of Date), _ ByVal CHANGED_WHO As String, _ ByVal CHANGED_WHEN As Global.System.Nullable(Of Date), _ ByVal Original_GUID As Integer, _ ByVal GUID As Integer) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(ORDER_KEY,Integer) If (XML_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("XML_NAME") Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(XML_NAME,String) End If Me.Adapter.UpdateCommand.Parameters(2).Value = CType(XML_TABLE_ID,Integer) Me.Adapter.UpdateCommand.Parameters(3).Value = CType(XML_TYPE_ID,Integer) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(IS_READ_ONLY,Boolean) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(IS_VISIBLE,Boolean) Me.Adapter.UpdateCommand.Parameters(6).Value = CType(IS_REQUIRED,Boolean) Me.Adapter.UpdateCommand.Parameters(7).Value = CType(IS_VIRTUAL,Boolean) If (FUNCTION_ID.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(8).Value = CType(FUNCTION_ID.Value,Integer) Else Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value End If If (FUNCTION_PARAMETERS Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(9).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(9).Value = CType(FUNCTION_PARAMETERS,String) End If If (ADDED_WHO Is Nothing) Then Throw New Global.System.ArgumentNullException("ADDED_WHO") Else Me.Adapter.UpdateCommand.Parameters(10).Value = CType(ADDED_WHO,String) End If If (ADDED_WHEN.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(11).Value = CType(ADDED_WHEN.Value,Date) Else Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value End If If (CHANGED_WHO Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(12).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(12).Value = CType(CHANGED_WHO,String) End If If (CHANGED_WHEN.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(13).Value = CType(CHANGED_WHEN.Value,Date) Else Me.Adapter.UpdateCommand.Parameters(13).Value = Global.System.DBNull.Value End If Me.Adapter.UpdateCommand.Parameters(14).Value = CType(Original_GUID,Integer) Me.Adapter.UpdateCommand.Parameters(15).Value = CType(GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_TYPESTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_TYPES" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("NAME", "NAME") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[TBEDI_XML_TYPES] WHERE (([GUID] = @Original_GUID) AND ([NAME] "& _ "= @Original_NAME))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[TBEDI_XML_TYPES] ([NAME]) VALUES (@NAME);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME F"& _ "ROM TBEDI_XML_TYPES WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[TBEDI_XML_TYPES] SET [NAME] = @NAME WHERE (([GUID] = @Original_GUID"& _ ") AND ([NAME] = @Original_NAME));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME FROM TBEDI_XML_TYPES WHERE "& _ "(GUID = @GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, NAME FROM dbo.TBEDI_XML_TYPES" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_TYPESDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_TYPESDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_TYPESDataTable = New DS_DD_ECM.TBEDI_XML_TYPESDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_TYPESDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_TYPES") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer, ByVal Original_NAME As String) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) If (Original_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_NAME") Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_NAME,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal NAME As String) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(NAME,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal Original_GUID As Integer, ByVal Original_NAME As String, ByVal GUID As Integer) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(NAME,String) End If Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Original_GUID,Integer) If (Original_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_NAME") Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Original_NAME,String) End If Me.Adapter.UpdateCommand.Parameters(3).Value = CType(GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal Original_GUID As Integer, ByVal Original_NAME As String) As Integer Return Me.Update(NAME, Original_GUID, Original_NAME, Original_GUID) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_TEMPLATESTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_TEMPLATES" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("NAME", "NAME") tableMapping.ColumnMappings.Add("DESCRIPTION", "DESCRIPTION") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[TBEDI_XML_TEMPLATES] WHERE (([GUID] = @Original_GUID) AND ([NA"& _ "ME] = @Original_NAME))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[TBEDI_XML_TEMPLATES] ([NAME], [DESCRIPTION]) VALUES (@NAME, @D"& _ "ESCRIPTION);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME, DESCRIPTION FROM TBEDI_XML_TEMPLATES WHERE (GUI"& _ "D = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@DESCRIPTION", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "DESCRIPTION", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[TBEDI_XML_TEMPLATES] SET [NAME] = @NAME, [DESCRIPTION] = @DESCRIPTI"& _ "ON WHERE (([GUID] = @Original_GUID) AND ([NAME] = @Original_NAME));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID"& _ ", NAME, DESCRIPTION FROM TBEDI_XML_TEMPLATES WHERE (GUID = @GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@DESCRIPTION", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "DESCRIPTION", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, NAME, DESCRIPTION FROM dbo.TBEDI_XML_TEMPLATES" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_TEMPLATESDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_TEMPLATESDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_TEMPLATESDataTable = New DS_DD_ECM.TBEDI_XML_TEMPLATESDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_TEMPLATESDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_TEMPLATES") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer, ByVal Original_NAME As String) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) If (Original_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_NAME") Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_NAME,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal NAME As String, ByVal DESCRIPTION As String) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(NAME,String) End If If (DESCRIPTION Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(DESCRIPTION,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal Original_GUID As Integer, ByVal Original_NAME As String, ByVal GUID As Integer) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(NAME,String) End If If (DESCRIPTION Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(DESCRIPTION,String) End If Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Original_GUID,Integer) If (Original_NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_NAME") Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_NAME,String) End If Me.Adapter.UpdateCommand.Parameters(4).Value = CType(GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal Original_GUID As Integer, ByVal Original_NAME As String) As Integer Return Me.Update(NAME, DESCRIPTION, Original_GUID, Original_NAME, Original_GUID) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_NODESTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_NODES" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("NAME", "NAME") tableMapping.ColumnMappings.Add("TEMPLATE_ID", "TEMPLATE_ID") tableMapping.ColumnMappings.Add("IS_HEAD", "IS_HEAD") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[TBEDI_XML_NODES] WHERE (([GUID] = @Original_GUID) AND ([TEMPLA"& _ "TE_ID] = @Original_TEMPLATE_ID) AND ([IS_HEAD] = @Original_IS_HEAD))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_TEMPLATE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "TEMPLATE_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_IS_HEAD", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_HEAD", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[TBEDI_XML_NODES] ([NAME], [TEMPLATE_ID], [IS_HEAD]) VALUES (@N"& _ "AME, @TEMPLATE_ID, @IS_HEAD);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME, TEMPLATE_ID, IS_HEAD FROM TBED"& _ "I_XML_NODES WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@TEMPLATE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "TEMPLATE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_HEAD", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_HEAD", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[TBEDI_XML_NODES] SET [NAME] = @NAME, [TEMPLATE_ID] = @TEMPLATE_ID, "& _ "[IS_HEAD] = @IS_HEAD WHERE (([GUID] = @Original_GUID) AND ([TEMPLATE_ID] = @Orig"& _ "inal_TEMPLATE_ID) AND ([IS_HEAD] = @Original_IS_HEAD));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME, TEMP"& _ "LATE_ID, IS_HEAD FROM TBEDI_XML_NODES WHERE (GUID = @GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@TEMPLATE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "TEMPLATE_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IS_HEAD", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_HEAD", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_TEMPLATE_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "TEMPLATE_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_IS_HEAD", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "IS_HEAD", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, NAME, TEMPLATE_ID, IS_HEAD FROM dbo.TBEDI_XML_NODES" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_NODESDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_NODESDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_NODESDataTable = New DS_DD_ECM.TBEDI_XML_NODESDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_NODESDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_NODES") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer, ByVal Original_TEMPLATE_ID As Integer, ByVal Original_IS_HEAD As Boolean) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_TEMPLATE_ID,Integer) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_IS_HEAD,Boolean) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal NAME As String, ByVal TEMPLATE_ID As Integer, ByVal IS_HEAD As Boolean) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(NAME,String) End If Me.Adapter.InsertCommand.Parameters(1).Value = CType(TEMPLATE_ID,Integer) Me.Adapter.InsertCommand.Parameters(2).Value = CType(IS_HEAD,Boolean) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal TEMPLATE_ID As Integer, ByVal IS_HEAD As Boolean, ByVal Original_GUID As Integer, ByVal Original_TEMPLATE_ID As Integer, ByVal Original_IS_HEAD As Boolean, ByVal GUID As Integer) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(NAME,String) End If Me.Adapter.UpdateCommand.Parameters(1).Value = CType(TEMPLATE_ID,Integer) Me.Adapter.UpdateCommand.Parameters(2).Value = CType(IS_HEAD,Boolean) Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_GUID,Integer) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Original_TEMPLATE_ID,Integer) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_IS_HEAD,Boolean) Me.Adapter.UpdateCommand.Parameters(6).Value = CType(GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal TEMPLATE_ID As Integer, ByVal IS_HEAD As Boolean, ByVal Original_GUID As Integer, ByVal Original_TEMPLATE_ID As Integer, ByVal Original_IS_HEAD As Boolean) As Integer Return Me.Update(NAME, TEMPLATE_ID, IS_HEAD, Original_GUID, Original_TEMPLATE_ID, Original_IS_HEAD, Original_GUID) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_FUNCTIONSTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_FUNCTIONS" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("NAME", "NAME") tableMapping.ColumnMappings.Add("DESCRIPTION", "DESCRIPTION") tableMapping.ColumnMappings.Add("PARAMETERS", "PARAMETERS") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[TBEDI_XML_FUNCTIONS] WHERE (([GUID] = @Original_GUID))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[TBEDI_XML_FUNCTIONS] ([NAME], [DESCRIPTION], [PARAMETERS]) VAL"& _ "UES (@NAME, @DESCRIPTION, @PARAMETERS);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, NAME, DESCRIPTION, PARAMET"& _ "ERS FROM TBEDI_XML_FUNCTIONS WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@DESCRIPTION", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "DESCRIPTION", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@PARAMETERS", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "PARAMETERS", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[TBEDI_XML_FUNCTIONS] SET [NAME] = @NAME, [DESCRIPTION] = @DESCRIPTI"& _ "ON, [PARAMETERS] = @PARAMETERS WHERE (([GUID] = @Original_GUID));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, "& _ "NAME, DESCRIPTION, PARAMETERS FROM TBEDI_XML_FUNCTIONS WHERE (GUID = @GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@DESCRIPTION", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "DESCRIPTION", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@PARAMETERS", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "PARAMETERS", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, NAME, DESCRIPTION, PARAMETERS FROM dbo.TBEDI_XML_FUNCTIONS" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_FUNCTIONSDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_FUNCTIONSDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_FUNCTIONSDataTable = New DS_DD_ECM.TBEDI_XML_FUNCTIONSDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_FUNCTIONSDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_FUNCTIONS") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal PARAMETERS As String) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(NAME,String) End If If (DESCRIPTION Is Nothing) Then Throw New Global.System.ArgumentNullException("DESCRIPTION") Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(DESCRIPTION,String) End If If (PARAMETERS Is Nothing) Then Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(2).Value = CType(PARAMETERS,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal PARAMETERS As String, ByVal Original_GUID As Integer, ByVal GUID As Integer) As Integer If (NAME Is Nothing) Then Throw New Global.System.ArgumentNullException("NAME") Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(NAME,String) End If If (DESCRIPTION Is Nothing) Then Throw New Global.System.ArgumentNullException("DESCRIPTION") Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(DESCRIPTION,String) End If If (PARAMETERS Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(PARAMETERS,String) End If Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_GUID,Integer) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal NAME As String, ByVal DESCRIPTION As String, ByVal PARAMETERS As String, ByVal Original_GUID As Integer) As Integer Return Me.Update(NAME, DESCRIPTION, PARAMETERS, Original_GUID, Original_GUID) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class TBEDI_XML_CONFIGTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _transaction As Global.System.Data.SqlClient.SqlTransaction Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Friend Property Transaction() As Global.System.Data.SqlClient.SqlTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "TBEDI_XML_CONFIG" tableMapping.ColumnMappings.Add("GUID", "GUID") tableMapping.ColumnMappings.Add("KEY", "KEY") tableMapping.ColumnMappings.Add("VALUE", "VALUE") tableMapping.ColumnMappings.Add("ADDED_WHO", "ADDED_WHO") tableMapping.ColumnMappings.Add("ADDED_WHEN", "ADDED_WHEN") tableMapping.ColumnMappings.Add("CHANGED_WHO", "CHANGED_WHO") tableMapping.ColumnMappings.Add("CHANGED_WHEN", "CHANGED_WHEN") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBEDI_XML_CONFIG"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @Original_GUID)" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [TBEDI_XML_CONFIG] ([KEY], [VALUE], [ADDED_WHO], [ADDED_WHEN], [CHANG"& _ "ED_WHO], [CHANGED_WHEN]) VALUES (@KEY, @VALUE, @ADDED_WHO, @ADDED_WHEN, @CHANGED"& _ "_WHO, @CHANGED_WHEN)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@KEY", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "KEY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@VALUE", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "VALUE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHO", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE TBEDI_XML_CONFIG"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SET [KEY] = @KEY, VALUE = @VALUE, A"& _ "DDED_WHO = @ADDED_WHO, ADDED_WHEN = @ADDED_WHEN, CHANGED_WHO = @CHANGED_WHO, CHA"& _ "NGED_WHEN = @CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID = @Original_GUID)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@KEY", Global.System.Data.SqlDbType.NVarChar, 100, Global.System.Data.ParameterDirection.Input, 0, 0, "KEY", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@VALUE", Global.System.Data.SqlDbType.NVarChar, 500, Global.System.Data.ParameterDirection.Input, 0, 0, "VALUE", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.NVarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 8, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHO", Global.System.Data.SqlDbType.NVarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 8, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection() Me._connection.ConnectionString = Global.MultiTool.Form.My.MySettings.Default.DD_ECMConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT GUID, [KEY], VALUE, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHE"& _ "N"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBEDI_XML_CONFIG" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As DS_DD_ECM.TBEDI_XML_CONFIGDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As DS_DD_ECM.TBEDI_XML_CONFIGDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As DS_DD_ECM.TBEDI_XML_CONFIGDataTable = New DS_DD_ECM.TBEDI_XML_CONFIGDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As DS_DD_ECM.TBEDI_XML_CONFIGDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As DS_DD_ECM) As Integer Return Me.Adapter.Update(dataSet, "TBEDI_XML_CONFIG") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal KEY As String, ByVal VALUE As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Global.System.Nullable(Of Date), ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Global.System.Nullable(Of Date)) As Integer If (KEY Is Nothing) Then Throw New Global.System.ArgumentNullException("KEY") Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(KEY,String) End If If (VALUE Is Nothing) Then Throw New Global.System.ArgumentNullException("VALUE") Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(VALUE,String) End If If (ADDED_WHO Is Nothing) Then Throw New Global.System.ArgumentNullException("ADDED_WHO") Else Me.Adapter.InsertCommand.Parameters(2).Value = CType(ADDED_WHO,String) End If If (ADDED_WHEN.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(3).Value = CType(ADDED_WHEN.Value,Date) Else Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value End If If (CHANGED_WHO Is Nothing) Then Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(4).Value = CType(CHANGED_WHO,String) End If If (CHANGED_WHEN.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(5).Value = CType(CHANGED_WHEN.Value,Date) Else Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal KEY As String, ByVal VALUE As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Global.System.Nullable(Of Date), ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Global.System.Nullable(Of Date), ByVal Original_GUID As Integer) As Integer If (KEY Is Nothing) Then Throw New Global.System.ArgumentNullException("KEY") Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(KEY,String) End If If (VALUE Is Nothing) Then Throw New Global.System.ArgumentNullException("VALUE") Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(VALUE,String) End If If (ADDED_WHO Is Nothing) Then Throw New Global.System.ArgumentNullException("ADDED_WHO") Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(ADDED_WHO,String) End If If (ADDED_WHEN.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(3).Value = CType(ADDED_WHEN.Value,Date) Else Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value End If If (CHANGED_WHO Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(4).Value = CType(CHANGED_WHO,String) End If If (CHANGED_WHEN.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(5).Value = CType(CHANGED_WHEN.Value,Date) Else Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value End If Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Original_GUID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function End Class ''' '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios ''' _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tBEDI_XML_ITEMSTableAdapter As TBEDI_XML_ITEMSTableAdapter Private _tBEDI_XML_TYPESTableAdapter As TBEDI_XML_TYPESTableAdapter Private _tBEDI_XML_TEMPLATESTableAdapter As TBEDI_XML_TEMPLATESTableAdapter Private _tBEDI_XML_NODESTableAdapter As TBEDI_XML_NODESTableAdapter Private _tBEDI_XML_FUNCTIONSTableAdapter As TBEDI_XML_FUNCTIONSTableAdapter Private _tBEDI_XML_CONFIGTableAdapter As TBEDI_XML_CONFIGTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property _ Public Property TBEDI_XML_ITEMSTableAdapter() As TBEDI_XML_ITEMSTableAdapter Get Return Me._tBEDI_XML_ITEMSTableAdapter End Get Set Me._tBEDI_XML_ITEMSTableAdapter = value End Set End Property _ Public Property TBEDI_XML_TYPESTableAdapter() As TBEDI_XML_TYPESTableAdapter Get Return Me._tBEDI_XML_TYPESTableAdapter End Get Set Me._tBEDI_XML_TYPESTableAdapter = value End Set End Property _ Public Property TBEDI_XML_TEMPLATESTableAdapter() As TBEDI_XML_TEMPLATESTableAdapter Get Return Me._tBEDI_XML_TEMPLATESTableAdapter End Get Set Me._tBEDI_XML_TEMPLATESTableAdapter = value End Set End Property _ Public Property TBEDI_XML_NODESTableAdapter() As TBEDI_XML_NODESTableAdapter Get Return Me._tBEDI_XML_NODESTableAdapter End Get Set Me._tBEDI_XML_NODESTableAdapter = value End Set End Property _ Public Property TBEDI_XML_FUNCTIONSTableAdapter() As TBEDI_XML_FUNCTIONSTableAdapter Get Return Me._tBEDI_XML_FUNCTIONSTableAdapter End Get Set Me._tBEDI_XML_FUNCTIONSTableAdapter = value End Set End Property _ Public Property TBEDI_XML_CONFIGTableAdapter() As TBEDI_XML_CONFIGTableAdapter Get Return Me._tBEDI_XML_CONFIGTableAdapter End Get Set Me._tBEDI_XML_CONFIGTableAdapter = value End Set End Property _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_ITEMSTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_ITEMSTableAdapter.Connection End If If ((Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_TYPESTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_TYPESTableAdapter.Connection End If If ((Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_TEMPLATESTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_TEMPLATESTableAdapter.Connection End If If ((Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_NODESTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_NODESTableAdapter.Connection End If If ((Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection End If If ((Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) _ AndAlso (Not (Me._tBEDI_XML_CONFIGTableAdapter.Connection) Is Nothing)) Then Return Me._tBEDI_XML_CONFIGTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then count = (count + 1) End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then count = (count + 1) End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then count = (count + 1) End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then count = (count + 1) End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then count = (count + 1) End If If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property ''' '''Update rows in top-down order. ''' _ Private Function UpdateUpdatedRows(ByVal dataSet As DS_DD_ECM, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_ITEMS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then Me.SortSelfReferenceRows(updatedRows, dataSet.Relations("FK_TBEDI_XML_TYPES"), false) 'Note: More than one self-referenced relation found. The generated code may not work correctly. Me.SortSelfReferenceRows(updatedRows, dataSet.Relations("FK_TBEDI_XML_NODES"), false) result = (result + Me._tBEDI_XML_ITEMSTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_NODES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tBEDI_XML_NODESTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TYPES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tBEDI_XML_TYPESTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TEMPLATES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tBEDI_XML_TEMPLATESTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_FUNCTIONS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tBEDI_XML_FUNCTIONSTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_CONFIG.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tBEDI_XML_CONFIGTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function ''' '''Insert rows in top-down order. ''' _ Private Function UpdateInsertedRows(ByVal dataSet As DS_DD_ECM, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_ITEMS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then Me.SortSelfReferenceRows(addedRows, dataSet.Relations("FK_TBEDI_XML_TYPES"), false) 'Note: More than one self-referenced relation found. The generated code may not work correctly. Me.SortSelfReferenceRows(addedRows, dataSet.Relations("FK_TBEDI_XML_NODES"), false) result = (result + Me._tBEDI_XML_ITEMSTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_NODES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tBEDI_XML_NODESTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TYPES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tBEDI_XML_TYPESTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TEMPLATES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tBEDI_XML_TEMPLATESTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_FUNCTIONS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tBEDI_XML_FUNCTIONSTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_CONFIG.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tBEDI_XML_CONFIGTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function ''' '''Delete rows in bottom-up order. ''' _ Private Function UpdateDeletedRows(ByVal dataSet As DS_DD_ECM, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_CONFIG.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tBEDI_XML_CONFIGTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_FUNCTIONS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tBEDI_XML_FUNCTIONSTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TEMPLATES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tBEDI_XML_TEMPLATESTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_TYPES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tBEDI_XML_TYPESTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_NODES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tBEDI_XML_NODESTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBEDI_XML_ITEMS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then Me.SortSelfReferenceRows(deletedRows, dataSet.Relations("FK_TBEDI_XML_TYPES"), true) 'Note: More than one self-referenced relation found. The generated code may not work correctly. Me.SortSelfReferenceRows(deletedRows, dataSet.Relations("FK_TBEDI_XML_NODES"), true) result = (result + Me._tBEDI_XML_ITEMSTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function ''' '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first ''' _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function ''' '''Update all changes to the dataset. ''' _ Public Overridable Function UpdateAll(ByVal dataSet As DS_DD_ECM) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_ITEMSTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If If ((Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_TYPESTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If If ((Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_TEMPLATESTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If If ((Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_NODESTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If If ((Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If If ((Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tBEDI_XML_CONFIGTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("Für alle von einem TableAdapterManager verwalteten Instanzen von TableAdapter mus"& _ "s die gleiche Verbindungszeichenfolge verwendet werden.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager enthält keine Verbindungsinformationen. Legen Sie jede TableA"& _ "dapterManager TableAdapter-Eigenschaft auf eine gültige TableAdapter-Instanz fes"& _ "t.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("Die Transaktion kann nicht gestartet werden. Die aktuelle Datenverbindung unterst"& _ "ützt keine Transaktionen, oder der aktuelle Zustand lässt den Start der Transakt"& _ "ion nicht zu.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_ITEMSTableAdapter, Me._tBEDI_XML_ITEMSTableAdapter.Connection) Me._tBEDI_XML_ITEMSTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_ITEMSTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_ITEMSTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_ITEMSTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_ITEMSTableAdapter.Adapter) End If End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_TYPESTableAdapter, Me._tBEDI_XML_TYPESTableAdapter.Connection) Me._tBEDI_XML_TYPESTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_TYPESTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_TYPESTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_TYPESTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_TYPESTableAdapter.Adapter) End If End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_TEMPLATESTableAdapter, Me._tBEDI_XML_TEMPLATESTableAdapter.Connection) Me._tBEDI_XML_TEMPLATESTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_TEMPLATESTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_TEMPLATESTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_TEMPLATESTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_TEMPLATESTableAdapter.Adapter) End If End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_NODESTableAdapter, Me._tBEDI_XML_NODESTableAdapter.Connection) Me._tBEDI_XML_NODESTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_NODESTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_NODESTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_NODESTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_NODESTableAdapter.Adapter) End If End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_FUNCTIONSTableAdapter, Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection) Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_FUNCTIONSTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_FUNCTIONSTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_FUNCTIONSTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_FUNCTIONSTableAdapter.Adapter) End If End If If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then revertConnections.Add(Me._tBEDI_XML_CONFIGTableAdapter, Me._tBEDI_XML_CONFIGTableAdapter.Connection) Me._tBEDI_XML_CONFIGTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_CONFIGTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction) If Me._tBEDI_XML_CONFIGTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tBEDI_XML_CONFIGTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tBEDI_XML_CONFIGTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tBEDI_XML_ITEMSTableAdapter) Is Nothing) Then Me._tBEDI_XML_ITEMSTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_ITEMSTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_ITEMSTableAdapter.Transaction = Nothing End If If (Not (Me._tBEDI_XML_TYPESTableAdapter) Is Nothing) Then Me._tBEDI_XML_TYPESTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_TYPESTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_TYPESTableAdapter.Transaction = Nothing End If If (Not (Me._tBEDI_XML_TEMPLATESTableAdapter) Is Nothing) Then Me._tBEDI_XML_TEMPLATESTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_TEMPLATESTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_TEMPLATESTableAdapter.Transaction = Nothing End If If (Not (Me._tBEDI_XML_NODESTableAdapter) Is Nothing) Then Me._tBEDI_XML_NODESTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_NODESTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_NODESTableAdapter.Transaction = Nothing End If If (Not (Me._tBEDI_XML_FUNCTIONSTableAdapter) Is Nothing) Then Me._tBEDI_XML_FUNCTIONSTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_FUNCTIONSTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_FUNCTIONSTableAdapter.Transaction = Nothing End If If (Not (Me._tBEDI_XML_CONFIGTableAdapter) Is Nothing) Then Me._tBEDI_XML_CONFIGTableAdapter.Connection = CType(revertConnections(Me._tBEDI_XML_CONFIGTableAdapter),Global.System.Data.SqlClient.SqlConnection) Me._tBEDI_XML_CONFIGTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function ''' '''Update Order Option ''' _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum ''' '''Used to sort self-referenced table's rows ''' _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace