'------------------------------------------------------------------------------
'
' 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 DD_DMSDataSetCalendar
Inherits Global.System.Data.DataSet
Private tableTBPMO_APPOINTMENTS As TBPMO_APPOINTMENTSDataTable
Private tableTBPMO_RESOURCES As TBPMO_RESOURCESDataTable
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("TBPMO_APPOINTMENTS")) Is Nothing) Then
MyBase.Tables.Add(New TBPMO_APPOINTMENTSDataTable(ds.Tables("TBPMO_APPOINTMENTS")))
End If
If (Not (ds.Tables("TBPMO_RESOURCES")) Is Nothing) Then
MyBase.Tables.Add(New TBPMO_RESOURCESDataTable(ds.Tables("TBPMO_RESOURCES")))
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 TBPMO_APPOINTMENTS() As TBPMO_APPOINTMENTSDataTable
Get
Return Me.tableTBPMO_APPOINTMENTS
End Get
End Property
_
Public ReadOnly Property TBPMO_RESOURCES() As TBPMO_RESOURCESDataTable
Get
Return Me.tableTBPMO_RESOURCES
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 DD_DMSDataSetCalendar = CType(MyBase.Clone,DD_DMSDataSetCalendar)
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("TBPMO_APPOINTMENTS")) Is Nothing) Then
MyBase.Tables.Add(New TBPMO_APPOINTMENTSDataTable(ds.Tables("TBPMO_APPOINTMENTS")))
End If
If (Not (ds.Tables("TBPMO_RESOURCES")) Is Nothing) Then
MyBase.Tables.Add(New TBPMO_RESOURCESDataTable(ds.Tables("TBPMO_RESOURCES")))
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.tableTBPMO_APPOINTMENTS = CType(MyBase.Tables("TBPMO_APPOINTMENTS"),TBPMO_APPOINTMENTSDataTable)
If (initTable = true) Then
If (Not (Me.tableTBPMO_APPOINTMENTS) Is Nothing) Then
Me.tableTBPMO_APPOINTMENTS.InitVars
End If
End If
Me.tableTBPMO_RESOURCES = CType(MyBase.Tables("TBPMO_RESOURCES"),TBPMO_RESOURCESDataTable)
If (initTable = true) Then
If (Not (Me.tableTBPMO_RESOURCES) Is Nothing) Then
Me.tableTBPMO_RESOURCES.InitVars
End If
End If
End Sub
_
Private Sub InitClass()
Me.DataSetName = "DD_DMSDataSetCalendar"
Me.Prefix = ""
Me.Namespace = "http://tempuri.org/DD_DMSDataSetCalendar.xsd"
Me.EnforceConstraints = true
Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
Me.tableTBPMO_APPOINTMENTS = New TBPMO_APPOINTMENTSDataTable()
MyBase.Tables.Add(Me.tableTBPMO_APPOINTMENTS)
Me.tableTBPMO_RESOURCES = New TBPMO_RESOURCESDataTable()
MyBase.Tables.Add(Me.tableTBPMO_RESOURCES)
End Sub
_
Private Function ShouldSerializeTBPMO_APPOINTMENTS() As Boolean
Return false
End Function
_
Private Function ShouldSerializeTBPMO_RESOURCES() 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 DD_DMSDataSetCalendar = New DD_DMSDataSetCalendar()
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 TBPMO_APPOINTMENTSRowChangeEventHandler(ByVal sender As Object, ByVal e As TBPMO_APPOINTMENTSRowChangeEvent)
_
Public Delegate Sub TBPMO_RESOURCESRowChangeEventHandler(ByVal sender As Object, ByVal e As TBPMO_RESOURCESRowChangeEvent)
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class TBPMO_APPOINTMENTSDataTable
Inherits Global.System.Data.TypedTableBase(Of TBPMO_APPOINTMENTSRow)
Private columnUniqueID As Global.System.Data.DataColumn
Private columnType As Global.System.Data.DataColumn
Private columnStartDate As Global.System.Data.DataColumn
Private columnEndDate As Global.System.Data.DataColumn
Private columnAllDay As Global.System.Data.DataColumn
Private columnSubject As Global.System.Data.DataColumn
Private columnLocation As Global.System.Data.DataColumn
Private columnDescription As Global.System.Data.DataColumn
Private columnStatus As Global.System.Data.DataColumn
Private columnLabel As Global.System.Data.DataColumn
Private columnResourceID As Global.System.Data.DataColumn
Private columnResourceIDs As Global.System.Data.DataColumn
Private columnReminderInfo As Global.System.Data.DataColumn
Private columnRecurrenceInfo As Global.System.Data.DataColumn
Private columnCustomField1 As Global.System.Data.DataColumn
Private columnCustomField2 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "TBPMO_APPOINTMENTS"
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 UniqueIDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnUniqueID
End Get
End Property
_
Public ReadOnly Property TypeColumn() As Global.System.Data.DataColumn
Get
Return Me.columnType
End Get
End Property
_
Public ReadOnly Property StartDateColumn() As Global.System.Data.DataColumn
Get
Return Me.columnStartDate
End Get
End Property
_
Public ReadOnly Property EndDateColumn() As Global.System.Data.DataColumn
Get
Return Me.columnEndDate
End Get
End Property
_
Public ReadOnly Property AllDayColumn() As Global.System.Data.DataColumn
Get
Return Me.columnAllDay
End Get
End Property
_
Public ReadOnly Property SubjectColumn() As Global.System.Data.DataColumn
Get
Return Me.columnSubject
End Get
End Property
_
Public ReadOnly Property LocationColumn() As Global.System.Data.DataColumn
Get
Return Me.columnLocation
End Get
End Property
_
Public ReadOnly Property DescriptionColumn() As Global.System.Data.DataColumn
Get
Return Me.columnDescription
End Get
End Property
_
Public ReadOnly Property StatusColumn() As Global.System.Data.DataColumn
Get
Return Me.columnStatus
End Get
End Property
_
Public ReadOnly Property LabelColumn() As Global.System.Data.DataColumn
Get
Return Me.columnLabel
End Get
End Property
_
Public ReadOnly Property ResourceIDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnResourceID
End Get
End Property
_
Public ReadOnly Property ResourceIDsColumn() As Global.System.Data.DataColumn
Get
Return Me.columnResourceIDs
End Get
End Property
_
Public ReadOnly Property ReminderInfoColumn() As Global.System.Data.DataColumn
Get
Return Me.columnReminderInfo
End Get
End Property
_
Public ReadOnly Property RecurrenceInfoColumn() As Global.System.Data.DataColumn
Get
Return Me.columnRecurrenceInfo
End Get
End Property
_
Public ReadOnly Property CustomField1Column() As Global.System.Data.DataColumn
Get
Return Me.columnCustomField1
End Get
End Property
_
Public ReadOnly Property CustomField2Column() As Global.System.Data.DataColumn
Get
Return Me.columnCustomField2
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 TBPMO_APPOINTMENTSRow
Get
Return CType(Me.Rows(index),TBPMO_APPOINTMENTSRow)
End Get
End Property
_
Public Event TBPMO_APPOINTMENTSRowChanging As TBPMO_APPOINTMENTSRowChangeEventHandler
_
Public Event TBPMO_APPOINTMENTSRowChanged As TBPMO_APPOINTMENTSRowChangeEventHandler
_
Public Event TBPMO_APPOINTMENTSRowDeleting As TBPMO_APPOINTMENTSRowChangeEventHandler
_
Public Event TBPMO_APPOINTMENTSRowDeleted As TBPMO_APPOINTMENTSRowChangeEventHandler
_
Public Overloads Sub AddTBPMO_APPOINTMENTSRow(ByVal row As TBPMO_APPOINTMENTSRow)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function AddTBPMO_APPOINTMENTSRow(ByVal Type As Integer, ByVal StartDate As Date, ByVal EndDate As Date, ByVal AllDay As Boolean, ByVal Subject As String, ByVal Location As String, ByVal Description As String, ByVal Status As Integer, ByVal Label As Integer, ByVal ResourceID As Integer, ByVal ResourceIDs As String, ByVal ReminderInfo As String, ByVal RecurrenceInfo As String, ByVal CustomField1 As String, ByVal CustomField2 As String) As TBPMO_APPOINTMENTSRow
Dim rowTBPMO_APPOINTMENTSRow As TBPMO_APPOINTMENTSRow = CType(Me.NewRow,TBPMO_APPOINTMENTSRow)
Dim columnValuesArray() As Object = New Object() {Nothing, Type, StartDate, EndDate, AllDay, Subject, Location, Description, Status, Label, ResourceID, ResourceIDs, ReminderInfo, RecurrenceInfo, CustomField1, CustomField2}
rowTBPMO_APPOINTMENTSRow.ItemArray = columnValuesArray
Me.Rows.Add(rowTBPMO_APPOINTMENTSRow)
Return rowTBPMO_APPOINTMENTSRow
End Function
_
Public Function FindByUniqueID(ByVal UniqueID As Integer) As TBPMO_APPOINTMENTSRow
Return CType(Me.Rows.Find(New Object() {UniqueID}),TBPMO_APPOINTMENTSRow)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As TBPMO_APPOINTMENTSDataTable = CType(MyBase.Clone,TBPMO_APPOINTMENTSDataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New TBPMO_APPOINTMENTSDataTable()
End Function
_
Friend Sub InitVars()
Me.columnUniqueID = MyBase.Columns("UniqueID")
Me.columnType = MyBase.Columns("Type")
Me.columnStartDate = MyBase.Columns("StartDate")
Me.columnEndDate = MyBase.Columns("EndDate")
Me.columnAllDay = MyBase.Columns("AllDay")
Me.columnSubject = MyBase.Columns("Subject")
Me.columnLocation = MyBase.Columns("Location")
Me.columnDescription = MyBase.Columns("Description")
Me.columnStatus = MyBase.Columns("Status")
Me.columnLabel = MyBase.Columns("Label")
Me.columnResourceID = MyBase.Columns("ResourceID")
Me.columnResourceIDs = MyBase.Columns("ResourceIDs")
Me.columnReminderInfo = MyBase.Columns("ReminderInfo")
Me.columnRecurrenceInfo = MyBase.Columns("RecurrenceInfo")
Me.columnCustomField1 = MyBase.Columns("CustomField1")
Me.columnCustomField2 = MyBase.Columns("CustomField2")
End Sub
_
Private Sub InitClass()
Me.columnUniqueID = New Global.System.Data.DataColumn("UniqueID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnUniqueID)
Me.columnType = New Global.System.Data.DataColumn("Type", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnType)
Me.columnStartDate = New Global.System.Data.DataColumn("StartDate", GetType(Date), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnStartDate)
Me.columnEndDate = New Global.System.Data.DataColumn("EndDate", GetType(Date), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEndDate)
Me.columnAllDay = New Global.System.Data.DataColumn("AllDay", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnAllDay)
Me.columnSubject = New Global.System.Data.DataColumn("Subject", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnSubject)
Me.columnLocation = New Global.System.Data.DataColumn("Location", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnLocation)
Me.columnDescription = New Global.System.Data.DataColumn("Description", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnDescription)
Me.columnStatus = New Global.System.Data.DataColumn("Status", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnStatus)
Me.columnLabel = New Global.System.Data.DataColumn("Label", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnLabel)
Me.columnResourceID = New Global.System.Data.DataColumn("ResourceID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnResourceID)
Me.columnResourceIDs = New Global.System.Data.DataColumn("ResourceIDs", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnResourceIDs)
Me.columnReminderInfo = New Global.System.Data.DataColumn("ReminderInfo", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnReminderInfo)
Me.columnRecurrenceInfo = New Global.System.Data.DataColumn("RecurrenceInfo", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnRecurrenceInfo)
Me.columnCustomField1 = New Global.System.Data.DataColumn("CustomField1", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnCustomField1)
Me.columnCustomField2 = New Global.System.Data.DataColumn("CustomField2", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnCustomField2)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnUniqueID}, true))
Me.columnUniqueID.AutoIncrement = true
Me.columnUniqueID.AutoIncrementSeed = -1
Me.columnUniqueID.AutoIncrementStep = -1
Me.columnUniqueID.AllowDBNull = false
Me.columnUniqueID.ReadOnly = true
Me.columnUniqueID.Unique = true
Me.columnSubject.MaxLength = 150
Me.columnLocation.MaxLength = 50
Me.columnDescription.MaxLength = 2147483647
Me.columnResourceIDs.MaxLength = 2147483647
Me.columnReminderInfo.MaxLength = 2147483647
Me.columnRecurrenceInfo.MaxLength = 2147483647
Me.columnCustomField1.MaxLength = 2147483647
Me.columnCustomField2.MaxLength = 2147483647
End Sub
_
Public Function NewTBPMO_APPOINTMENTSRow() As TBPMO_APPOINTMENTSRow
Return CType(Me.NewRow,TBPMO_APPOINTMENTSRow)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New TBPMO_APPOINTMENTSRow(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(TBPMO_APPOINTMENTSRow)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.TBPMO_APPOINTMENTSRowChangedEvent) Is Nothing) Then
RaiseEvent TBPMO_APPOINTMENTSRowChanged(Me, New TBPMO_APPOINTMENTSRowChangeEvent(CType(e.Row,TBPMO_APPOINTMENTSRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.TBPMO_APPOINTMENTSRowChangingEvent) Is Nothing) Then
RaiseEvent TBPMO_APPOINTMENTSRowChanging(Me, New TBPMO_APPOINTMENTSRowChangeEvent(CType(e.Row,TBPMO_APPOINTMENTSRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.TBPMO_APPOINTMENTSRowDeletedEvent) Is Nothing) Then
RaiseEvent TBPMO_APPOINTMENTSRowDeleted(Me, New TBPMO_APPOINTMENTSRowChangeEvent(CType(e.Row,TBPMO_APPOINTMENTSRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.TBPMO_APPOINTMENTSRowDeletingEvent) Is Nothing) Then
RaiseEvent TBPMO_APPOINTMENTSRowDeleting(Me, New TBPMO_APPOINTMENTSRowChangeEvent(CType(e.Row,TBPMO_APPOINTMENTSRow), e.Action))
End If
End Sub
_
Public Sub RemoveTBPMO_APPOINTMENTSRow(ByVal row As TBPMO_APPOINTMENTSRow)
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 DD_DMSDataSetCalendar = New DD_DMSDataSetCalendar()
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 = "TBPMO_APPOINTMENTSDataTable"
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 TBPMO_RESOURCESDataTable
Inherits Global.System.Data.TypedTableBase(Of TBPMO_RESOURCESRow)
Private columnUniqueID As Global.System.Data.DataColumn
Private columnResourceID As Global.System.Data.DataColumn
Private columnResourceName As Global.System.Data.DataColumn
Private columnColor As Global.System.Data.DataColumn
Private columnImage As Global.System.Data.DataColumn
Private columnCustomField1 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "TBPMO_RESOURCES"
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 UniqueIDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnUniqueID
End Get
End Property
_
Public ReadOnly Property ResourceIDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnResourceID
End Get
End Property
_
Public ReadOnly Property ResourceNameColumn() As Global.System.Data.DataColumn
Get
Return Me.columnResourceName
End Get
End Property
_
Public ReadOnly Property ColorColumn() As Global.System.Data.DataColumn
Get
Return Me.columnColor
End Get
End Property
_
Public ReadOnly Property ImageColumn() As Global.System.Data.DataColumn
Get
Return Me.columnImage
End Get
End Property
_
Public ReadOnly Property CustomField1Column() As Global.System.Data.DataColumn
Get
Return Me.columnCustomField1
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 TBPMO_RESOURCESRow
Get
Return CType(Me.Rows(index),TBPMO_RESOURCESRow)
End Get
End Property
_
Public Event TBPMO_RESOURCESRowChanging As TBPMO_RESOURCESRowChangeEventHandler
_
Public Event TBPMO_RESOURCESRowChanged As TBPMO_RESOURCESRowChangeEventHandler
_
Public Event TBPMO_RESOURCESRowDeleting As TBPMO_RESOURCESRowChangeEventHandler
_
Public Event TBPMO_RESOURCESRowDeleted As TBPMO_RESOURCESRowChangeEventHandler
_
Public Overloads Sub AddTBPMO_RESOURCESRow(ByVal row As TBPMO_RESOURCESRow)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function AddTBPMO_RESOURCESRow(ByVal ResourceID As Integer, ByVal ResourceName As String, ByVal Color As Integer, ByVal Image() As Byte, ByVal CustomField1 As String) As TBPMO_RESOURCESRow
Dim rowTBPMO_RESOURCESRow As TBPMO_RESOURCESRow = CType(Me.NewRow,TBPMO_RESOURCESRow)
Dim columnValuesArray() As Object = New Object() {Nothing, ResourceID, ResourceName, Color, Image, CustomField1}
rowTBPMO_RESOURCESRow.ItemArray = columnValuesArray
Me.Rows.Add(rowTBPMO_RESOURCESRow)
Return rowTBPMO_RESOURCESRow
End Function
_
Public Function FindByUniqueID(ByVal UniqueID As Integer) As TBPMO_RESOURCESRow
Return CType(Me.Rows.Find(New Object() {UniqueID}),TBPMO_RESOURCESRow)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As TBPMO_RESOURCESDataTable = CType(MyBase.Clone,TBPMO_RESOURCESDataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New TBPMO_RESOURCESDataTable()
End Function
_
Friend Sub InitVars()
Me.columnUniqueID = MyBase.Columns("UniqueID")
Me.columnResourceID = MyBase.Columns("ResourceID")
Me.columnResourceName = MyBase.Columns("ResourceName")
Me.columnColor = MyBase.Columns("Color")
Me.columnImage = MyBase.Columns("Image")
Me.columnCustomField1 = MyBase.Columns("CustomField1")
End Sub
_
Private Sub InitClass()
Me.columnUniqueID = New Global.System.Data.DataColumn("UniqueID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnUniqueID)
Me.columnResourceID = New Global.System.Data.DataColumn("ResourceID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnResourceID)
Me.columnResourceName = New Global.System.Data.DataColumn("ResourceName", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnResourceName)
Me.columnColor = New Global.System.Data.DataColumn("Color", GetType(Integer), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnColor)
Me.columnImage = New Global.System.Data.DataColumn("Image", GetType(Byte()), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnImage)
Me.columnCustomField1 = New Global.System.Data.DataColumn("CustomField1", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnCustomField1)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnUniqueID}, true))
Me.columnUniqueID.AutoIncrement = true
Me.columnUniqueID.AutoIncrementSeed = -1
Me.columnUniqueID.AutoIncrementStep = -1
Me.columnUniqueID.AllowDBNull = false
Me.columnUniqueID.ReadOnly = true
Me.columnUniqueID.Unique = true
Me.columnResourceID.AllowDBNull = false
Me.columnResourceName.MaxLength = 50
Me.columnCustomField1.MaxLength = 2147483647
End Sub
_
Public Function NewTBPMO_RESOURCESRow() As TBPMO_RESOURCESRow
Return CType(Me.NewRow,TBPMO_RESOURCESRow)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New TBPMO_RESOURCESRow(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(TBPMO_RESOURCESRow)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.TBPMO_RESOURCESRowChangedEvent) Is Nothing) Then
RaiseEvent TBPMO_RESOURCESRowChanged(Me, New TBPMO_RESOURCESRowChangeEvent(CType(e.Row,TBPMO_RESOURCESRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.TBPMO_RESOURCESRowChangingEvent) Is Nothing) Then
RaiseEvent TBPMO_RESOURCESRowChanging(Me, New TBPMO_RESOURCESRowChangeEvent(CType(e.Row,TBPMO_RESOURCESRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.TBPMO_RESOURCESRowDeletedEvent) Is Nothing) Then
RaiseEvent TBPMO_RESOURCESRowDeleted(Me, New TBPMO_RESOURCESRowChangeEvent(CType(e.Row,TBPMO_RESOURCESRow), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.TBPMO_RESOURCESRowDeletingEvent) Is Nothing) Then
RaiseEvent TBPMO_RESOURCESRowDeleting(Me, New TBPMO_RESOURCESRowChangeEvent(CType(e.Row,TBPMO_RESOURCESRow), e.Action))
End If
End Sub
_
Public Sub RemoveTBPMO_RESOURCESRow(ByVal row As TBPMO_RESOURCESRow)
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 DD_DMSDataSetCalendar = New DD_DMSDataSetCalendar()
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 = "TBPMO_RESOURCESDataTable"
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 TBPMO_APPOINTMENTSRow
Inherits Global.System.Data.DataRow
Private tableTBPMO_APPOINTMENTS As TBPMO_APPOINTMENTSDataTable
_
Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tableTBPMO_APPOINTMENTS = CType(Me.Table,TBPMO_APPOINTMENTSDataTable)
End Sub
_
Public Property UniqueID() As Integer
Get
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.UniqueIDColumn),Integer)
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.UniqueIDColumn) = value
End Set
End Property
_
Public Property Type() As Integer
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.TypeColumn),Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Type in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.TypeColumn) = value
End Set
End Property
_
Public Property StartDate() As Date
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.StartDateColumn),Date)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte StartDate in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.StartDateColumn) = value
End Set
End Property
_
Public Property EndDate() As Date
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.EndDateColumn),Date)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte EndDate in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.EndDateColumn) = value
End Set
End Property
_
Public Property AllDay() As Boolean
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.AllDayColumn),Boolean)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte AllDay in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.AllDayColumn) = value
End Set
End Property
_
Public Property Subject() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.SubjectColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Subject in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.SubjectColumn) = value
End Set
End Property
_
Public Property Location() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.LocationColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Location in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.LocationColumn) = value
End Set
End Property
_
Public Property Description() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.DescriptionColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Description in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.DescriptionColumn) = value
End Set
End Property
_
Public Property Status() As Integer
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.StatusColumn),Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Status in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.StatusColumn) = value
End Set
End Property
_
Public Property Label() As Integer
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.LabelColumn),Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Label in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.LabelColumn) = value
End Set
End Property
_
Public Property ResourceID() As Integer
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDColumn),Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ResourceID in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDColumn) = value
End Set
End Property
_
Public Property ResourceIDs() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDsColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ResourceIDs in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDsColumn) = value
End Set
End Property
_
Public Property ReminderInfo() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.ReminderInfoColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ReminderInfo in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.ReminderInfoColumn) = value
End Set
End Property
_
Public Property RecurrenceInfo() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.RecurrenceInfoColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte RecurrenceInfo in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.RecurrenceInfoColumn) = value
End Set
End Property
_
Public Property CustomField1() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.CustomField1Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CustomField1 in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.CustomField1Column) = value
End Set
End Property
_
Public Property CustomField2() As String
Get
Try
Return CType(Me(Me.tableTBPMO_APPOINTMENTS.CustomField2Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CustomField2 in Tabelle TBPMO_APPOINTMENTS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_APPOINTMENTS.CustomField2Column) = value
End Set
End Property
_
Public Function IsTypeNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.TypeColumn)
End Function
_
Public Sub SetTypeNull()
Me(Me.tableTBPMO_APPOINTMENTS.TypeColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsStartDateNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.StartDateColumn)
End Function
_
Public Sub SetStartDateNull()
Me(Me.tableTBPMO_APPOINTMENTS.StartDateColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsEndDateNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.EndDateColumn)
End Function
_
Public Sub SetEndDateNull()
Me(Me.tableTBPMO_APPOINTMENTS.EndDateColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsAllDayNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.AllDayColumn)
End Function
_
Public Sub SetAllDayNull()
Me(Me.tableTBPMO_APPOINTMENTS.AllDayColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsSubjectNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.SubjectColumn)
End Function
_
Public Sub SetSubjectNull()
Me(Me.tableTBPMO_APPOINTMENTS.SubjectColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsLocationNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.LocationColumn)
End Function
_
Public Sub SetLocationNull()
Me(Me.tableTBPMO_APPOINTMENTS.LocationColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsDescriptionNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.DescriptionColumn)
End Function
_
Public Sub SetDescriptionNull()
Me(Me.tableTBPMO_APPOINTMENTS.DescriptionColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsStatusNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.StatusColumn)
End Function
_
Public Sub SetStatusNull()
Me(Me.tableTBPMO_APPOINTMENTS.StatusColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsLabelNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.LabelColumn)
End Function
_
Public Sub SetLabelNull()
Me(Me.tableTBPMO_APPOINTMENTS.LabelColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsResourceIDNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.ResourceIDColumn)
End Function
_
Public Sub SetResourceIDNull()
Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsResourceIDsNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.ResourceIDsColumn)
End Function
_
Public Sub SetResourceIDsNull()
Me(Me.tableTBPMO_APPOINTMENTS.ResourceIDsColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsReminderInfoNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.ReminderInfoColumn)
End Function
_
Public Sub SetReminderInfoNull()
Me(Me.tableTBPMO_APPOINTMENTS.ReminderInfoColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsRecurrenceInfoNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.RecurrenceInfoColumn)
End Function
_
Public Sub SetRecurrenceInfoNull()
Me(Me.tableTBPMO_APPOINTMENTS.RecurrenceInfoColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsCustomField1Null() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.CustomField1Column)
End Function
_
Public Sub SetCustomField1Null()
Me(Me.tableTBPMO_APPOINTMENTS.CustomField1Column) = Global.System.Convert.DBNull
End Sub
_
Public Function IsCustomField2Null() As Boolean
Return Me.IsNull(Me.tableTBPMO_APPOINTMENTS.CustomField2Column)
End Function
_
Public Sub SetCustomField2Null()
Me(Me.tableTBPMO_APPOINTMENTS.CustomField2Column) = Global.System.Convert.DBNull
End Sub
End Class
'''
'''Represents strongly named DataRow class.
'''
Partial Public Class TBPMO_RESOURCESRow
Inherits Global.System.Data.DataRow
Private tableTBPMO_RESOURCES As TBPMO_RESOURCESDataTable
_
Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tableTBPMO_RESOURCES = CType(Me.Table,TBPMO_RESOURCESDataTable)
End Sub
_
Public Property UniqueID() As Integer
Get
Return CType(Me(Me.tableTBPMO_RESOURCES.UniqueIDColumn),Integer)
End Get
Set
Me(Me.tableTBPMO_RESOURCES.UniqueIDColumn) = value
End Set
End Property
_
Public Property ResourceID() As Integer
Get
Return CType(Me(Me.tableTBPMO_RESOURCES.ResourceIDColumn),Integer)
End Get
Set
Me(Me.tableTBPMO_RESOURCES.ResourceIDColumn) = value
End Set
End Property
_
Public Property ResourceName() As String
Get
Try
Return CType(Me(Me.tableTBPMO_RESOURCES.ResourceNameColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ResourceName in Tabelle TBPMO_RESOURCES ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_RESOURCES.ResourceNameColumn) = value
End Set
End Property
_
Public Property Color() As Integer
Get
Try
Return CType(Me(Me.tableTBPMO_RESOURCES.ColorColumn),Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Color in Tabelle TBPMO_RESOURCES ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_RESOURCES.ColorColumn) = value
End Set
End Property
_
Public Property Image() As Byte()
Get
Try
Return CType(Me(Me.tableTBPMO_RESOURCES.ImageColumn),Byte())
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte Image in Tabelle TBPMO_RESOURCES ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_RESOURCES.ImageColumn) = value
End Set
End Property
_
Public Property CustomField1() As String
Get
Try
Return CType(Me(Me.tableTBPMO_RESOURCES.CustomField1Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte CustomField1 in Tabelle TBPMO_RESOURCES ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBPMO_RESOURCES.CustomField1Column) = value
End Set
End Property
_
Public Function IsResourceNameNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_RESOURCES.ResourceNameColumn)
End Function
_
Public Sub SetResourceNameNull()
Me(Me.tableTBPMO_RESOURCES.ResourceNameColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsColorNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_RESOURCES.ColorColumn)
End Function
_
Public Sub SetColorNull()
Me(Me.tableTBPMO_RESOURCES.ColorColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsImageNull() As Boolean
Return Me.IsNull(Me.tableTBPMO_RESOURCES.ImageColumn)
End Function
_
Public Sub SetImageNull()
Me(Me.tableTBPMO_RESOURCES.ImageColumn) = Global.System.Convert.DBNull
End Sub
_
Public Function IsCustomField1Null() As Boolean
Return Me.IsNull(Me.tableTBPMO_RESOURCES.CustomField1Column)
End Function
_
Public Sub SetCustomField1Null()
Me(Me.tableTBPMO_RESOURCES.CustomField1Column) = Global.System.Convert.DBNull
End Sub
End Class
'''
'''Row event argument class
'''
_
Public Class TBPMO_APPOINTMENTSRowChangeEvent
Inherits Global.System.EventArgs
Private eventRow As TBPMO_APPOINTMENTSRow
Private eventAction As Global.System.Data.DataRowAction
_
Public Sub New(ByVal row As TBPMO_APPOINTMENTSRow, ByVal action As Global.System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
_
Public ReadOnly Property Row() As TBPMO_APPOINTMENTSRow
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 TBPMO_RESOURCESRowChangeEvent
Inherits Global.System.EventArgs
Private eventRow As TBPMO_RESOURCESRow
Private eventAction As Global.System.Data.DataRowAction
_
Public Sub New(ByVal row As TBPMO_RESOURCESRow, ByVal action As Global.System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
_
Public ReadOnly Property Row() As TBPMO_RESOURCESRow
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 DD_DMSDataSetCalendarTableAdapters
'''
'''Represents the connection and commands used to retrieve and save data.
'''
_
Partial Public Class TBPMO_APPOINTMENTSTableAdapter
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 = "TBPMO_APPOINTMENTS"
tableMapping.ColumnMappings.Add("UniqueID", "UniqueID")
tableMapping.ColumnMappings.Add("Type", "Type")
tableMapping.ColumnMappings.Add("StartDate", "StartDate")
tableMapping.ColumnMappings.Add("EndDate", "EndDate")
tableMapping.ColumnMappings.Add("AllDay", "AllDay")
tableMapping.ColumnMappings.Add("Subject", "Subject")
tableMapping.ColumnMappings.Add("Location", "Location")
tableMapping.ColumnMappings.Add("Description", "Description")
tableMapping.ColumnMappings.Add("Status", "Status")
tableMapping.ColumnMappings.Add("Label", "Label")
tableMapping.ColumnMappings.Add("ResourceID", "ResourceID")
tableMapping.ColumnMappings.Add("ResourceIDs", "ResourceIDs")
tableMapping.ColumnMappings.Add("ReminderInfo", "ReminderInfo")
tableMapping.ColumnMappings.Add("RecurrenceInfo", "RecurrenceInfo")
tableMapping.ColumnMappings.Add("CustomField1", "CustomField1")
tableMapping.ColumnMappings.Add("CustomField2", "CustomField2")
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 [TBPMO_APPOINTMENTS] WHERE ([UniqueID] = @Original_UniqueID) AND (@Is"& _
"Null_Type = 1 AND [Type] IS NULL) OR ([Type] = @Original_Type)) AND (@IsNull_Sta"& _
"rtDate = 1 AND [StartDate] IS NULL) OR ([StartDate] = @Original_StartDate)) AND "& _
"(@IsNull_EndDate = 1 AND [EndDate] IS NULL) OR ([EndDate] = @Original_EndDate)) "& _
"AND (@IsNull_AllDay = 1 AND [AllDay] IS NULL) OR ([AllDay] = @Original_AllDay)) "& _
"AND (@IsNull_Subject = 1 AND [Subject] IS NULL) OR ([Subject] = @Original_Subjec"& _
"t)) AND (@IsNull_Location = 1 AND [Location] IS NULL) OR ([Location] = @Original"& _
"_Location)) AND (@IsNull_Status = 1 AND [Status] IS NULL) OR ([Status] = @Origin"& _
"al_Status)) AND (@IsNull_Label = 1 AND [Label] IS NULL) OR ([Label] = @Original_"& _
"Label)) AND (@IsNull_ResourceID = 1 AND [ResourceID] IS NULL) OR ([ResourceID] ="& _
" @Original_ResourceID)))"
Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_UniqueID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_StartDate", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_StartDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_EndDate", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_EndDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_AllDay", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_AllDay", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Subject", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Subject", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Location", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Location", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", 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 [TBPMO_APPOINTMENTS] ([Type], [StartDate], [EndDate], [AllDay], [Subj"& _
"ect], [Location], [Description], [Status], [Label], [ResourceID], [ResourceIDs],"& _
" [ReminderInfo], [RecurrenceInfo], [CustomField1], [CustomField2]) VALUES (@Type"& _
", @StartDate, @EndDate, @AllDay, @Subject, @Location, @Description, @Status, @La"& _
"bel, @ResourceID, @ResourceIDs, @ReminderInfo, @RecurrenceInfo, @CustomField1, @"& _
"CustomField2);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT UniqueID, Type, StartDate, EndDate, AllDay, Subject, Loca"& _
"tion, Description, Status, Label, ResourceID, ResourceIDs, ReminderInfo, Recurre"& _
"nceInfo, CustomField1, CustomField2 FROM TBPMO_APPOINTMENTS WHERE (UniqueID = SC"& _
"OPE_IDENTITY())"
Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@StartDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@EndDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@AllDay", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Subject", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Location", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", 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("@Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceIDs", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceIDs", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ReminderInfo", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ReminderInfo", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@RecurrenceInfo", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "RecurrenceInfo", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField1", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField1", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField2", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField2", 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 [TBPMO_APPOINTMENTS] SET [Type] = @Type, [StartDate] = @StartDate, [EndDat"& _
"e] = @EndDate, [AllDay] = @AllDay, [Subject] = @Subject, [Location] = @Location,"& _
" [Description] = @Description, [Status] = @Status, [Label] = @Label, [ResourceID"& _
"] = @ResourceID, [ResourceIDs] = @ResourceIDs, [ReminderInfo] = @ReminderInfo, ["& _
"RecurrenceInfo] = @RecurrenceInfo, [CustomField1] = @CustomField1, [CustomField2"& _
"] = @CustomField2 WHERE ([UniqueID] = @Original_UniqueID) AND (@IsNull_Type = 1 "& _
"AND [Type] IS NULL) OR ([Type] = @Original_Type)) AND (@IsNull_StartDate = 1 AND"& _
" [StartDate] IS NULL) OR ([StartDate] = @Original_StartDate)) AND (@IsNull_EndDa"& _
"te = 1 AND [EndDate] IS NULL) OR ([EndDate] = @Original_EndDate)) AND (@IsNull_A"& _
"llDay = 1 AND [AllDay] IS NULL) OR ([AllDay] = @Original_AllDay)) AND (@IsNull_S"& _
"ubject = 1 AND [Subject] IS NULL) OR ([Subject] = @Original_Subject)) AND (@IsNu"& _
"ll_Location = 1 AND [Location] IS NULL) OR ([Location] = @Original_Location)) AN"& _
"D (@IsNull_Status = 1 AND [Status] IS NULL) OR ([Status] = @Original_Status)) AN"& _
"D (@IsNull_Label = 1 AND [Label] IS NULL) OR ([Label] = @Original_Label)) AND (@"& _
"IsNull_ResourceID = 1 AND [ResourceID] IS NULL) OR ([ResourceID] = @Original_Res"& _
"ourceID)));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT UniqueID, Type, StartDate, EndDate, AllDay, Subject, Locatio"& _
"n, Description, Status, Label, ResourceID, ResourceIDs, ReminderInfo, Recurrence"& _
"Info, CustomField1, CustomField2 FROM TBPMO_APPOINTMENTS WHERE (UniqueID = @Uniq"& _
"ueID)"
Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@StartDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@EndDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@AllDay", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Subject", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Location", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", 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("@Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceIDs", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceIDs", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ReminderInfo", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ReminderInfo", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@RecurrenceInfo", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "RecurrenceInfo", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField1", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField1", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField2", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField2", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_UniqueID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Type", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Type", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_StartDate", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_StartDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "StartDate", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_EndDate", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_EndDate", Global.System.Data.SqlDbType.SmallDateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "EndDate", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_AllDay", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_AllDay", Global.System.Data.SqlDbType.Bit, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "AllDay", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Subject", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Subject", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Subject", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Location", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Location", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Location", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Status", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Status", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Label", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Label", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@UniqueID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
End Sub
_
Private Sub InitConnection()
Me._connection = New Global.System.Data.SqlClient.SqlConnection()
Me._connection.ConnectionString = Global.DD_Record_Organizer.My.MySettings.Default.DD_DMSConnectionString
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 UniqueID, Type, StartDate, EndDate, AllDay, Subject, Location, Desc"& _
"ription, Status, Label, ResourceID, ResourceIDs, ReminderInfo, RecurrenceInfo, C"& _
"ustomField1, CustomField2"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBPMO_APPOINTMENTS"
Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text
End Sub
_
Public Overloads Overridable Function Fill(ByVal dataTable As DD_DMSDataSetCalendar.TBPMO_APPOINTMENTSDataTable) 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 DD_DMSDataSetCalendar.TBPMO_APPOINTMENTSDataTable
Me.Adapter.SelectCommand = Me.CommandCollection(0)
Dim dataTable As DD_DMSDataSetCalendar.TBPMO_APPOINTMENTSDataTable = New DD_DMSDataSetCalendar.TBPMO_APPOINTMENTSDataTable()
Me.Adapter.Fill(dataTable)
Return dataTable
End Function
_
Public Overloads Overridable Function Update(ByVal dataTable As DD_DMSDataSetCalendar.TBPMO_APPOINTMENTSDataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function
_
Public Overloads Overridable Function Update(ByVal dataSet As DD_DMSDataSetCalendar) As Integer
Return Me.Adapter.Update(dataSet, "TBPMO_APPOINTMENTS")
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_UniqueID As Integer, ByVal Original_Type As Global.System.Nullable(Of Integer), ByVal Original_StartDate As Global.System.Nullable(Of Date), ByVal Original_EndDate As Global.System.Nullable(Of Date), ByVal Original_AllDay As Global.System.Nullable(Of Boolean), ByVal Original_Subject As String, ByVal Original_Location As String, ByVal Original_Status As Global.System.Nullable(Of Integer), ByVal Original_Label As Global.System.Nullable(Of Integer), ByVal Original_ResourceID As Global.System.Nullable(Of Integer)) As Integer
Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_UniqueID,Integer)
If (Original_Type.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Type.Value,Integer)
Else
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (Original_StartDate.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_StartDate.Value,Date)
Else
Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value
End If
If (Original_EndDate.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(5).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(6).Value = CType(Original_EndDate.Value,Date)
Else
Me.Adapter.DeleteCommand.Parameters(5).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value
End If
If (Original_AllDay.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(7).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(8).Value = CType(Original_AllDay.Value,Boolean)
Else
Me.Adapter.DeleteCommand.Parameters(7).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (Original_Subject Is Nothing) Then
Me.Adapter.DeleteCommand.Parameters(9).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(10).Value = Global.System.DBNull.Value
Else
Me.Adapter.DeleteCommand.Parameters(9).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(10).Value = CType(Original_Subject,String)
End If
If (Original_Location Is Nothing) Then
Me.Adapter.DeleteCommand.Parameters(11).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(12).Value = Global.System.DBNull.Value
Else
Me.Adapter.DeleteCommand.Parameters(11).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(12).Value = CType(Original_Location,String)
End If
If (Original_Status.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(13).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(14).Value = CType(Original_Status.Value,Integer)
Else
Me.Adapter.DeleteCommand.Parameters(13).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(14).Value = Global.System.DBNull.Value
End If
If (Original_Label.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(15).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(16).Value = CType(Original_Label.Value,Integer)
Else
Me.Adapter.DeleteCommand.Parameters(15).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(16).Value = Global.System.DBNull.Value
End If
If (Original_ResourceID.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(17).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(18).Value = CType(Original_ResourceID.Value,Integer)
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 Overloads Overridable Function Insert(ByVal Type As Global.System.Nullable(Of Integer), ByVal StartDate As Global.System.Nullable(Of Date), ByVal EndDate As Global.System.Nullable(Of Date), ByVal AllDay As Global.System.Nullable(Of Boolean), ByVal Subject As String, ByVal Location As String, ByVal Description As String, ByVal Status As Global.System.Nullable(Of Integer), ByVal Label As Global.System.Nullable(Of Integer), ByVal ResourceID As Global.System.Nullable(Of Integer), ByVal ResourceIDs As String, ByVal ReminderInfo As String, ByVal RecurrenceInfo As String, ByVal CustomField1 As String, ByVal CustomField2 As String) As Integer
If (Type.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(0).Value = CType(Type.Value,Integer)
Else
Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value
End If
If (StartDate.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(1).Value = CType(StartDate.Value,Date)
Else
Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value
End If
If (EndDate.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(2).Value = CType(EndDate.Value,Date)
Else
Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (AllDay.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(3).Value = CType(AllDay.Value,Boolean)
Else
Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value
End If
If (Subject Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(4).Value = CType(Subject,String)
End If
If (Location Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(5).Value = CType(Location,String)
End If
If (Description Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(6).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(6).Value = CType(Description,String)
End If
If (Status.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(7).Value = CType(Status.Value,Integer)
Else
Me.Adapter.InsertCommand.Parameters(7).Value = Global.System.DBNull.Value
End If
If (Label.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(8).Value = CType(Label.Value,Integer)
Else
Me.Adapter.InsertCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (ResourceID.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(9).Value = CType(ResourceID.Value,Integer)
Else
Me.Adapter.InsertCommand.Parameters(9).Value = Global.System.DBNull.Value
End If
If (ResourceIDs Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(10).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(10).Value = CType(ResourceIDs,String)
End If
If (ReminderInfo Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(11).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(11).Value = CType(ReminderInfo,String)
End If
If (RecurrenceInfo Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(12).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(12).Value = CType(RecurrenceInfo,String)
End If
If (CustomField1 Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(13).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(13).Value = CType(CustomField1,String)
End If
If (CustomField2 Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(14).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(14).Value = CType(CustomField2,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 Type As Global.System.Nullable(Of Integer), _
ByVal StartDate As Global.System.Nullable(Of Date), _
ByVal EndDate As Global.System.Nullable(Of Date), _
ByVal AllDay As Global.System.Nullable(Of Boolean), _
ByVal Subject As String, _
ByVal Location As String, _
ByVal Description As String, _
ByVal Status As Global.System.Nullable(Of Integer), _
ByVal Label As Global.System.Nullable(Of Integer), _
ByVal ResourceID As Global.System.Nullable(Of Integer), _
ByVal ResourceIDs As String, _
ByVal ReminderInfo As String, _
ByVal RecurrenceInfo As String, _
ByVal CustomField1 As String, _
ByVal CustomField2 As String, _
ByVal Original_UniqueID As Integer, _
ByVal Original_Type As Global.System.Nullable(Of Integer), _
ByVal Original_StartDate As Global.System.Nullable(Of Date), _
ByVal Original_EndDate As Global.System.Nullable(Of Date), _
ByVal Original_AllDay As Global.System.Nullable(Of Boolean), _
ByVal Original_Subject As String, _
ByVal Original_Location As String, _
ByVal Original_Status As Global.System.Nullable(Of Integer), _
ByVal Original_Label As Global.System.Nullable(Of Integer), _
ByVal Original_ResourceID As Global.System.Nullable(Of Integer), _
ByVal UniqueID As Integer) As Integer
If (Type.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Type.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value
End If
If (StartDate.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(1).Value = CType(StartDate.Value,Date)
Else
Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value
End If
If (EndDate.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(2).Value = CType(EndDate.Value,Date)
Else
Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (AllDay.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(3).Value = CType(AllDay.Value,Boolean)
Else
Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value
End If
If (Subject Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Subject,String)
End If
If (Location Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Location,String)
End If
If (Description Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Description,String)
End If
If (Status.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Status.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value
End If
If (Label.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(8).Value = CType(Label.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value
End If
If (ResourceID.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(9).Value = CType(ResourceID.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(9).Value = Global.System.DBNull.Value
End If
If (ResourceIDs Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(10).Value = CType(ResourceIDs,String)
End If
If (ReminderInfo Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(11).Value = CType(ReminderInfo,String)
End If
If (RecurrenceInfo Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(12).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(12).Value = CType(RecurrenceInfo,String)
End If
If (CustomField1 Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(13).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(13).Value = CType(CustomField1,String)
End If
If (CustomField2 Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(14).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(14).Value = CType(CustomField2,String)
End If
Me.Adapter.UpdateCommand.Parameters(15).Value = CType(Original_UniqueID,Integer)
If (Original_Type.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(16).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(17).Value = CType(Original_Type.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(16).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(17).Value = Global.System.DBNull.Value
End If
If (Original_StartDate.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(18).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(19).Value = CType(Original_StartDate.Value,Date)
Else
Me.Adapter.UpdateCommand.Parameters(18).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(19).Value = Global.System.DBNull.Value
End If
If (Original_EndDate.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(20).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(21).Value = CType(Original_EndDate.Value,Date)
Else
Me.Adapter.UpdateCommand.Parameters(20).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(21).Value = Global.System.DBNull.Value
End If
If (Original_AllDay.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(22).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(23).Value = CType(Original_AllDay.Value,Boolean)
Else
Me.Adapter.UpdateCommand.Parameters(22).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(23).Value = Global.System.DBNull.Value
End If
If (Original_Subject Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(24).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(25).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(24).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(25).Value = CType(Original_Subject,String)
End If
If (Original_Location Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(26).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(27).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(26).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(27).Value = CType(Original_Location,String)
End If
If (Original_Status.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(28).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(29).Value = CType(Original_Status.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(28).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(29).Value = Global.System.DBNull.Value
End If
If (Original_Label.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(30).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(31).Value = CType(Original_Label.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(30).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(31).Value = Global.System.DBNull.Value
End If
If (Original_ResourceID.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(32).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(33).Value = CType(Original_ResourceID.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(32).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(33).Value = Global.System.DBNull.Value
End If
Me.Adapter.UpdateCommand.Parameters(34).Value = CType(UniqueID,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 Type As Global.System.Nullable(Of Integer), _
ByVal StartDate As Global.System.Nullable(Of Date), _
ByVal EndDate As Global.System.Nullable(Of Date), _
ByVal AllDay As Global.System.Nullable(Of Boolean), _
ByVal Subject As String, _
ByVal Location As String, _
ByVal Description As String, _
ByVal Status As Global.System.Nullable(Of Integer), _
ByVal Label As Global.System.Nullable(Of Integer), _
ByVal ResourceID As Global.System.Nullable(Of Integer), _
ByVal ResourceIDs As String, _
ByVal ReminderInfo As String, _
ByVal RecurrenceInfo As String, _
ByVal CustomField1 As String, _
ByVal CustomField2 As String, _
ByVal Original_UniqueID As Integer, _
ByVal Original_Type As Global.System.Nullable(Of Integer), _
ByVal Original_StartDate As Global.System.Nullable(Of Date), _
ByVal Original_EndDate As Global.System.Nullable(Of Date), _
ByVal Original_AllDay As Global.System.Nullable(Of Boolean), _
ByVal Original_Subject As String, _
ByVal Original_Location As String, _
ByVal Original_Status As Global.System.Nullable(Of Integer), _
ByVal Original_Label As Global.System.Nullable(Of Integer), _
ByVal Original_ResourceID As Global.System.Nullable(Of Integer)) As Integer
Return Me.Update(Type, StartDate, EndDate, AllDay, Subject, Location, Description, Status, Label, ResourceID, ResourceIDs, ReminderInfo, RecurrenceInfo, CustomField1, CustomField2, Original_UniqueID, Original_Type, Original_StartDate, Original_EndDate, Original_AllDay, Original_Subject, Original_Location, Original_Status, Original_Label, Original_ResourceID, Original_UniqueID)
End Function
End Class
'''
'''Represents the connection and commands used to retrieve and save data.
'''
_
Partial Public Class TBPMO_RESOURCESTableAdapter
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 = "TBPMO_RESOURCES"
tableMapping.ColumnMappings.Add("UniqueID", "UniqueID")
tableMapping.ColumnMappings.Add("ResourceID", "ResourceID")
tableMapping.ColumnMappings.Add("ResourceName", "ResourceName")
tableMapping.ColumnMappings.Add("Color", "Color")
tableMapping.ColumnMappings.Add("Image", "Image")
tableMapping.ColumnMappings.Add("CustomField1", "CustomField1")
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].[TBPMO_RESOURCES] WHERE ([UniqueID] = @Original_UniqueID) AND ("& _
"[ResourceID] = @Original_ResourceID) AND (@IsNull_ResourceName = 1 AND [Resource"& _
"Name] IS NULL) OR ([ResourceName] = @Original_ResourceName)) AND (@IsNull_Color "& _
"= 1 AND [Color] IS NULL) OR ([Color] = @Original_Color)))"
Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_UniqueID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ResourceName", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceName", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", 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].[TBPMO_RESOURCES] ([ResourceID], [ResourceName], [Color], [Imag"& _
"e], [CustomField1]) VALUES (@ResourceID, @ResourceName, @Color, @Image, @CustomF"& _
"ield1);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT UniqueID, ResourceID, ResourceName, Color, Image, CustomField1 F"& _
"ROM TBPMO_RESOURCES WHERE (UniqueID = SCOPE_IDENTITY())"
Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceName", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Image", Global.System.Data.SqlDbType.Image, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Image", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField1", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField1", 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].[TBPMO_RESOURCES] SET [ResourceID] = @ResourceID, [ResourceName] = @"& _
"ResourceName, [Color] = @Color, [Image] = @Image, [CustomField1] = @CustomField1"& _
" WHERE ([UniqueID] = @Original_UniqueID) AND ([ResourceID] = @Original_ResourceI"& _
"D) AND (@IsNull_ResourceName = 1 AND [ResourceName] IS NULL) OR ([ResourceName] "& _
"= @Original_ResourceName)) AND (@IsNull_Color = 1 AND [Color] IS NULL) OR ([Colo"& _
"r] = @Original_Color)));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT UniqueID, ResourceID, ResourceName, Color, Imag"& _
"e, CustomField1 FROM TBPMO_RESOURCES WHERE (UniqueID = @UniqueID)"
Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ResourceName", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Image", Global.System.Data.SqlDbType.Image, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Image", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CustomField1", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CustomField1", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_UniqueID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ResourceName", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ResourceName", Global.System.Data.SqlDbType.NVarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ResourceName", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_Color", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "Color", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", ""))
Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@UniqueID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "UniqueID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
End Sub
_
Private Sub InitConnection()
Me._connection = New Global.System.Data.SqlClient.SqlConnection()
Me._connection.ConnectionString = Global.DD_Record_Organizer.My.MySettings.Default.DD_DMSConnectionString
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 UniqueID, ResourceID, ResourceName, Color, Image, CustomField1 FROM dbo.TB"& _
"PMO_RESOURCES"
Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text
End Sub
_
Public Overloads Overridable Function Fill(ByVal dataTable As DD_DMSDataSetCalendar.TBPMO_RESOURCESDataTable) 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 DD_DMSDataSetCalendar.TBPMO_RESOURCESDataTable
Me.Adapter.SelectCommand = Me.CommandCollection(0)
Dim dataTable As DD_DMSDataSetCalendar.TBPMO_RESOURCESDataTable = New DD_DMSDataSetCalendar.TBPMO_RESOURCESDataTable()
Me.Adapter.Fill(dataTable)
Return dataTable
End Function
_
Public Overloads Overridable Function Update(ByVal dataTable As DD_DMSDataSetCalendar.TBPMO_RESOURCESDataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function
_
Public Overloads Overridable Function Update(ByVal dataSet As DD_DMSDataSetCalendar) As Integer
Return Me.Adapter.Update(dataSet, "TBPMO_RESOURCES")
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_UniqueID As Integer, ByVal Original_ResourceID As Integer, ByVal Original_ResourceName As String, ByVal Original_Color As Global.System.Nullable(Of Integer)) As Integer
Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_UniqueID,Integer)
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_ResourceID,Integer)
If (Original_ResourceName Is Nothing) Then
Me.Adapter.DeleteCommand.Parameters(2).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(3).Value = Global.System.DBNull.Value
Else
Me.Adapter.DeleteCommand.Parameters(2).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(3).Value = CType(Original_ResourceName,String)
End If
If (Original_Color.HasValue = true) Then
Me.Adapter.DeleteCommand.Parameters(4).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(5).Value = CType(Original_Color.Value,Integer)
Else
Me.Adapter.DeleteCommand.Parameters(4).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(5).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 Overloads Overridable Function Insert(ByVal ResourceID As Integer, ByVal ResourceName As String, ByVal Color As Global.System.Nullable(Of Integer), ByVal Image() As Byte, ByVal CustomField1 As String) As Integer
Me.Adapter.InsertCommand.Parameters(0).Value = CType(ResourceID,Integer)
If (ResourceName Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(1).Value = CType(ResourceName,String)
End If
If (Color.HasValue = true) Then
Me.Adapter.InsertCommand.Parameters(2).Value = CType(Color.Value,Integer)
Else
Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (Image Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(3).Value = CType(Image,Byte())
End If
If (CustomField1 Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(4).Value = CType(CustomField1,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 ResourceID As Integer, ByVal ResourceName As String, ByVal Color As Global.System.Nullable(Of Integer), ByVal Image() As Byte, ByVal CustomField1 As String, ByVal Original_UniqueID As Integer, ByVal Original_ResourceID As Integer, ByVal Original_ResourceName As String, ByVal Original_Color As Global.System.Nullable(Of Integer), ByVal UniqueID As Integer) As Integer
Me.Adapter.UpdateCommand.Parameters(0).Value = CType(ResourceID,Integer)
If (ResourceName Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(1).Value = CType(ResourceName,String)
End If
If (Color.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Color.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value
End If
If (Image Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Image,Byte())
End If
If (CustomField1 Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(4).Value = CType(CustomField1,String)
End If
Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_UniqueID,Integer)
Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Original_ResourceID,Integer)
If (Original_ResourceName Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(7).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(7).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(8).Value = CType(Original_ResourceName,String)
End If
If (Original_Color.HasValue = true) Then
Me.Adapter.UpdateCommand.Parameters(9).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(10).Value = CType(Original_Color.Value,Integer)
Else
Me.Adapter.UpdateCommand.Parameters(9).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value
End If
Me.Adapter.UpdateCommand.Parameters(11).Value = CType(UniqueID,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 ResourceID As Integer, ByVal ResourceName As String, ByVal Color As Global.System.Nullable(Of Integer), ByVal Image() As Byte, ByVal CustomField1 As String, ByVal Original_UniqueID As Integer, ByVal Original_ResourceID As Integer, ByVal Original_ResourceName As String, ByVal Original_Color As Global.System.Nullable(Of Integer)) As Integer
Return Me.Update(ResourceID, ResourceName, Color, Image, CustomField1, Original_UniqueID, Original_ResourceID, Original_ResourceName, Original_Color, Original_UniqueID)
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 _tBPMO_APPOINTMENTSTableAdapter As TBPMO_APPOINTMENTSTableAdapter
Private _tBPMO_RESOURCESTableAdapter As TBPMO_RESOURCESTableAdapter
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 TBPMO_APPOINTMENTSTableAdapter() As TBPMO_APPOINTMENTSTableAdapter
Get
Return Me._tBPMO_APPOINTMENTSTableAdapter
End Get
Set
Me._tBPMO_APPOINTMENTSTableAdapter = value
End Set
End Property
_
Public Property TBPMO_RESOURCESTableAdapter() As TBPMO_RESOURCESTableAdapter
Get
Return Me._tBPMO_RESOURCESTableAdapter
End Get
Set
Me._tBPMO_RESOURCESTableAdapter = 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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) _
AndAlso (Not (Me._tBPMO_APPOINTMENTSTableAdapter.Connection) Is Nothing)) Then
Return Me._tBPMO_APPOINTMENTSTableAdapter.Connection
End If
If ((Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) _
AndAlso (Not (Me._tBPMO_RESOURCESTableAdapter.Connection) Is Nothing)) Then
Return Me._tBPMO_RESOURCESTableAdapter.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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
count = (count + 1)
End If
If (Not (Me._tBPMO_RESOURCESTableAdapter) 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 DD_DMSDataSetCalendar, 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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBPMO_APPOINTMENTS.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._tBPMO_APPOINTMENTSTableAdapter.Update(updatedRows))
allChangedRows.AddRange(updatedRows)
End If
End If
If (Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) Then
Dim updatedRows() As Global.System.Data.DataRow = dataSet.TBPMO_RESOURCES.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._tBPMO_RESOURCESTableAdapter.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 DD_DMSDataSetCalendar, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
Dim result As Integer = 0
If (Not (Me._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
Dim addedRows() As Global.System.Data.DataRow = dataSet.TBPMO_APPOINTMENTS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added)
If ((Not (addedRows) Is Nothing) _
AndAlso (0 < addedRows.Length)) Then
result = (result + Me._tBPMO_APPOINTMENTSTableAdapter.Update(addedRows))
allAddedRows.AddRange(addedRows)
End If
End If
If (Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) Then
Dim addedRows() As Global.System.Data.DataRow = dataSet.TBPMO_RESOURCES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added)
If ((Not (addedRows) Is Nothing) _
AndAlso (0 < addedRows.Length)) Then
result = (result + Me._tBPMO_RESOURCESTableAdapter.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 DD_DMSDataSetCalendar, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer
Dim result As Integer = 0
If (Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) Then
Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBPMO_RESOURCES.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted)
If ((Not (deletedRows) Is Nothing) _
AndAlso (0 < deletedRows.Length)) Then
result = (result + Me._tBPMO_RESOURCESTableAdapter.Update(deletedRows))
allChangedRows.AddRange(deletedRows)
End If
End If
If (Not (Me._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
Dim deletedRows() As Global.System.Data.DataRow = dataSet.TBPMO_APPOINTMENTS.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted)
If ((Not (deletedRows) Is Nothing) _
AndAlso (0 < deletedRows.Length)) Then
result = (result + Me._tBPMO_APPOINTMENTSTableAdapter.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 DD_DMSDataSetCalendar) 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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) _
AndAlso (Me.MatchTableAdapterConnection(Me._tBPMO_APPOINTMENTSTableAdapter.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._tBPMO_RESOURCESTableAdapter) Is Nothing) _
AndAlso (Me.MatchTableAdapterConnection(Me._tBPMO_RESOURCESTableAdapter.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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
revertConnections.Add(Me._tBPMO_APPOINTMENTSTableAdapter, Me._tBPMO_APPOINTMENTSTableAdapter.Connection)
Me._tBPMO_APPOINTMENTSTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection)
Me._tBPMO_APPOINTMENTSTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction)
If Me._tBPMO_APPOINTMENTSTableAdapter.Adapter.AcceptChangesDuringUpdate Then
Me._tBPMO_APPOINTMENTSTableAdapter.Adapter.AcceptChangesDuringUpdate = false
adaptersWithAcceptChangesDuringUpdate.Add(Me._tBPMO_APPOINTMENTSTableAdapter.Adapter)
End If
End If
If (Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) Then
revertConnections.Add(Me._tBPMO_RESOURCESTableAdapter, Me._tBPMO_RESOURCESTableAdapter.Connection)
Me._tBPMO_RESOURCESTableAdapter.Connection = CType(workConnection,Global.System.Data.SqlClient.SqlConnection)
Me._tBPMO_RESOURCESTableAdapter.Transaction = CType(workTransaction,Global.System.Data.SqlClient.SqlTransaction)
If Me._tBPMO_RESOURCESTableAdapter.Adapter.AcceptChangesDuringUpdate Then
Me._tBPMO_RESOURCESTableAdapter.Adapter.AcceptChangesDuringUpdate = false
adaptersWithAcceptChangesDuringUpdate.Add(Me._tBPMO_RESOURCESTableAdapter.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._tBPMO_APPOINTMENTSTableAdapter) Is Nothing) Then
Me._tBPMO_APPOINTMENTSTableAdapter.Connection = CType(revertConnections(Me._tBPMO_APPOINTMENTSTableAdapter),Global.System.Data.SqlClient.SqlConnection)
Me._tBPMO_APPOINTMENTSTableAdapter.Transaction = Nothing
End If
If (Not (Me._tBPMO_RESOURCESTableAdapter) Is Nothing) Then
Me._tBPMO_RESOURCESTableAdapter.Connection = CType(revertConnections(Me._tBPMO_RESOURCESTableAdapter),Global.System.Data.SqlClient.SqlConnection)
Me._tBPMO_RESOURCESTableAdapter.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