'------------------------------------------------------------------------------
'
' 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 SteuernDataSet
Inherits Global.System.Data.DataSet
Private tableSteuern As SteuernDataTable
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("Steuern")) Is Nothing) Then
MyBase.Tables.Add(New SteuernDataTable(ds.Tables("Steuern")))
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 Steuern() As SteuernDataTable
Get
Return Me.tableSteuern
End Get
End Property
_
Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode
Get
Return Me._schemaSerializationMode
End Get
Set(value As Global.System.Data.SchemaSerializationMode)
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 SteuernDataSet = CType(MyBase.Clone, SteuernDataSet)
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("Steuern")) Is Nothing) Then
MyBase.Tables.Add(New SteuernDataTable(ds.Tables("Steuern")))
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.tableSteuern = CType(MyBase.Tables("Steuern"), SteuernDataTable)
If (initTable = True) Then
If (Not (Me.tableSteuern) Is Nothing) Then
Me.tableSteuern.InitVars()
End If
End If
End Sub
_
Private Sub InitClass()
Me.DataSetName = "SteuernDataSet"
Me.Prefix = ""
Me.Namespace = "http://tempuri.org/SteuernDataSet.xsd"
Me.EnforceConstraints = True
Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
Me.tableSteuern = New SteuernDataTable()
MyBase.Tables.Add(Me.tableSteuern)
End Sub
_
Private Function ShouldSerializeSteuern() 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 SteuernDataSet = New SteuernDataSet()
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 SteuernRowChangeEventHandler(ByVal sender As Object, ByVal e As SteuernRowChangeEvent)
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class SteuernDataTable
Inherits Global.System.Data.TypedTableBase(Of SteuernRow)
Private columnID As Global.System.Data.DataColumn
Private columnDatum As Global.System.Data.DataColumn
Private columnVerkäufer As Global.System.Data.DataColumn
Private columnMaterial As Global.System.Data.DataColumn
Private columnAusVersandkosten As Global.System.Data.DataColumn
Private columnAus_Versandkosten_Verkauf As Global.System.Data.DataColumn
Private columnAus_Kaufpreis As Global.System.Data.DataColumn
Private columnAus_Kaufpreis_Gesamt As Global.System.Data.DataColumn
Private columnBezeichnung As Global.System.Data.DataColumn
Private columnEin_Haus_Verkauf As Global.System.Data.DataColumn
Private columnEin_Versandkosten As Global.System.Data.DataColumn
Private columnEin_Betrag As Global.System.Data.DataColumn
Private columnEin_Betrag_Gesamt As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New()
Me.TableName = "Steuern"
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 IDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnID
End Get
End Property
_
Public ReadOnly Property DatumColumn() As Global.System.Data.DataColumn
Get
Return Me.columnDatum
End Get
End Property
_
Public ReadOnly Property VerkäuferColumn() As Global.System.Data.DataColumn
Get
Return Me.columnVerkäufer
End Get
End Property
_
Public ReadOnly Property MaterialColumn() As Global.System.Data.DataColumn
Get
Return Me.columnMaterial
End Get
End Property
_
Public ReadOnly Property AusVersandkostenColumn() As Global.System.Data.DataColumn
Get
Return Me.columnAusVersandkosten
End Get
End Property
_
Public ReadOnly Property Aus_Versandkosten_VerkaufColumn() As Global.System.Data.DataColumn
Get
Return Me.columnAus_Versandkosten_Verkauf
End Get
End Property
_
Public ReadOnly Property Aus_KaufpreisColumn() As Global.System.Data.DataColumn
Get
Return Me.columnAus_Kaufpreis
End Get
End Property
_
Public ReadOnly Property Aus_Kaufpreis_GesamtColumn() As Global.System.Data.DataColumn
Get
Return Me.columnAus_Kaufpreis_Gesamt
End Get
End Property
_
Public ReadOnly Property BezeichnungColumn() As Global.System.Data.DataColumn
Get
Return Me.columnBezeichnung
End Get
End Property
_
Public ReadOnly Property Ein_Haus_VerkaufColumn() As Global.System.Data.DataColumn
Get
Return Me.columnEin_Haus_Verkauf
End Get
End Property
_
Public ReadOnly Property Ein_VersandkostenColumn() As Global.System.Data.DataColumn
Get
Return Me.columnEin_Versandkosten
End Get
End Property
_
Public ReadOnly Property Ein_BetragColumn() As Global.System.Data.DataColumn
Get
Return Me.columnEin_Betrag
End Get
End Property
_
Public ReadOnly Property Ein_Betrag_GesamtColumn() As Global.System.Data.DataColumn
Get
Return Me.columnEin_Betrag_Gesamt
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Default Public ReadOnly Property Item(ByVal index As Integer) As SteuernRow
Get
Return CType(Me.Rows(index), SteuernRow)
End Get
End Property
_
Public Event SteuernRowChanging As SteuernRowChangeEventHandler
_
Public Event SteuernRowChanged As SteuernRowChangeEventHandler
_
Public Event SteuernRowDeleting As SteuernRowChangeEventHandler
_
Public Event SteuernRowDeleted As SteuernRowChangeEventHandler
_
Public Overloads Sub AddSteuernRow(ByVal row As SteuernRow)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function AddSteuernRow(ByVal Datum As Date, ByVal Verkäufer As String, ByVal Material As String, ByVal AusVersandkosten As Double, ByVal Aus_Versandkosten_Verkauf As Double, ByVal Aus_Kaufpreis As Double, ByVal Aus_Kaufpreis_Gesamt As Double, ByVal Bezeichnung As String, ByVal Ein_Haus_Verkauf As Double, ByVal Ein_Versandkosten As Double, ByVal Ein_Betrag As Double, ByVal Ein_Betrag_Gesamt As Double) As SteuernRow
Dim rowSteuernRow As SteuernRow = CType(Me.NewRow, SteuernRow)
Dim columnValuesArray() As Object = New Object() {Nothing, Datum, Verkäufer, Material, AusVersandkosten, Aus_Versandkosten_Verkauf, Aus_Kaufpreis, Aus_Kaufpreis_Gesamt, Bezeichnung, Ein_Haus_Verkauf, Ein_Versandkosten, Ein_Betrag, Ein_Betrag_Gesamt}
rowSteuernRow.ItemArray = columnValuesArray
Me.Rows.Add(rowSteuernRow)
Return rowSteuernRow
End Function
_
Public Function FindByID(ByVal ID As Integer) As SteuernRow
Return CType(Me.Rows.Find(New Object() {ID}), SteuernRow)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As SteuernDataTable = CType(MyBase.Clone, SteuernDataTable)
cln.InitVars()
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New SteuernDataTable()
End Function
_
Friend Sub InitVars()
Me.columnID = MyBase.Columns("ID")
Me.columnDatum = MyBase.Columns("Datum")
Me.columnVerkäufer = MyBase.Columns("Verkäufer")
Me.columnMaterial = MyBase.Columns("Material")
Me.columnAusVersandkosten = MyBase.Columns("AusVersandkosten")
Me.columnAus_Versandkosten_Verkauf = MyBase.Columns("Aus_Versandkosten_Verkauf")
Me.columnAus_Kaufpreis = MyBase.Columns("Aus_Kaufpreis")
Me.columnAus_Kaufpreis_Gesamt = MyBase.Columns("Aus_Kaufpreis_Gesamt")
Me.columnBezeichnung = MyBase.Columns("Bezeichnung")
Me.columnEin_Haus_Verkauf = MyBase.Columns("Ein_Haus_Verkauf")
Me.columnEin_Versandkosten = MyBase.Columns("Ein_Versandkosten")
Me.columnEin_Betrag = MyBase.Columns("Ein_Betrag")
Me.columnEin_Betrag_Gesamt = MyBase.Columns("Ein_Betrag_Gesamt")
End Sub
_
Private Sub InitClass()
Me.columnID = New Global.System.Data.DataColumn("ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnID)
Me.columnDatum = New Global.System.Data.DataColumn("Datum", GetType(Date), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnDatum)
Me.columnVerkäufer = New Global.System.Data.DataColumn("Verkäufer", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnVerkäufer)
Me.columnMaterial = New Global.System.Data.DataColumn("Material", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnMaterial)
Me.columnAusVersandkosten = New Global.System.Data.DataColumn("AusVersandkosten", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnAusVersandkosten)
Me.columnAus_Versandkosten_Verkauf = New Global.System.Data.DataColumn("Aus_Versandkosten_Verkauf", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnAus_Versandkosten_Verkauf)
Me.columnAus_Kaufpreis = New Global.System.Data.DataColumn("Aus_Kaufpreis", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnAus_Kaufpreis)
Me.columnAus_Kaufpreis_Gesamt = New Global.System.Data.DataColumn("Aus_Kaufpreis_Gesamt", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnAus_Kaufpreis_Gesamt)
Me.columnBezeichnung = New Global.System.Data.DataColumn("Bezeichnung", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnBezeichnung)
Me.columnEin_Haus_Verkauf = New Global.System.Data.DataColumn("Ein_Haus_Verkauf", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEin_Haus_Verkauf)
Me.columnEin_Versandkosten = New Global.System.Data.DataColumn("Ein_Versandkosten", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEin_Versandkosten)
Me.columnEin_Betrag = New Global.System.Data.DataColumn("Ein_Betrag", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEin_Betrag)
Me.columnEin_Betrag_Gesamt = New Global.System.Data.DataColumn("Ein_Betrag_Gesamt", GetType(Double), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEin_Betrag_Gesamt)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnID}, True))
Me.columnID.AutoIncrement = True
Me.columnID.AutoIncrementSeed = -1
Me.columnID.AutoIncrementStep = -1
Me.columnID.AllowDBNull = False
Me.columnID.Unique = True
Me.columnVerkäufer.MaxLength = 536870910
Me.columnMaterial.MaxLength = 536870910
Me.columnAus_Versandkosten_Verkauf.ReadOnly = True
Me.columnBezeichnung.MaxLength = 536870910
End Sub
_
Public Function NewSteuernRow() As SteuernRow
Return CType(Me.NewRow, SteuernRow)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New SteuernRow(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(SteuernRow)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.SteuernRowChangedEvent) Is Nothing) Then
RaiseEvent SteuernRowChanged(Me, New SteuernRowChangeEvent(CType(e.Row, SteuernRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.SteuernRowChangingEvent) Is Nothing) Then
RaiseEvent SteuernRowChanging(Me, New SteuernRowChangeEvent(CType(e.Row, SteuernRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.SteuernRowDeletedEvent) Is Nothing) Then
RaiseEvent SteuernRowDeleted(Me, New SteuernRowChangeEvent(CType(e.Row, SteuernRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.SteuernRowDeletingEvent) Is Nothing) Then
RaiseEvent SteuernRowDeleting(Me, New SteuernRowChangeEvent(CType(e.Row, SteuernRow), e.Action))
End If
End Sub
_
Public Sub RemoveSteuernRow(ByVal row As SteuernRow)
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 SteuernDataSet = New SteuernDataSet()
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 = "SteuernDataTable"
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 SteuernRow
Inherits Global.System.Data.DataRow
Private tableSteuern As SteuernDataTable
_
Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tableSteuern = CType(Me.Table, SteuernDataTable)
End Sub
_
Public Property ID() As Integer
Get
Return CType(Me(Me.tableSteuern.IDColumn), Integer)
End Get
Set(value As Integer)
Me(Me.tableSteuern.IDColumn) = value
End Set
End Property
_
Public Property Datum() As Date
Get
Try
Return CType(Me(Me.tableSteuern.DatumColumn), Date)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Datum in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Date)
Me(Me.tableSteuern.DatumColumn) = value
End Set
End Property
_
Public Property Verkäufer() As String
Get
Try
Return CType(Me(Me.tableSteuern.VerkäuferColumn), String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Verkäufer in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As String)
Me(Me.tableSteuern.VerkäuferColumn) = value
End Set
End Property
_
Public Property Material() As String
Get
Try
Return CType(Me(Me.tableSteuern.MaterialColumn), String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Material in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As String)
Me(Me.tableSteuern.MaterialColumn) = value
End Set
End Property
_
Public Property AusVersandkosten() As Double
Get
Try
Return CType(Me(Me.tableSteuern.AusVersandkostenColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte AusVersandkosten in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.AusVersandkostenColumn) = value
End Set
End Property
_
Public Property Aus_Versandkosten_Verkauf() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Aus_Versandkosten_VerkaufColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Aus_Versandkosten_Verkauf in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Aus_Versandkosten_VerkaufColumn) = value
End Set
End Property
_
Public Property Aus_Kaufpreis() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Aus_KaufpreisColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Aus_Kaufpreis in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Aus_KaufpreisColumn) = value
End Set
End Property
_
Public Property Aus_Kaufpreis_Gesamt() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Aus_Kaufpreis_GesamtColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Aus_Kaufpreis_Gesamt in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Aus_Kaufpreis_GesamtColumn) = value
End Set
End Property
_
Public Property Bezeichnung() As String
Get
Try
Return CType(Me(Me.tableSteuern.BezeichnungColumn), String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Bezeichnung in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As String)
Me(Me.tableSteuern.BezeichnungColumn) = value
End Set
End Property
_
Public Property Ein_Haus_Verkauf() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Ein_Haus_VerkaufColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Ein_Haus_Verkauf in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Ein_Haus_VerkaufColumn) = value
End Set
End Property
_
Public Property Ein_Versandkosten() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Ein_VersandkostenColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Ein_Versandkosten in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Ein_VersandkostenColumn) = value
End Set
End Property
_
Public Property Ein_Betrag() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Ein_BetragColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Ein_Betrag in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Ein_BetragColumn) = value
End Set
End Property
_
Public Property Ein_Betrag_Gesamt() As Double
Get
Try
Return CType(Me(Me.tableSteuern.Ein_Betrag_GesamtColumn), Double)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Ein_Betrag_Gesamt in Tabelle Steuern ist DBNull.", e)
End Try
End Get
Set(value As Double)
Me(Me.tableSteuern.Ein_Betrag_GesamtColumn) = value
End Set
End Property
_
Public Function IsDatumNull() As Boolean
Return Me.IsNull(Me.tableSteuern.DatumColumn)
End Function
_
Public Sub SetDatumNull()
Me(Me.tableSteuern.DatumColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsVerkäuferNull() As Boolean
Return Me.IsNull(Me.tableSteuern.VerkäuferColumn)
End Function
_
Public Sub SetVerkäuferNull()
Me(Me.tableSteuern.VerkäuferColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsMaterialNull() As Boolean
Return Me.IsNull(Me.tableSteuern.MaterialColumn)
End Function
_
Public Sub SetMaterialNull()
Me(Me.tableSteuern.MaterialColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsAusVersandkostenNull() As Boolean
Return Me.IsNull(Me.tableSteuern.AusVersandkostenColumn)
End Function
_
Public Sub SetAusVersandkostenNull()
Me(Me.tableSteuern.AusVersandkostenColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsAus_Versandkosten_VerkaufNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Aus_Versandkosten_VerkaufColumn)
End Function
_
Public Sub SetAus_Versandkosten_VerkaufNull()
Me(Me.tableSteuern.Aus_Versandkosten_VerkaufColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsAus_KaufpreisNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Aus_KaufpreisColumn)
End Function
_
Public Sub SetAus_KaufpreisNull()
Me(Me.tableSteuern.Aus_KaufpreisColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsAus_Kaufpreis_GesamtNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Aus_Kaufpreis_GesamtColumn)
End Function
_
Public Sub SetAus_Kaufpreis_GesamtNull()
Me(Me.tableSteuern.Aus_Kaufpreis_GesamtColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsBezeichnungNull() As Boolean
Return Me.IsNull(Me.tableSteuern.BezeichnungColumn)
End Function
_
Public Sub SetBezeichnungNull()
Me(Me.tableSteuern.BezeichnungColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsEin_Haus_VerkaufNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Ein_Haus_VerkaufColumn)
End Function
_
Public Sub SetEin_Haus_VerkaufNull()
Me(Me.tableSteuern.Ein_Haus_VerkaufColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsEin_VersandkostenNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Ein_VersandkostenColumn)
End Function
_
Public Sub SetEin_VersandkostenNull()
Me(Me.tableSteuern.Ein_VersandkostenColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsEin_BetragNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Ein_BetragColumn)
End Function
_
Public Sub SetEin_BetragNull()
Me(Me.tableSteuern.Ein_BetragColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsEin_Betrag_GesamtNull() As Boolean
Return Me.IsNull(Me.tableSteuern.Ein_Betrag_GesamtColumn)
End Function
_
Public Sub SetEin_Betrag_GesamtNull()
Me(Me.tableSteuern.Ein_Betrag_GesamtColumn) = Global.System.Convert.DBNull
End Sub
End Class
'''
'''Row event argument class
'''
_
Public Class SteuernRowChangeEvent
Inherits Global.System.EventArgs
Private eventRow As SteuernRow
Private eventAction As Global.System.Data.DataRowAction
_
Public Sub New(ByVal row As SteuernRow, ByVal action As Global.System.Data.DataRowAction)
MyBase.New()
Me.eventRow = row
Me.eventAction = action
End Sub
_
Public ReadOnly Property Row() As SteuernRow
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 SteuernDataSetTableAdapters
'''
'''Represents the connection and commands used to retrieve and save data.
'''
_
Partial Public Class SteuernTableAdapter
Inherits Global.System.ComponentModel.Component
Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter
Private _connection As Global.System.Data.OleDb.OleDbConnection
Private _transaction As Global.System.Data.OleDb.OleDbTransaction
Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand
Private _clearBeforeFill As Boolean
_
Public Sub New()
MyBase.New()
Me.ClearBeforeFill = True
End Sub
_
Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter
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.OleDb.OleDbConnection
Get
If (Me._connection Is Nothing) Then
Me.InitConnection()
End If
Return Me._connection
End Get
Set(value As Global.System.Data.OleDb.OleDbConnection)
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.OleDb.OleDbCommand).Connection = value
End If
i = (i + 1)
Loop
End Set
End Property
_
Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction
Get
Return Me._transaction
End Get
Set(value As Global.System.Data.OleDb.OleDbTransaction)
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.OleDb.OleDbCommand()
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(value As Boolean)
Me._clearBeforeFill = value
End Set
End Property
_
Private Sub InitAdapter()
Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter()
Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping()
tableMapping.SourceTable = "Table"
tableMapping.DataSetTable = "Steuern"
tableMapping.ColumnMappings.Add("ID", "ID")
tableMapping.ColumnMappings.Add("Datum", "Datum")
tableMapping.ColumnMappings.Add("Verkäufer", "Verkäufer")
tableMapping.ColumnMappings.Add("Material", "Material")
tableMapping.ColumnMappings.Add("AusVersandkosten", "AusVersandkosten")
tableMapping.ColumnMappings.Add("Aus_Versandkosten_Verkauf", "Aus_Versandkosten_Verkauf")
tableMapping.ColumnMappings.Add("Aus_Kaufpreis", "Aus_Kaufpreis")
tableMapping.ColumnMappings.Add("Aus_Kaufpreis_Gesamt", "Aus_Kaufpreis_Gesamt")
tableMapping.ColumnMappings.Add("Bezeichnung", "Bezeichnung")
tableMapping.ColumnMappings.Add("Ein_Haus_Verkauf", "Ein_Haus_Verkauf")
tableMapping.ColumnMappings.Add("Ein_Versandkosten", "Ein_Versandkosten")
tableMapping.ColumnMappings.Add("Ein_Betrag", "Ein_Betrag")
tableMapping.ColumnMappings.Add("Ein_Betrag_Gesamt", "Ein_Betrag_Gesamt")
Me._adapter.TableMappings.Add(tableMapping)
Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand()
Me._adapter.DeleteCommand.Connection = Me.Connection
Me._adapter.DeleteCommand.CommandText = "DELETE FROM `Steuern` WHERE ((`ID` = ?) AND ((? = 1 AND `Datum` IS NULL) OR (`Dat" & _
"um` = ?)) AND ((? = 1 AND `AusVersandkosten` IS NULL) OR (`AusVersandkosten` = ?" & _
")) AND ((? = 1 AND `Aus_Versandkosten_Verkauf` IS NULL) OR (`Aus_Versandkosten_V" & _
"erkauf` = ?)) AND ((? = 1 AND `Aus_Kaufpreis` IS NULL) OR (`Aus_Kaufpreis` = ?))" & _
" AND ((? = 1 AND `Aus_Kaufpreis_Gesamt` IS NULL) OR (`Aus_Kaufpreis_Gesamt` = ?)" & _
") AND ((? = 1 AND `Ein_Haus_Verkauf` IS NULL) OR (`Ein_Haus_Verkauf` = ?)) AND (" & _
"(? = 1 AND `Ein_Versandkosten` IS NULL) OR (`Ein_Versandkosten` = ?)) AND ((? = " & _
"1 AND `Ein_Betrag` IS NULL) OR (`Ein_Betrag` = ?)) AND ((? = 1 AND `Ein_Betrag_G" & _
"esamt` IS NULL) OR (`Ein_Betrag_Gesamt` = ?)))"
Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Datum", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Datum", Global.System.Data.OleDb.OleDbType.[Date], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand()
Me._adapter.InsertCommand.Connection = Me.Connection
Me._adapter.InsertCommand.CommandText = "INSERT INTO `Steuern` (`Datum`, `Verkäufer`, `Material`, `AusVersandkosten`, `Aus" & _
"_Versandkosten_Verkauf`, `Aus_Kaufpreis`, `Aus_Kaufpreis_Gesamt`, `Bezeichnung`," & _
" `Ein_Haus_Verkauf`, `Ein_Versandkosten`, `Ein_Betrag`, `Ein_Betrag_Gesamt`) VAL" & _
"UES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Datum", Global.System.Data.OleDb.OleDbType.[Date], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Verkäufer", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Verkäufer", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Material", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Material", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Bezeichnung", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Bezeichnung", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand()
Me._adapter.UpdateCommand.Connection = Me.Connection
Me._adapter.UpdateCommand.CommandText = "UPDATE `Steuern` SET `Datum` = ?, `Verkäufer` = ?, `Material` = ?, `AusVersandkos" & _
"ten` = ?, `Aus_Versandkosten_Verkauf` = ?, `Aus_Kaufpreis` = ?, `Aus_Kaufpreis_G" & _
"esamt` = ?, `Bezeichnung` = ?, `Ein_Haus_Verkauf` = ?, `Ein_Versandkosten` = ?, " & _
"`Ein_Betrag` = ?, `Ein_Betrag_Gesamt` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Dat" & _
"um` IS NULL) OR (`Datum` = ?)) AND ((? = 1 AND `AusVersandkosten` IS NULL) OR (`" & _
"AusVersandkosten` = ?)) AND ((? = 1 AND `Aus_Versandkosten_Verkauf` IS NULL) OR " & _
"(`Aus_Versandkosten_Verkauf` = ?)) AND ((? = 1 AND `Aus_Kaufpreis` IS NULL) OR (" & _
"`Aus_Kaufpreis` = ?)) AND ((? = 1 AND `Aus_Kaufpreis_Gesamt` IS NULL) OR (`Aus_K" & _
"aufpreis_Gesamt` = ?)) AND ((? = 1 AND `Ein_Haus_Verkauf` IS NULL) OR (`Ein_Haus" & _
"_Verkauf` = ?)) AND ((? = 1 AND `Ein_Versandkosten` IS NULL) OR (`Ein_Versandkos" & _
"ten` = ?)) AND ((? = 1 AND `Ein_Betrag` IS NULL) OR (`Ein_Betrag` = ?)) AND ((? " & _
"= 1 AND `Ein_Betrag_Gesamt` IS NULL) OR (`Ein_Betrag_Gesamt` = ?)))"
Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Datum", Global.System.Data.OleDb.OleDbType.[Date], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Verkäufer", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Verkäufer", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Material", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Material", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Bezeichnung", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Bezeichnung", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Current, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Datum", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Datum", Global.System.Data.OleDb.OleDbType.[Date], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Datum", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_AusVersandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "AusVersandkosten", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Versandkosten_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Versandkosten_Verkauf", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Kaufpreis", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Aus_Kaufpreis_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Aus_Kaufpreis_Gesamt", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Haus_Verkauf", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Haus_Verkauf", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Versandkosten", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Versandkosten", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Betrag", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag", Global.System.Data.DataRowVersion.Original, False, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Original, True, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Ein_Betrag_Gesamt", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0, Byte), CType(0, Byte), "Ein_Betrag_Gesamt", Global.System.Data.DataRowVersion.Original, False, Nothing))
End Sub
_
Private Sub InitConnection()
Me._connection = New Global.System.Data.OleDb.OleDbConnection()
Me._connection.ConnectionString = Global.Verkauf.My.MySettings.Default.SteuernConnectionString
End Sub
_
Private Sub InitCommandCollection()
Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {}
Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand()
Me._commandCollection(0).Connection = Me.Connection
Me._commandCollection(0).CommandText = "SELECT ID, Datum, Verkäufer, Material, AusVersandkosten, Aus_Versandkosten_Verkau" & _
"f, Aus_Kaufpreis, Aus_Kaufpreis_Gesamt, Bezeichnung, Ein_Haus_Verkauf, Ein_Versa" & _
"ndkosten, Ein_Betrag, Ein_Betrag_Gesamt FROM Steuern"
Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text
End Sub
_
Public Overridable Overloads Function Fill(ByVal dataTable As SteuernDataSet.SteuernDataTable) 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 Overridable Overloads Function GetData() As SteuernDataSet.SteuernDataTable
Me.Adapter.SelectCommand = Me.CommandCollection(0)
Dim dataTable As SteuernDataSet.SteuernDataTable = New SteuernDataSet.SteuernDataTable()
Me.Adapter.Fill(dataTable)
Return dataTable
End Function
_
Public Overridable Overloads Function Update(ByVal dataTable As SteuernDataSet.SteuernDataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function
_
Public Overridable Overloads Function Update(ByVal dataSet As SteuernDataSet) As Integer
Return Me.Adapter.Update(dataSet, "Steuern")
End Function
_
Public Overridable Overloads Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer
Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow})
End Function
_
Public Overridable Overloads Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer
Return Me.Adapter.Update(dataRows)
End Function
_
Public Overridable Overloads Function Delete(ByVal Original_ID As Integer, ByVal Original_Datum As Global.System.Nullable(Of Date), ByVal Original_AusVersandkosten As Global.System.Nullable(Of Double), ByVal Original_Aus_Versandkosten_Verkauf As Global.System.Nullable(Of Double), ByVal Original_Aus_Kaufpreis As Global.System.Nullable(Of Double), ByVal Original_Aus_Kaufpreis_Gesamt As Global.System.Nullable(Of Double), ByVal Original_Ein_Haus_Verkauf As Global.System.Nullable(Of Double), ByVal Original_Ein_Versandkosten As Global.System.Nullable(Of Double), ByVal Original_Ein_Betrag As Global.System.Nullable(Of Double), ByVal Original_Ein_Betrag_Gesamt As Global.System.Nullable(Of Double)) As Integer
Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_ID, Integer)
If (Original_Datum.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Datum.Value, Date)
Else
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (Original_AusVersandkosten.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_AusVersandkosten.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Versandkosten_Verkauf.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(5).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(6).Value = CType(Original_Aus_Versandkosten_Verkauf.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(5).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Kaufpreis.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(7).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(8).Value = CType(Original_Aus_Kaufpreis.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(7).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Kaufpreis_Gesamt.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(9).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(10).Value = CType(Original_Aus_Kaufpreis_Gesamt.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(9).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(10).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Haus_Verkauf.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(11).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(12).Value = CType(Original_Ein_Haus_Verkauf.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(11).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(12).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Versandkosten.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(13).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(14).Value = CType(Original_Ein_Versandkosten.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(13).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(14).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Betrag.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(15).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(16).Value = CType(Original_Ein_Betrag.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(15).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(16).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Betrag_Gesamt.HasValue = True) Then
Me.Adapter.DeleteCommand.Parameters(17).Value = CType(0, Object)
Me.Adapter.DeleteCommand.Parameters(18).Value = CType(Original_Ein_Betrag_Gesamt.Value, Double)
Else
Me.Adapter.DeleteCommand.Parameters(17).Value = CType(1, Object)
Me.Adapter.DeleteCommand.Parameters(18).Value = Global.System.DBNull.Value
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 Overridable Overloads Function Insert(ByVal Datum As Global.System.Nullable(Of Date), ByVal Verkäufer As String, ByVal Material As String, ByVal AusVersandkosten As Global.System.Nullable(Of Double), ByVal Aus_Versandkosten_Verkauf As Global.System.Nullable(Of Double), ByVal Aus_Kaufpreis As Global.System.Nullable(Of Double), ByVal Aus_Kaufpreis_Gesamt As Global.System.Nullable(Of Double), ByVal Bezeichnung As String, ByVal Ein_Haus_Verkauf As Global.System.Nullable(Of Double), ByVal Ein_Versandkosten As Global.System.Nullable(Of Double), ByVal Ein_Betrag As Global.System.Nullable(Of Double), ByVal Ein_Betrag_Gesamt As Global.System.Nullable(Of Double)) As Integer
If (Datum.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(0).Value = CType(Datum.Value, Date)
Else
Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value
End If
If (Verkäufer Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(1).Value = CType(Verkäufer, String)
End If
If (Material Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(2).Value = CType(Material, String)
End If
If (AusVersandkosten.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(3).Value = CType(AusVersandkosten.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value
End If
If (Aus_Versandkosten_Verkauf.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(4).Value = CType(Aus_Versandkosten_Verkauf.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value
End If
If (Aus_Kaufpreis.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(5).Value = CType(Aus_Kaufpreis.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value
End If
If (Aus_Kaufpreis_Gesamt.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(6).Value = CType(Aus_Kaufpreis_Gesamt.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(6).Value = Global.System.DBNull.Value
End If
If (Bezeichnung Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(7).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(7).Value = CType(Bezeichnung, String)
End If
If (Ein_Haus_Verkauf.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(8).Value = CType(Ein_Haus_Verkauf.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (Ein_Versandkosten.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(9).Value = CType(Ein_Versandkosten.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(9).Value = Global.System.DBNull.Value
End If
If (Ein_Betrag.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(10).Value = CType(Ein_Betrag.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(10).Value = Global.System.DBNull.Value
End If
If (Ein_Betrag_Gesamt.HasValue = True) Then
Me.Adapter.InsertCommand.Parameters(11).Value = CType(Ein_Betrag_Gesamt.Value, Double)
Else
Me.Adapter.InsertCommand.Parameters(11).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 Overridable Overloads Function Update( _
ByVal Datum As Global.System.Nullable(Of Date), _
ByVal Verkäufer As String, _
ByVal Material As String, _
ByVal AusVersandkosten As Global.System.Nullable(Of Double), _
ByVal Aus_Versandkosten_Verkauf As Global.System.Nullable(Of Double), _
ByVal Aus_Kaufpreis As Global.System.Nullable(Of Double), _
ByVal Aus_Kaufpreis_Gesamt As Global.System.Nullable(Of Double), _
ByVal Bezeichnung As String, _
ByVal Ein_Haus_Verkauf As Global.System.Nullable(Of Double), _
ByVal Ein_Versandkosten As Global.System.Nullable(Of Double), _
ByVal Ein_Betrag As Global.System.Nullable(Of Double), _
ByVal Ein_Betrag_Gesamt As Global.System.Nullable(Of Double), _
ByVal Original_ID As Integer, _
ByVal Original_Datum As Global.System.Nullable(Of Date), _
ByVal Original_AusVersandkosten As Global.System.Nullable(Of Double), _
ByVal Original_Aus_Versandkosten_Verkauf As Global.System.Nullable(Of Double), _
ByVal Original_Aus_Kaufpreis As Global.System.Nullable(Of Double), _
ByVal Original_Aus_Kaufpreis_Gesamt As Global.System.Nullable(Of Double), _
ByVal Original_Ein_Haus_Verkauf As Global.System.Nullable(Of Double), _
ByVal Original_Ein_Versandkosten As Global.System.Nullable(Of Double), _
ByVal Original_Ein_Betrag As Global.System.Nullable(Of Double), _
ByVal Original_Ein_Betrag_Gesamt As Global.System.Nullable(Of Double)) As Integer
If (Datum.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Datum.Value, Date)
Else
Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value
End If
If (Verkäufer Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Verkäufer, String)
End If
If (Material Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Material, String)
End If
If (AusVersandkosten.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(3).Value = CType(AusVersandkosten.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value
End If
If (Aus_Versandkosten_Verkauf.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Aus_Versandkosten_Verkauf.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value
End If
If (Aus_Kaufpreis.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Aus_Kaufpreis.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value
End If
If (Aus_Kaufpreis_Gesamt.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Aus_Kaufpreis_Gesamt.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value
End If
If (Bezeichnung Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Bezeichnung, String)
End If
If (Ein_Haus_Verkauf.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(8).Value = CType(Ein_Haus_Verkauf.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (Ein_Versandkosten.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(9).Value = CType(Ein_Versandkosten.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(9).Value = Global.System.DBNull.Value
End If
If (Ein_Betrag.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(10).Value = CType(Ein_Betrag.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value
End If
If (Ein_Betrag_Gesamt.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(11).Value = CType(Ein_Betrag_Gesamt.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value
End If
Me.Adapter.UpdateCommand.Parameters(12).Value = CType(Original_ID, Integer)
If (Original_Datum.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(13).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(14).Value = CType(Original_Datum.Value, Date)
Else
Me.Adapter.UpdateCommand.Parameters(13).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(14).Value = Global.System.DBNull.Value
End If
If (Original_AusVersandkosten.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(15).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(16).Value = CType(Original_AusVersandkosten.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(15).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(16).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Versandkosten_Verkauf.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(17).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(18).Value = CType(Original_Aus_Versandkosten_Verkauf.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(17).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(18).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Kaufpreis.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(19).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(20).Value = CType(Original_Aus_Kaufpreis.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(19).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(20).Value = Global.System.DBNull.Value
End If
If (Original_Aus_Kaufpreis_Gesamt.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(21).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(22).Value = CType(Original_Aus_Kaufpreis_Gesamt.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(21).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(22).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Haus_Verkauf.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(23).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(24).Value = CType(Original_Ein_Haus_Verkauf.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(23).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(24).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Versandkosten.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(25).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(26).Value = CType(Original_Ein_Versandkosten.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(25).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(26).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Betrag.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(27).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(28).Value = CType(Original_Ein_Betrag.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(27).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(28).Value = Global.System.DBNull.Value
End If
If (Original_Ein_Betrag_Gesamt.HasValue = True) Then
Me.Adapter.UpdateCommand.Parameters(29).Value = CType(0, Object)
Me.Adapter.UpdateCommand.Parameters(30).Value = CType(Original_Ein_Betrag_Gesamt.Value, Double)
Else
Me.Adapter.UpdateCommand.Parameters(29).Value = CType(1, Object)
Me.Adapter.UpdateCommand.Parameters(30).Value = Global.System.DBNull.Value
End If
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 _steuernTableAdapter As SteuernTableAdapter
Private _backupDataSetBeforeUpdate As Boolean
Private _connection As Global.System.Data.IDbConnection
_
Public Property UpdateOrder() As UpdateOrderOption
Get
Return Me._updateOrder
End Get
Set(value As UpdateOrderOption)
Me._updateOrder = value
End Set
End Property
_
Public Property SteuernTableAdapter() As SteuernTableAdapter
Get
Return Me._steuernTableAdapter
End Get
Set(value As SteuernTableAdapter)
Me._steuernTableAdapter = value
End Set
End Property
_
Public Property BackupDataSetBeforeUpdate() As Boolean
Get
Return Me._backupDataSetBeforeUpdate
End Get
Set(value As Boolean)
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._steuernTableAdapter) Is Nothing) _
AndAlso (Not (Me._steuernTableAdapter.Connection) Is Nothing)) Then
Return Me._steuernTableAdapter.Connection
End If
Return Nothing
End Get
Set(value As Global.System.Data.IDbConnection)
Me._connection = value
End Set
End Property
_
Public ReadOnly Property TableAdapterInstanceCount() As Integer
Get
Dim count As Integer = 0
If (Not (Me._steuernTableAdapter) 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 SteuernDataSet, 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._steuernTableAdapter) Is Nothing) Then
Dim updatedRows() As Global.System.Data.DataRow = dataSet.Steuern.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._steuernTableAdapter.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 SteuernDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
Dim result As Integer = 0
If (Not (Me._steuernTableAdapter) Is Nothing) Then
Dim addedRows() As Global.System.Data.DataRow = dataSet.Steuern.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added)
If ((Not (addedRows) Is Nothing) _
AndAlso (0 < addedRows.Length)) Then
result = (result + Me._steuernTableAdapter.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 SteuernDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
Dim result As Integer = 0
If (Not (Me._steuernTableAdapter) Is Nothing) Then
Dim deletedRows() As Global.System.Data.DataRow = dataSet.Steuern.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted)
If ((Not (deletedRows) Is Nothing) _
AndAlso (0 < deletedRows.Length)) Then
result = (result + Me._steuernTableAdapter.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 SteuernDataSet) 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._steuernTableAdapter) Is Nothing) _
AndAlso (Me.MatchTableAdapterConnection(Me._steuernTableAdapter.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._steuernTableAdapter) Is Nothing) Then
revertConnections.Add(Me._steuernTableAdapter, Me._steuernTableAdapter.Connection)
Me._steuernTableAdapter.Connection = CType(workConnection, Global.System.Data.OleDb.OleDbConnection)
Me._steuernTableAdapter.Transaction = CType(workTransaction, Global.System.Data.OleDb.OleDbTransaction)
If Me._steuernTableAdapter.Adapter.AcceptChangesDuringUpdate Then
Me._steuernTableAdapter.Adapter.AcceptChangesDuringUpdate = False
adaptersWithAcceptChangesDuringUpdate.Add(Me._steuernTableAdapter.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._steuernTableAdapter) Is Nothing) Then
Me._steuernTableAdapter.Connection = CType(revertConnections(Me._steuernTableAdapter), Global.System.Data.OleDb.OleDbConnection)
Me._steuernTableAdapter.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