diff --git a/VB/SimpleCustomFields/CarsDBDataSet.Designer.vb b/VB/SimpleCustomFields/CarsDBDataSet.Designer.vb index 7df9b74..98c4aa6 100644 --- a/VB/SimpleCustomFields/CarsDBDataSet.Designer.vb +++ b/VB/SimpleCustomFields/CarsDBDataSet.Designer.vb @@ -8,3154 +8,3438 @@ ' '------------------------------------------------------------------------------ - +#Disable Warning BC1591 Namespace SimpleCustomFields - ''' - '''Represents a strongly typed in-memory cache of data. - ''' - - Partial Public Class CarsDBDataSet - Inherits System.Data.DataSet - - Private tableCars As CarsDataTable - - Private tableCarScheduling As CarSchedulingDataTable - - Private relationCarsCarScheduling As Global.System.Data.DataRelation - - Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema - - - Public Sub New() - Me.BeginInit() - Me.InitClass() - Dim schemaChangedHandler As New 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 New Global.System.ComponentModel.CollectionChangeEventHandler(AddressOf Me.SchemaChanged) - AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 - AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 - Return - End If - Dim strSchema As String = (CStr(info.GetValue("XmlSchema", GetType(String)))) - If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then - Dim ds As New Global.System.Data.DataSet() - ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) - If (ds.Tables("Cars") IsNot Nothing) Then - MyBase.Tables.Add(New CarsDataTable(ds.Tables("Cars"))) - End If - If (ds.Tables("CarScheduling") IsNot Nothing) Then - MyBase.Tables.Add(New CarSchedulingDataTable(ds.Tables("CarScheduling"))) - 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 New Global.System.ComponentModel.CollectionChangeEventHandler(AddressOf Me.SchemaChanged) - AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler - AddHandler Me.Relations.CollectionChanged, schemaChangedHandler - End Sub - - - Public ReadOnly Property Cars() As CarsDataTable - Get - Return Me.tableCars - End Get - End Property - - - Public ReadOnly Property CarScheduling() As CarSchedulingDataTable - Get - Return Me.tableCarScheduling - End Get - End Property - - - Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode - Get - Return Me._schemaSerializationMode - End Get - Set(ByVal value As System.Data.SchemaSerializationMode) - Me._schemaSerializationMode = value - End Set - End Property - - - Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection - Get - Return MyBase.Tables - End Get - End Property - - - Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection - Get - Return MyBase.Relations - End Get - End Property - - - Protected Overrides Sub InitializeDerivedDataSet() - Me.BeginInit() - Me.InitClass() - Me.EndInit() - End Sub - - - Public Overrides Function Clone() As Global.System.Data.DataSet - Dim cln As CarsDBDataSet = (CType(MyBase.Clone(), CarsDBDataSet)) - 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 New Global.System.Data.DataSet() - ds.ReadXml(reader) - If (ds.Tables("Cars") IsNot Nothing) Then - MyBase.Tables.Add(New CarsDataTable(ds.Tables("Cars"))) - End If - If (ds.Tables("CarScheduling") IsNot Nothing) Then - MyBase.Tables.Add(New CarSchedulingDataTable(ds.Tables("CarScheduling"))) - 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 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 Sub InitVars() - Me.InitVars(True) - End Sub - - - Friend Sub InitVars(ByVal initTable As Boolean) - Me.tableCars = (CType(MyBase.Tables("Cars"), CarsDataTable)) - If (initTable = True) Then - If (Me.tableCars IsNot Nothing) Then - Me.tableCars.InitVars() - End If - End If - Me.tableCarScheduling = (CType(MyBase.Tables("CarScheduling"), CarSchedulingDataTable)) - If (initTable = True) Then - If (Me.tableCarScheduling IsNot Nothing) Then - Me.tableCarScheduling.InitVars() - End If - End If - Me.relationCarsCarScheduling = Me.Relations("CarsCarScheduling") - End Sub - - - Private Sub InitClass() - Me.DataSetName = "CarsDBDataSet" - Me.Prefix = "" - Me.Namespace = "http://tempuri.org/CarsDBDataSet.xsd" - Me.EnforceConstraints = True - Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema - Me.tableCars = New CarsDataTable() - MyBase.Tables.Add(Me.tableCars) - Me.tableCarScheduling = New CarSchedulingDataTable() - MyBase.Tables.Add(Me.tableCarScheduling) - Me.relationCarsCarScheduling = New Global.System.Data.DataRelation("CarsCarScheduling", New Global.System.Data.DataColumn() {Me.tableCars.IDColumn}, New Global.System.Data.DataColumn() {Me.tableCarScheduling.CarIdColumn}, False) - Me.Relations.Add(Me.relationCarsCarScheduling) - End Sub - - - Private Function ShouldSerializeCars() As Boolean - Return False - End Function - - - Private Function ShouldSerializeCarScheduling() 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 New CarsDBDataSet() - Dim type As New Global.System.Xml.Schema.XmlSchemaComplexType() - Dim sequence As New Global.System.Xml.Schema.XmlSchemaSequence() - Dim any As 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 New Global.System.IO.MemoryStream() - Dim s2 As New Global.System.IO.MemoryStream() - Try - Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing - dsSchema.Write(s1) - Dim schemas As 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 (s1 IsNot Nothing) Then - s1.Close() - End If - If (s2 IsNot Nothing) Then - s2.Close() - End If - End Try - End If - xs.Add(dsSchema) - Return type - End Function - - - Public Delegate Sub CarsRowChangeEventHandler(ByVal sender As Object, ByVal e As CarsRowChangeEvent) - - - Public Delegate Sub CarSchedulingRowChangeEventHandler(ByVal sender As Object, ByVal e As CarSchedulingRowChangeEvent) - - ''' - '''Represents the strongly named DataTable class. - ''' - - Partial Public Class CarsDataTable - Inherits System.Data.TypedTableBase(Of CarsRow) - - Private columnID As Global.System.Data.DataColumn - - Private columnTrademark As Global.System.Data.DataColumn - - Private columnModel As Global.System.Data.DataColumn - - Private columnHP As Global.System.Data.DataColumn - - Private columnLiter As Global.System.Data.DataColumn - - Private columnCyl As Global.System.Data.DataColumn - - Private columnTransmissSpeedCount As Global.System.Data.DataColumn - - Private columnTransmissAutomatic As Global.System.Data.DataColumn - - Private columnMPG_City As Global.System.Data.DataColumn - - Private columnMPG_Highway As Global.System.Data.DataColumn - - Private columnCategory As Global.System.Data.DataColumn - - Private columnDescription As Global.System.Data.DataColumn - - Private columnHyperlink As Global.System.Data.DataColumn - - Private columnPicture As Global.System.Data.DataColumn - - Private columnPrice As Global.System.Data.DataColumn - - Private columnRtfContent As Global.System.Data.DataColumn - - - Public Sub New() - Me.TableName = "Cars" - Me.BeginInit() - Me.InitClass() - Me.EndInit() - End Sub - - - Friend Sub New(ByVal table As Global.System.Data.DataTable) - Me.TableName = table.TableName - If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then - Me.CaseSensitive = table.CaseSensitive - End If - If (table.Locale.ToString() <> table.DataSet.Locale.ToString()) Then - Me.Locale = table.Locale - End If - If (table.Namespace <> table.DataSet.Namespace) Then - Me.Namespace = table.Namespace - End If - Me.Prefix = table.Prefix - Me.MinimumCapacity = table.MinimumCapacity - End Sub - - - Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - Me.InitVars() - End Sub - - - Public ReadOnly Property IDColumn() As Global.System.Data.DataColumn - Get - Return Me.columnID - End Get - End Property - - - Public ReadOnly Property TrademarkColumn() As Global.System.Data.DataColumn - Get - Return Me.columnTrademark - End Get - End Property - - - Public ReadOnly Property ModelColumn() As Global.System.Data.DataColumn - Get - Return Me.columnModel - End Get - End Property - - - Public ReadOnly Property HPColumn() As Global.System.Data.DataColumn - Get - Return Me.columnHP - End Get - End Property - - - Public ReadOnly Property LiterColumn() As Global.System.Data.DataColumn - Get - Return Me.columnLiter - End Get - End Property - - - Public ReadOnly Property CylColumn() As Global.System.Data.DataColumn - Get - Return Me.columnCyl - End Get - End Property - - - Public ReadOnly Property TransmissSpeedCountColumn() As Global.System.Data.DataColumn - Get - Return Me.columnTransmissSpeedCount - End Get - End Property - - - Public ReadOnly Property TransmissAutomaticColumn() As Global.System.Data.DataColumn - Get - Return Me.columnTransmissAutomatic - End Get - End Property - - - Public ReadOnly Property MPG_CityColumn() As Global.System.Data.DataColumn - Get - Return Me.columnMPG_City - End Get - End Property - - - Public ReadOnly Property MPG_HighwayColumn() As Global.System.Data.DataColumn - Get - Return Me.columnMPG_Highway - End Get - End Property - - - Public ReadOnly Property CategoryColumn() As Global.System.Data.DataColumn - Get - Return Me.columnCategory - End Get - End Property - - - Public ReadOnly Property DescriptionColumn() As Global.System.Data.DataColumn - Get - Return Me.columnDescription - End Get - End Property - - - Public ReadOnly Property HyperlinkColumn() As Global.System.Data.DataColumn - Get - Return Me.columnHyperlink - End Get - End Property - - - Public ReadOnly Property PictureColumn() As Global.System.Data.DataColumn - Get - Return Me.columnPicture - End Get - End Property - - - Public ReadOnly Property PriceColumn() As Global.System.Data.DataColumn - Get - Return Me.columnPrice - End Get - End Property - - - Public ReadOnly Property RtfContentColumn() As Global.System.Data.DataColumn - Get - Return Me.columnRtfContent - End Get - End Property - - - Public ReadOnly Property Count() As Integer - Get - Return Me.Rows.Count - End Get - End Property - - - Default Public ReadOnly Property Item(ByVal index As Integer) As CarsRow - Get - Return (CType(Me.Rows(index), CarsRow)) - End Get - End Property - - - Public Event CarsRowChanging As CarsRowChangeEventHandler - - - Public Event CarsRowChanged As CarsRowChangeEventHandler - - - Public Event CarsRowDeleting As CarsRowChangeEventHandler - - - Public Event CarsRowDeleted As CarsRowChangeEventHandler - - - Public Sub AddCarsRow(ByVal row As CarsRow) - Me.Rows.Add(row) - End Sub - - - Public Function AddCarsRow(ByVal Trademark As String, ByVal Model As String, ByVal HP As Short, ByVal Liter As Double, ByVal Cyl As Byte, ByVal TransmissSpeedCount As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City As Byte, ByVal MPG_Highway As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price As Decimal, ByVal RtfContent As String) As CarsRow - Dim rowCarsRow As CarsRow = (CType(Me.NewRow(), CarsRow)) - Dim columnValuesArray() As Object = {Nothing, Trademark, Model, HP, Liter, Cyl, TransmissSpeedCount, TransmissAutomatic, MPG_City, MPG_Highway, Category, Description, Hyperlink, Picture, Price, RtfContent} - rowCarsRow.ItemArray = columnValuesArray - Me.Rows.Add(rowCarsRow) - Return rowCarsRow - End Function - - - Public Function FindByID(ByVal ID As Integer) As CarsRow - Return (CType(Me.Rows.Find(New Object() {ID}), CarsRow)) - End Function - - - Public Overrides Function Clone() As Global.System.Data.DataTable - Dim cln As CarsDataTable = (CType(MyBase.Clone(), CarsDataTable)) - cln.InitVars() - Return cln - End Function - - - Protected Overrides Function CreateInstance() As Global.System.Data.DataTable - Return New CarsDataTable() - End Function - - - Friend Sub InitVars() - Me.columnID = MyBase.Columns("ID") - Me.columnTrademark = MyBase.Columns("Trademark") - Me.columnModel = MyBase.Columns("Model") - Me.columnHP = MyBase.Columns("HP") - Me.columnLiter = MyBase.Columns("Liter") - Me.columnCyl = MyBase.Columns("Cyl") - Me.columnTransmissSpeedCount = MyBase.Columns("TransmissSpeedCount") - Me.columnTransmissAutomatic = MyBase.Columns("TransmissAutomatic") - Me.columnMPG_City = MyBase.Columns("MPG_City") - Me.columnMPG_Highway = MyBase.Columns("MPG_Highway") - Me.columnCategory = MyBase.Columns("Category") - Me.columnDescription = MyBase.Columns("Description") - Me.columnHyperlink = MyBase.Columns("Hyperlink") - Me.columnPicture = MyBase.Columns("Picture") - Me.columnPrice = MyBase.Columns("Price") - Me.columnRtfContent = MyBase.Columns("RtfContent") - End Sub - - - Private Sub InitClass() - Me.columnID = New Global.System.Data.DataColumn("ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnID) - Me.columnTrademark = New Global.System.Data.DataColumn("Trademark", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnTrademark) - Me.columnModel = New Global.System.Data.DataColumn("Model", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnModel) - Me.columnHP = New Global.System.Data.DataColumn("HP", GetType(Short), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnHP) - Me.columnLiter = New Global.System.Data.DataColumn("Liter", GetType(Double), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnLiter) - Me.columnCyl = New Global.System.Data.DataColumn("Cyl", GetType(Byte), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnCyl) - Me.columnTransmissSpeedCount = New Global.System.Data.DataColumn("TransmissSpeedCount", GetType(Byte), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnTransmissSpeedCount) - Me.columnTransmissAutomatic = New Global.System.Data.DataColumn("TransmissAutomatic", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnTransmissAutomatic) - Me.columnMPG_City = New Global.System.Data.DataColumn("MPG_City", GetType(Byte), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnMPG_City) - Me.columnMPG_Highway = New Global.System.Data.DataColumn("MPG_Highway", GetType(Byte), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnMPG_Highway) - Me.columnCategory = New Global.System.Data.DataColumn("Category", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnCategory) - Me.columnDescription = New Global.System.Data.DataColumn("Description", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnDescription) - Me.columnHyperlink = New Global.System.Data.DataColumn("Hyperlink", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnHyperlink) - Me.columnPicture = New Global.System.Data.DataColumn("Picture", GetType(Byte()), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnPicture) - Me.columnPrice = New Global.System.Data.DataColumn("Price", GetType(Decimal), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnPrice) - Me.columnRtfContent = New Global.System.Data.DataColumn("RtfContent", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnRtfContent) - Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnID}, True)) - Me.columnID.AutoIncrement = True - Me.columnID.AllowDBNull = False - Me.columnID.Unique = True - Me.columnTrademark.MaxLength = 50 - Me.columnModel.MaxLength = 50 - Me.columnTransmissAutomatic.MaxLength = 3 - Me.columnCategory.MaxLength = 7 - Me.columnDescription.MaxLength = 536870910 - Me.columnHyperlink.MaxLength = 50 - Me.columnRtfContent.MaxLength = 536870910 - End Sub - - - Public Function NewCarsRow() As CarsRow - Return (CType(Me.NewRow(), CarsRow)) - End Function - - - Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow - Return New CarsRow(builder) - End Function - - - Protected Overrides Function GetRowType() As Global.System.Type - Return GetType(CarsRow) - End Function - - - Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowChanged(e) - RaiseEvent CarsRowChanged(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowChanging(e) - RaiseEvent CarsRowChanging(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowDeleted(e) - RaiseEvent CarsRowDeleted(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowDeleting(e) - RaiseEvent CarsRowDeleting(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) - End Sub - - - Public Sub RemoveCarsRow(ByVal row As CarsRow) - 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 New Global.System.Xml.Schema.XmlSchemaComplexType() - Dim sequence As New Global.System.Xml.Schema.XmlSchemaSequence() - Dim ds As New CarsDBDataSet() - Dim any1 As 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 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 New Global.System.Xml.Schema.XmlSchemaAttribute() - attribute1.Name = "namespace" - attribute1.FixedValue = ds.Namespace - type.Attributes.Add(attribute1) - Dim attribute2 As New Global.System.Xml.Schema.XmlSchemaAttribute() - attribute2.Name = "tableTypeName" - attribute2.FixedValue = "CarsDataTable" - 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 New Global.System.IO.MemoryStream() - Dim s2 As New Global.System.IO.MemoryStream() - Try - Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing - dsSchema.Write(s1) - Dim schemas As 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 (s1 IsNot Nothing) Then - s1.Close() - End If - If (s2 IsNot 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 CarSchedulingDataTable - Inherits System.Data.TypedTableBase(Of CarSchedulingRow) - - Private columnID As Global.System.Data.DataColumn - - Private columnCarId As Global.System.Data.DataColumn - - Private columnUserId As Global.System.Data.DataColumn - - Private columnStatus As Global.System.Data.DataColumn - - Private columnSubject As Global.System.Data.DataColumn - - Private columnDescription As Global.System.Data.DataColumn - - Private columnLabel As Global.System.Data.DataColumn - - Private columnStartTime As Global.System.Data.DataColumn - - Private columnEndTime As Global.System.Data.DataColumn - - Private columnLocation As Global.System.Data.DataColumn - - Private columnAllDay As Global.System.Data.DataColumn - - Private columnEventType As Global.System.Data.DataColumn - - Private columnRecurrenceInfo As Global.System.Data.DataColumn - - Private columnReminderInfo As Global.System.Data.DataColumn - - Private columnPrice As Global.System.Data.DataColumn - - Private columnContactInfo As Global.System.Data.DataColumn - - - Public Sub New() - Me.TableName = "CarScheduling" - Me.BeginInit() - Me.InitClass() - Me.EndInit() - End Sub - - - Friend Sub New(ByVal table As Global.System.Data.DataTable) - Me.TableName = table.TableName - If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then - Me.CaseSensitive = table.CaseSensitive - End If - If (table.Locale.ToString() <> table.DataSet.Locale.ToString()) Then - Me.Locale = table.Locale - End If - If (table.Namespace <> table.DataSet.Namespace) Then - Me.Namespace = table.Namespace - End If - Me.Prefix = table.Prefix - Me.MinimumCapacity = table.MinimumCapacity - End Sub - - - Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) - MyBase.New(info, context) - Me.InitVars() - End Sub - - - Public ReadOnly Property IDColumn() As Global.System.Data.DataColumn - Get - Return Me.columnID - End Get - End Property - - - Public ReadOnly Property CarIdColumn() As Global.System.Data.DataColumn - Get - Return Me.columnCarId - End Get - End Property - - - Public ReadOnly Property UserIdColumn() As Global.System.Data.DataColumn - Get - Return Me.columnUserId - End Get - End Property - - - Public ReadOnly Property StatusColumn() As Global.System.Data.DataColumn - Get - Return Me.columnStatus - End Get - End Property - - - Public ReadOnly Property SubjectColumn() As Global.System.Data.DataColumn - Get - Return Me.columnSubject - End Get - End Property - - - Public ReadOnly Property DescriptionColumn() As Global.System.Data.DataColumn - Get - Return Me.columnDescription - End Get - End Property - - - Public ReadOnly Property LabelColumn() As Global.System.Data.DataColumn - Get - Return Me.columnLabel - End Get - End Property - - - Public ReadOnly Property StartTimeColumn() As Global.System.Data.DataColumn - Get - Return Me.columnStartTime - End Get - End Property - - - Public ReadOnly Property EndTimeColumn() As Global.System.Data.DataColumn - Get - Return Me.columnEndTime - End Get - End Property - - - Public ReadOnly Property LocationColumn() As Global.System.Data.DataColumn - Get - Return Me.columnLocation - End Get - End Property - - - Public ReadOnly Property AllDayColumn() As Global.System.Data.DataColumn - Get - Return Me.columnAllDay - End Get - End Property - - - Public ReadOnly Property EventTypeColumn() As Global.System.Data.DataColumn - Get - Return Me.columnEventType - End Get - End Property - - - Public ReadOnly Property RecurrenceInfoColumn() As Global.System.Data.DataColumn - Get - Return Me.columnRecurrenceInfo - End Get - End Property - - - Public ReadOnly Property ReminderInfoColumn() As Global.System.Data.DataColumn - Get - Return Me.columnReminderInfo - End Get - End Property - - - Public ReadOnly Property PriceColumn() As Global.System.Data.DataColumn - Get - Return Me.columnPrice - End Get - End Property - - - Public ReadOnly Property ContactInfoColumn() As Global.System.Data.DataColumn - Get - Return Me.columnContactInfo - End Get - End Property - - - Public ReadOnly Property Count() As Integer - Get - Return Me.Rows.Count - End Get - End Property - - - Default Public ReadOnly Property Item(ByVal index As Integer) As CarSchedulingRow - Get - Return (CType(Me.Rows(index), CarSchedulingRow)) - End Get - End Property - - - Public Event CarSchedulingRowChanging As CarSchedulingRowChangeEventHandler - - - Public Event CarSchedulingRowChanged As CarSchedulingRowChangeEventHandler - - - Public Event CarSchedulingRowDeleting As CarSchedulingRowChangeEventHandler - - - Public Event CarSchedulingRowDeleted As CarSchedulingRowChangeEventHandler - - - Public Sub AddCarSchedulingRow(ByVal row As CarSchedulingRow) - Me.Rows.Add(row) - End Sub - - - Public Function AddCarSchedulingRow(ByVal parentCarsRowByCarsCarScheduling As CarsRow, ByVal UserId As Integer, ByVal Status As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label As Integer, ByVal StartTime As Date, ByVal EndTime As Date, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price As Decimal, ByVal ContactInfo As String) As CarSchedulingRow - Dim rowCarSchedulingRow As CarSchedulingRow = (CType(Me.NewRow(), CarSchedulingRow)) - Dim columnValuesArray() As Object = {Nothing, Nothing, UserId, Status, Subject, Description, Label, StartTime, EndTime, Location, AllDay, EventType, RecurrenceInfo, ReminderInfo, Price, ContactInfo} - If (parentCarsRowByCarsCarScheduling IsNot Nothing) Then - columnValuesArray(1) = parentCarsRowByCarsCarScheduling(0) - End If - rowCarSchedulingRow.ItemArray = columnValuesArray - Me.Rows.Add(rowCarSchedulingRow) - Return rowCarSchedulingRow - End Function - - - Public Function FindByID(ByVal ID As Integer) As CarSchedulingRow - Return (CType(Me.Rows.Find(New Object() {ID}), CarSchedulingRow)) - End Function - - - Public Overrides Function Clone() As Global.System.Data.DataTable - Dim cln As CarSchedulingDataTable = (CType(MyBase.Clone(), CarSchedulingDataTable)) - cln.InitVars() - Return cln - End Function - - - Protected Overrides Function CreateInstance() As Global.System.Data.DataTable - Return New CarSchedulingDataTable() - End Function - - - Friend Sub InitVars() - Me.columnID = MyBase.Columns("ID") - Me.columnCarId = MyBase.Columns("CarId") - Me.columnUserId = MyBase.Columns("UserId") - Me.columnStatus = MyBase.Columns("Status") - Me.columnSubject = MyBase.Columns("Subject") - Me.columnDescription = MyBase.Columns("Description") - Me.columnLabel = MyBase.Columns("Label") - Me.columnStartTime = MyBase.Columns("StartTime") - Me.columnEndTime = MyBase.Columns("EndTime") - Me.columnLocation = MyBase.Columns("Location") - Me.columnAllDay = MyBase.Columns("AllDay") - Me.columnEventType = MyBase.Columns("EventType") - Me.columnRecurrenceInfo = MyBase.Columns("RecurrenceInfo") - Me.columnReminderInfo = MyBase.Columns("ReminderInfo") - Me.columnPrice = MyBase.Columns("Price") - Me.columnContactInfo = MyBase.Columns("ContactInfo") - End Sub - - - Private Sub InitClass() - Me.columnID = New Global.System.Data.DataColumn("ID", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnID) - Me.columnCarId = New Global.System.Data.DataColumn("CarId", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnCarId) - Me.columnUserId = New Global.System.Data.DataColumn("UserId", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnUserId) - Me.columnStatus = New Global.System.Data.DataColumn("Status", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnStatus) - Me.columnSubject = New Global.System.Data.DataColumn("Subject", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnSubject) - Me.columnDescription = New Global.System.Data.DataColumn("Description", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnDescription) - Me.columnLabel = New Global.System.Data.DataColumn("Label", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnLabel) - Me.columnStartTime = New Global.System.Data.DataColumn("StartTime", GetType(Date), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnStartTime) - Me.columnEndTime = New Global.System.Data.DataColumn("EndTime", GetType(Date), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnEndTime) - Me.columnLocation = New Global.System.Data.DataColumn("Location", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnLocation) - Me.columnAllDay = New Global.System.Data.DataColumn("AllDay", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnAllDay) - Me.columnEventType = New Global.System.Data.DataColumn("EventType", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnEventType) - Me.columnRecurrenceInfo = New Global.System.Data.DataColumn("RecurrenceInfo", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnRecurrenceInfo) - Me.columnReminderInfo = New Global.System.Data.DataColumn("ReminderInfo", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnReminderInfo) - Me.columnPrice = New Global.System.Data.DataColumn("Price", GetType(Decimal), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnPrice) - Me.columnContactInfo = New Global.System.Data.DataColumn("ContactInfo", GetType(String), Nothing, Global.System.Data.MappingType.Element) - MyBase.Columns.Add(Me.columnContactInfo) - Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnID}, True)) - Me.columnID.AutoIncrement = True - Me.columnID.AllowDBNull = False - Me.columnID.Unique = True - Me.columnSubject.MaxLength = 50 - Me.columnDescription.MaxLength = 536870910 - Me.columnLocation.MaxLength = 50 - Me.columnRecurrenceInfo.MaxLength = 536870910 - Me.columnReminderInfo.MaxLength = 536870910 - Me.columnContactInfo.MaxLength = 536870910 - End Sub - - - Public Function NewCarSchedulingRow() As CarSchedulingRow - Return (CType(Me.NewRow(), CarSchedulingRow)) - End Function - - - Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow - Return New CarSchedulingRow(builder) - End Function - - - Protected Overrides Function GetRowType() As Global.System.Type - Return GetType(CarSchedulingRow) - End Function - - - Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowChanged(e) - RaiseEvent CarSchedulingRowChanged(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowChanging(e) - RaiseEvent CarSchedulingRowChanging(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowDeleted(e) - RaiseEvent CarSchedulingRowDeleted(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) - End Sub - - - Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) - MyBase.OnRowDeleting(e) - RaiseEvent CarSchedulingRowDeleting(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) - End Sub - - - Public Sub RemoveCarSchedulingRow(ByVal row As CarSchedulingRow) - 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 New Global.System.Xml.Schema.XmlSchemaComplexType() - Dim sequence As New Global.System.Xml.Schema.XmlSchemaSequence() - Dim ds As New CarsDBDataSet() - Dim any1 As 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 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 New Global.System.Xml.Schema.XmlSchemaAttribute() - attribute1.Name = "namespace" - attribute1.FixedValue = ds.Namespace - type.Attributes.Add(attribute1) - Dim attribute2 As New Global.System.Xml.Schema.XmlSchemaAttribute() - attribute2.Name = "tableTypeName" - attribute2.FixedValue = "CarSchedulingDataTable" - 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 New Global.System.IO.MemoryStream() - Dim s2 As New Global.System.IO.MemoryStream() - Try - Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing - dsSchema.Write(s1) - Dim schemas As 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 (s1 IsNot Nothing) Then - s1.Close() - End If - If (s2 IsNot 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 CarsRow - Inherits System.Data.DataRow - - Private tableCars As CarsDataTable - - - Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) - MyBase.New(rb) - Me.tableCars = (CType(Me.Table, CarsDataTable)) - End Sub - - - Public Property ID() As Integer - Get - Return (CInt((Me(Me.tableCars.IDColumn)))) - End Get - Set(ByVal value As Integer) - Me(Me.tableCars.IDColumn) = value - End Set - End Property - - - Public Property Trademark() As String - Get - Try - Return (CStr(Me(Me.tableCars.TrademarkColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Trademark' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.TrademarkColumn) = value - End Set - End Property - - - Public Property Model() As String - Get - Try - Return (CStr(Me(Me.tableCars.ModelColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Model' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.ModelColumn) = value - End Set - End Property - - - Public Property HP() As Short - Get - Try - Return (CShort(Me(Me.tableCars.HPColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'HP' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Short) - Me(Me.tableCars.HPColumn) = value - End Set - End Property - - - Public Property Liter() As Double - Get - Try - Return (CDbl(Me(Me.tableCars.LiterColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Liter' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Double) - Me(Me.tableCars.LiterColumn) = value - End Set - End Property - - - Public Property Cyl() As Byte - Get - Try - Return (CByte(Me(Me.tableCars.CylColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Cyl' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Byte) - Me(Me.tableCars.CylColumn) = value - End Set - End Property - - - Public Property TransmissSpeedCount() As Byte - Get - Try - Return (CByte(Me(Me.tableCars.TransmissSpeedCountColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'TransmissSpeedCount' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Byte) - Me(Me.tableCars.TransmissSpeedCountColumn) = value - End Set - End Property - - - Public Property TransmissAutomatic() As String - Get - Try - Return (CStr(Me(Me.tableCars.TransmissAutomaticColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'TransmissAutomatic' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.TransmissAutomaticColumn) = value - End Set - End Property - - - Public Property MPG_City() As Byte - Get - Try - Return (CByte(Me(Me.tableCars.MPG_CityColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'MPG_City' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Byte) - Me(Me.tableCars.MPG_CityColumn) = value - End Set - End Property - - - Public Property MPG_Highway() As Byte - Get - Try - Return (CByte(Me(Me.tableCars.MPG_HighwayColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'MPG_Highway' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Byte) - Me(Me.tableCars.MPG_HighwayColumn) = value - End Set - End Property - - - Public Property Category() As String - Get - Try - Return (CStr(Me(Me.tableCars.CategoryColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Category' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.CategoryColumn) = value - End Set - End Property - - - Public Property Description() As String - Get - Try - Return (CStr(Me(Me.tableCars.DescriptionColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Description' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.DescriptionColumn) = value - End Set - End Property - - - Public Property Hyperlink() As String - Get - Try - Return (CStr(Me(Me.tableCars.HyperlinkColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Hyperlink' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.HyperlinkColumn) = value - End Set - End Property - - - Public Property Picture() As Byte() - Get - Try - Return (CType(Me(Me.tableCars.PictureColumn), Byte())) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Picture' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Byte()) - Me(Me.tableCars.PictureColumn) = value - End Set - End Property - - - Public Property Price() As Decimal - Get - Try - Return (CDec(Me(Me.tableCars.PriceColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Price' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As Decimal) - Me(Me.tableCars.PriceColumn) = value - End Set - End Property - - - Public Property RtfContent() As String - Get - Try - Return (CStr(Me(Me.tableCars.RtfContentColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'RtfContent' in table 'Cars' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCars.RtfContentColumn) = value - End Set - End Property - - - Public Function IsTrademarkNull() As Boolean - Return Me.IsNull(Me.tableCars.TrademarkColumn) - End Function - - - Public Sub SetTrademarkNull() - Me(Me.tableCars.TrademarkColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsModelNull() As Boolean - Return Me.IsNull(Me.tableCars.ModelColumn) - End Function - - - Public Sub SetModelNull() - Me(Me.tableCars.ModelColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsHPNull() As Boolean - Return Me.IsNull(Me.tableCars.HPColumn) - End Function - - - Public Sub SetHPNull() - Me(Me.tableCars.HPColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsLiterNull() As Boolean - Return Me.IsNull(Me.tableCars.LiterColumn) - End Function - - - Public Sub SetLiterNull() - Me(Me.tableCars.LiterColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsCylNull() As Boolean - Return Me.IsNull(Me.tableCars.CylColumn) - End Function - - - Public Sub SetCylNull() - Me(Me.tableCars.CylColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsTransmissSpeedCountNull() As Boolean - Return Me.IsNull(Me.tableCars.TransmissSpeedCountColumn) - End Function - - - Public Sub SetTransmissSpeedCountNull() - Me(Me.tableCars.TransmissSpeedCountColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsTransmissAutomaticNull() As Boolean - Return Me.IsNull(Me.tableCars.TransmissAutomaticColumn) - End Function - - - Public Sub SetTransmissAutomaticNull() - Me(Me.tableCars.TransmissAutomaticColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsMPG_CityNull() As Boolean - Return Me.IsNull(Me.tableCars.MPG_CityColumn) - End Function - - - Public Sub SetMPG_CityNull() - Me(Me.tableCars.MPG_CityColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsMPG_HighwayNull() As Boolean - Return Me.IsNull(Me.tableCars.MPG_HighwayColumn) - End Function - - - Public Sub SetMPG_HighwayNull() - Me(Me.tableCars.MPG_HighwayColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsCategoryNull() As Boolean - Return Me.IsNull(Me.tableCars.CategoryColumn) - End Function - - - Public Sub SetCategoryNull() - Me(Me.tableCars.CategoryColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsDescriptionNull() As Boolean - Return Me.IsNull(Me.tableCars.DescriptionColumn) - End Function - - - Public Sub SetDescriptionNull() - Me(Me.tableCars.DescriptionColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsHyperlinkNull() As Boolean - Return Me.IsNull(Me.tableCars.HyperlinkColumn) - End Function - - - Public Sub SetHyperlinkNull() - Me(Me.tableCars.HyperlinkColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsPictureNull() As Boolean - Return Me.IsNull(Me.tableCars.PictureColumn) - End Function - - - Public Sub SetPictureNull() - Me(Me.tableCars.PictureColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsPriceNull() As Boolean - Return Me.IsNull(Me.tableCars.PriceColumn) - End Function - - - Public Sub SetPriceNull() - Me(Me.tableCars.PriceColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsRtfContentNull() As Boolean - Return Me.IsNull(Me.tableCars.RtfContentColumn) - End Function - - - Public Sub SetRtfContentNull() - Me(Me.tableCars.RtfContentColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function GetCarSchedulingRows() As CarSchedulingRow() - If (Me.Table.ChildRelations("CarsCarScheduling") Is Nothing) Then - Return New CarSchedulingRow() {} - Else - Return (CType(MyBase.GetChildRows(Me.Table.ChildRelations("CarsCarScheduling")), CarSchedulingRow())) - End If - End Function - End Class - - ''' - '''Represents strongly named DataRow class. - ''' - Partial Public Class CarSchedulingRow - Inherits System.Data.DataRow - - Private tableCarScheduling As CarSchedulingDataTable - - - Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) - MyBase.New(rb) - Me.tableCarScheduling = (CType(Me.Table, CarSchedulingDataTable)) - End Sub - - - Public Property ID() As Integer - Get - Return (CInt((Me(Me.tableCarScheduling.IDColumn)))) - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.IDColumn) = value - End Set - End Property - - - Public Property CarId() As Integer - Get - Try - Return (CInt((Me(Me.tableCarScheduling.CarIdColumn)))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'CarId' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.CarIdColumn) = value - End Set - End Property - - - Public Property UserId() As Integer - Get - Try - Return (CInt((Me(Me.tableCarScheduling.UserIdColumn)))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'UserId' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.UserIdColumn) = value - End Set - End Property - - - Public Property Status() As Integer - Get - Try - Return (CInt((Me(Me.tableCarScheduling.StatusColumn)))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Status' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.StatusColumn) = value - End Set - End Property - - - Public Property Subject() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.SubjectColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Subject' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.SubjectColumn) = value - End Set - End Property - - - Public Property Description() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.DescriptionColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Description' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.DescriptionColumn) = value - End Set - End Property - - - Public Property Label() As Integer - Get - Try - Return (CInt((Me(Me.tableCarScheduling.LabelColumn)))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Label' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.LabelColumn) = value - End Set - End Property - - - Public Property StartTime() As Date - Get - Try - Return (CDate(Me(Me.tableCarScheduling.StartTimeColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'StartTime' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Date) - Me(Me.tableCarScheduling.StartTimeColumn) = value - End Set - End Property - - - Public Property EndTime() As Date - Get - Try - Return (CDate(Me(Me.tableCarScheduling.EndTimeColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'EndTime' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Date) - Me(Me.tableCarScheduling.EndTimeColumn) = value - End Set - End Property - - - Public Property Location() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.LocationColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Location' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.LocationColumn) = value - End Set - End Property - - - Public Property AllDay() As Boolean - Get - Try - Return (CBool(Me(Me.tableCarScheduling.AllDayColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'AllDay' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Boolean) - Me(Me.tableCarScheduling.AllDayColumn) = value - End Set - End Property - - - Public Property EventType() As Integer - Get - Try - Return (CInt((Me(Me.tableCarScheduling.EventTypeColumn)))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'EventType' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Integer) - Me(Me.tableCarScheduling.EventTypeColumn) = value - End Set - End Property - - - Public Property RecurrenceInfo() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.RecurrenceInfoColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'RecurrenceInfo' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.RecurrenceInfoColumn) = value - End Set - End Property - - - Public Property ReminderInfo() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.ReminderInfoColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'ReminderInfo' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.ReminderInfoColumn) = value - End Set - End Property - - - Public Property Price() As Decimal - Get - Try - Return (CDec(Me(Me.tableCarScheduling.PriceColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'Price' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As Decimal) - Me(Me.tableCarScheduling.PriceColumn) = value - End Set - End Property - - - Public Property ContactInfo() As String - Get - Try - Return (CStr(Me(Me.tableCarScheduling.ContactInfoColumn))) - Catch e As Global.System.InvalidCastException - Throw New Global.System.Data.StrongTypingException("The value for column 'ContactInfo' in table 'CarScheduling' is DBNull.", e) - End Try - End Get - Set(ByVal value As String) - Me(Me.tableCarScheduling.ContactInfoColumn) = value - End Set - End Property - - - Public Property CarsRow() As CarsRow - Get - Return (CType(Me.GetParentRow(Me.Table.ParentRelations("CarsCarScheduling")), CarsRow)) - End Get - Set(ByVal value As CarsRow) - Me.SetParentRow(value, Me.Table.ParentRelations("CarsCarScheduling")) - End Set - End Property - - - Public Function IsCarIdNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.CarIdColumn) - End Function - - - Public Sub SetCarIdNull() - Me(Me.tableCarScheduling.CarIdColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsUserIdNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.UserIdColumn) - End Function - - - Public Sub SetUserIdNull() - Me(Me.tableCarScheduling.UserIdColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsStatusNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.StatusColumn) - End Function - - - Public Sub SetStatusNull() - Me(Me.tableCarScheduling.StatusColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsSubjectNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.SubjectColumn) - End Function - - - Public Sub SetSubjectNull() - Me(Me.tableCarScheduling.SubjectColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsDescriptionNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.DescriptionColumn) - End Function - - - Public Sub SetDescriptionNull() - Me(Me.tableCarScheduling.DescriptionColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsLabelNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.LabelColumn) - End Function - - - Public Sub SetLabelNull() - Me(Me.tableCarScheduling.LabelColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsStartTimeNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.StartTimeColumn) - End Function - - - Public Sub SetStartTimeNull() - Me(Me.tableCarScheduling.StartTimeColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsEndTimeNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.EndTimeColumn) - End Function - - - Public Sub SetEndTimeNull() - Me(Me.tableCarScheduling.EndTimeColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsLocationNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.LocationColumn) - End Function - - - Public Sub SetLocationNull() - Me(Me.tableCarScheduling.LocationColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsAllDayNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.AllDayColumn) - End Function - - - Public Sub SetAllDayNull() - Me(Me.tableCarScheduling.AllDayColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsEventTypeNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.EventTypeColumn) - End Function - - - Public Sub SetEventTypeNull() - Me(Me.tableCarScheduling.EventTypeColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsRecurrenceInfoNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.RecurrenceInfoColumn) - End Function - - - Public Sub SetRecurrenceInfoNull() - Me(Me.tableCarScheduling.RecurrenceInfoColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsReminderInfoNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.ReminderInfoColumn) - End Function - - - Public Sub SetReminderInfoNull() - Me(Me.tableCarScheduling.ReminderInfoColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsPriceNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.PriceColumn) - End Function - - - Public Sub SetPriceNull() - Me(Me.tableCarScheduling.PriceColumn) = Global.System.Convert.DBNull - End Sub - - - Public Function IsContactInfoNull() As Boolean - Return Me.IsNull(Me.tableCarScheduling.ContactInfoColumn) - End Function - - - Public Sub SetContactInfoNull() - Me(Me.tableCarScheduling.ContactInfoColumn) = Global.System.Convert.DBNull - End Sub - End Class - - ''' - '''Row event argument class - ''' - - Public Class CarsRowChangeEvent - Inherits System.EventArgs - - Private eventRow As CarsRow - - Private eventAction As Global.System.Data.DataRowAction - - - Public Sub New(ByVal row As CarsRow, ByVal action As Global.System.Data.DataRowAction) - Me.eventRow = row - Me.eventAction = action - End Sub - - - Public ReadOnly Property Row() As CarsRow - 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 CarSchedulingRowChangeEvent - Inherits System.EventArgs - - Private eventRow As CarSchedulingRow - - Private eventAction As Global.System.Data.DataRowAction - - - Public Sub New(ByVal row As CarSchedulingRow, ByVal action As Global.System.Data.DataRowAction) - Me.eventRow = row - Me.eventAction = action - End Sub - - - Public ReadOnly Property Row() As CarSchedulingRow - 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 + ''' + '''Represents a strongly typed in-memory cache of data. + ''' + + + + + + + Partial Public Class CarsDBDataSet + Inherits System.Data.DataSet + + Private tableCars As CarsDataTable + + Private tableCarScheduling As CarSchedulingDataTable + + Private relationCarsCarScheduling As System.Data.DataRelation + + Private _schemaSerializationMode As System.Data.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + + + + Public Sub New() + Me.BeginInit() + Me.InitClass() + Dim schemaChangedHandler As New 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 System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) + MyBase.New(info, context, False) + If (Me.IsBinarySerialized(info, context) = True) Then + Me.InitVars(False) + Dim schemaChangedHandler1 As New System.ComponentModel.CollectionChangeEventHandler(AddressOf Me.SchemaChanged) + AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 + AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 + Return + End If + Dim strSchema As String = (CStr(info.GetValue("XmlSchema", GetType(String)))) + If (Me.DetermineSchemaSerializationMode(info, context) = System.Data.SchemaSerializationMode.IncludeSchema) Then + Dim ds As New System.Data.DataSet() + ds.ReadXmlSchema(New System.Xml.XmlTextReader(New System.IO.StringReader(strSchema))) + If (ds.Tables("Cars") IsNot Nothing) Then + MyBase.Tables.Add(New CarsDataTable(ds.Tables("Cars"))) + End If + If (ds.Tables("CarScheduling") IsNot Nothing) Then + MyBase.Tables.Add(New CarSchedulingDataTable(ds.Tables("CarScheduling"))) + 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, System.Data.MissingSchemaAction.Add) + Me.InitVars() + Else + Me.ReadXmlSchema(New System.Xml.XmlTextReader(New System.IO.StringReader(strSchema))) + End If + Me.GetSerializationData(info, context) + Dim schemaChangedHandler As New System.ComponentModel.CollectionChangeEventHandler(AddressOf Me.SchemaChanged) + AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler + AddHandler Me.Relations.CollectionChanged, schemaChangedHandler + End Sub + + + + + + Public ReadOnly Property Cars() As CarsDataTable + Get + Return Me.tableCars + End Get + End Property + + + + + + Public ReadOnly Property CarScheduling() As CarSchedulingDataTable + Get + Return Me.tableCarScheduling + End Get + End Property + + + + + + Public Overrides Property SchemaSerializationMode() As System.Data.SchemaSerializationMode + Get + Return Me._schemaSerializationMode + End Get + Set(ByVal value As System.Data.SchemaSerializationMode) + Me._schemaSerializationMode = value + End Set + End Property + + + + + Public Shadows ReadOnly Property Tables() As System.Data.DataTableCollection + Get + Return MyBase.Tables + End Get + End Property + + + + + Public Shadows ReadOnly Property Relations() As 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 System.Data.DataSet + Dim cln As CarsDBDataSet = (CType(MyBase.Clone(), CarsDBDataSet)) + 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 System.Xml.XmlReader) + If (Me.DetermineSchemaSerializationMode(reader) = System.Data.SchemaSerializationMode.IncludeSchema) Then + Me.Reset() + Dim ds As New System.Data.DataSet() + ds.ReadXml(reader) + If (ds.Tables("Cars") IsNot Nothing) Then + MyBase.Tables.Add(New CarsDataTable(ds.Tables("Cars"))) + End If + If (ds.Tables("CarScheduling") IsNot Nothing) Then + MyBase.Tables.Add(New CarSchedulingDataTable(ds.Tables("CarScheduling"))) + 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, System.Data.MissingSchemaAction.Add) + Me.InitVars() + Else + Me.ReadXml(reader) + Me.InitVars() + End If + End Sub + + + + Protected Overrides Function GetSchemaSerializable() As System.Xml.Schema.XmlSchema + Dim stream As New System.IO.MemoryStream() + Me.WriteXmlSchema(New System.Xml.XmlTextWriter(stream, Nothing)) + stream.Position = 0 + Return System.Xml.Schema.XmlSchema.Read(New System.Xml.XmlTextReader(stream), Nothing) + End Function + + + + Friend Sub InitVars() + Me.InitVars(True) + End Sub + + + + Friend Sub InitVars(ByVal initTable As Boolean) + Me.tableCars = (CType(MyBase.Tables("Cars"), CarsDataTable)) + If (initTable = True) Then + If (Me.tableCars IsNot Nothing) Then + Me.tableCars.InitVars() + End If + End If + Me.tableCarScheduling = (CType(MyBase.Tables("CarScheduling"), CarSchedulingDataTable)) + If (initTable = True) Then + If (Me.tableCarScheduling IsNot Nothing) Then + Me.tableCarScheduling.InitVars() + End If + End If + Me.relationCarsCarScheduling = Me.Relations("CarsCarScheduling") + End Sub + + + + Private Sub InitClass() + Me.DataSetName = "CarsDBDataSet" + Me.Prefix = "" + Me.Namespace = "http://tempuri.org/CarsDBDataSet.xsd" + Me.EnforceConstraints = True + Me.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + Me.tableCars = New CarsDataTable() + MyBase.Tables.Add(Me.tableCars) + Me.tableCarScheduling = New CarSchedulingDataTable() + MyBase.Tables.Add(Me.tableCarScheduling) + Me.relationCarsCarScheduling = New System.Data.DataRelation("CarsCarScheduling", New System.Data.DataColumn() { Me.tableCars.IDColumn}, New System.Data.DataColumn() { Me.tableCarScheduling.CarIdColumn}, False) + Me.Relations.Add(Me.relationCarsCarScheduling) + End Sub + + + + Private Function ShouldSerializeCars() As Boolean + Return False + End Function + + + + Private Function ShouldSerializeCarScheduling() As Boolean + Return False + End Function + + + + Private Sub SchemaChanged(ByVal sender As Object, ByVal e As System.ComponentModel.CollectionChangeEventArgs) + If (e.Action = System.ComponentModel.CollectionChangeAction.Remove) Then + Me.InitVars() + End If + End Sub + + + + Public Shared Function GetTypedDataSetSchema(ByVal xs As System.Xml.Schema.XmlSchemaSet) As System.Xml.Schema.XmlSchemaComplexType + Dim ds As New CarsDBDataSet() + Dim type As New System.Xml.Schema.XmlSchemaComplexType() + Dim sequence As New System.Xml.Schema.XmlSchemaSequence() + Dim any As New System.Xml.Schema.XmlSchemaAny() + any.Namespace = ds.Namespace + sequence.Items.Add(any) + type.Particle = sequence + Dim dsSchema As System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable() + If xs.Contains(dsSchema.TargetNamespace) Then + Dim s1 As New System.IO.MemoryStream() + Dim s2 As New System.IO.MemoryStream() + Try + Dim schema As System.Xml.Schema.XmlSchema = Nothing + dsSchema.Write(s1) + Dim schemas As System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator() + Do While schemas.MoveNext() + schema = (CType(schemas.Current, 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 (s1 IsNot Nothing) Then + s1.Close() + End If + If (s2 IsNot Nothing) Then + s2.Close() + End If + End Try + End If + xs.Add(dsSchema) + Return type + End Function + + + Public Delegate Sub CarsRowChangeEventHandler(ByVal sender As Object, ByVal e As CarsRowChangeEvent) + + + Public Delegate Sub CarSchedulingRowChangeEventHandler(ByVal sender As Object, ByVal e As CarSchedulingRowChangeEvent) + + ''' + '''Represents the strongly named DataTable class. + ''' + + + Partial Public Class CarsDataTable + Inherits System.Data.TypedTableBase(Of CarsRow) + + Private columnID As System.Data.DataColumn + + Private columnTrademark As System.Data.DataColumn + + Private columnModel As System.Data.DataColumn + + Private columnHP As System.Data.DataColumn + + Private columnLiter As System.Data.DataColumn + + Private columnCyl As System.Data.DataColumn + + Private columnTransmissSpeedCount As System.Data.DataColumn + + Private columnTransmissAutomatic As System.Data.DataColumn + + Private columnMPG_City As System.Data.DataColumn + + Private columnMPG_Highway As System.Data.DataColumn + + Private columnCategory As System.Data.DataColumn + + Private columnDescription As System.Data.DataColumn + + Private columnHyperlink As System.Data.DataColumn + + Private columnPicture As System.Data.DataColumn + + Private columnPrice As System.Data.DataColumn + + Private columnRtfContent As System.Data.DataColumn + + + + Public Sub New() + Me.TableName = "Cars" + Me.BeginInit() + Me.InitClass() + Me.EndInit() + End Sub + + + + Friend Sub New(ByVal table As System.Data.DataTable) + 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 System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + Me.InitVars() + End Sub + + + + Public ReadOnly Property IDColumn() As System.Data.DataColumn + Get + Return Me.columnID + End Get + End Property + + + + Public ReadOnly Property TrademarkColumn() As System.Data.DataColumn + Get + Return Me.columnTrademark + End Get + End Property + + + + Public ReadOnly Property ModelColumn() As System.Data.DataColumn + Get + Return Me.columnModel + End Get + End Property + + + + Public ReadOnly Property HPColumn() As System.Data.DataColumn + Get + Return Me.columnHP + End Get + End Property + + + + Public ReadOnly Property LiterColumn() As System.Data.DataColumn + Get + Return Me.columnLiter + End Get + End Property + + + + Public ReadOnly Property CylColumn() As System.Data.DataColumn + Get + Return Me.columnCyl + End Get + End Property + + + + Public ReadOnly Property TransmissSpeedCountColumn() As System.Data.DataColumn + Get + Return Me.columnTransmissSpeedCount + End Get + End Property + + + + Public ReadOnly Property TransmissAutomaticColumn() As System.Data.DataColumn + Get + Return Me.columnTransmissAutomatic + End Get + End Property + + + + Public ReadOnly Property MPG_CityColumn() As System.Data.DataColumn + Get + Return Me.columnMPG_City + End Get + End Property + + + + Public ReadOnly Property MPG_HighwayColumn() As System.Data.DataColumn + Get + Return Me.columnMPG_Highway + End Get + End Property + + + + Public ReadOnly Property CategoryColumn() As System.Data.DataColumn + Get + Return Me.columnCategory + End Get + End Property + + + + Public ReadOnly Property DescriptionColumn() As System.Data.DataColumn + Get + Return Me.columnDescription + End Get + End Property + + + + Public ReadOnly Property HyperlinkColumn() As System.Data.DataColumn + Get + Return Me.columnHyperlink + End Get + End Property + + + + Public ReadOnly Property PictureColumn() As System.Data.DataColumn + Get + Return Me.columnPicture + End Get + End Property + + + + Public ReadOnly Property PriceColumn() As System.Data.DataColumn + Get + Return Me.columnPrice + End Get + End Property + + + + Public ReadOnly Property RtfContentColumn() As System.Data.DataColumn + Get + Return Me.columnRtfContent + End Get + End Property + + + + + Public ReadOnly Overloads Property Count() As Integer + Get + Return Me.Rows.Count + End Get + End Property + + + + Default Public ReadOnly Property Item(ByVal index As Integer) As CarsRow + Get + Return (CType(Me.Rows(index), CarsRow)) + End Get + End Property + + + Public Event CarsRowChanging As CarsRowChangeEventHandler + + + Public Event CarsRowChanged As CarsRowChangeEventHandler + + + Public Event CarsRowDeleting As CarsRowChangeEventHandler + + + Public Event CarsRowDeleted As CarsRowChangeEventHandler + + + + Public Sub AddCarsRow(ByVal row As CarsRow) + Me.Rows.Add(row) + End Sub + + + + Public Function AddCarsRow(ByVal Trademark As String, ByVal Model As String, ByVal HP As Short, ByVal Liter As Double, ByVal Cyl As Byte, ByVal TransmissSpeedCount As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City As Byte, ByVal MPG_Highway As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price As Decimal, ByVal RtfContent As String) As CarsRow + Dim rowCarsRow As CarsRow = (CType(Me.NewRow(), CarsRow)) + Dim columnValuesArray() As Object = { Nothing, Trademark, Model, HP, Liter, Cyl, TransmissSpeedCount, TransmissAutomatic, MPG_City, MPG_Highway, Category, Description, Hyperlink, Picture, Price, RtfContent} + rowCarsRow.ItemArray = columnValuesArray + Me.Rows.Add(rowCarsRow) + Return rowCarsRow + End Function + + + + Public Function FindByID(ByVal ID As Integer) As CarsRow + Return (CType(Me.Rows.Find(New Object() { ID}), CarsRow)) + End Function + + + + Public Overrides Function Clone() As System.Data.DataTable + Dim cln As CarsDataTable = (CType(MyBase.Clone(), CarsDataTable)) + cln.InitVars() + Return cln + End Function + + + + Protected Overrides Function CreateInstance() As System.Data.DataTable + Return New CarsDataTable() + End Function + + + + Friend Sub InitVars() + Me.columnID = MyBase.Columns("ID") + Me.columnTrademark = MyBase.Columns("Trademark") + Me.columnModel = MyBase.Columns("Model") + Me.columnHP = MyBase.Columns("HP") + Me.columnLiter = MyBase.Columns("Liter") + Me.columnCyl = MyBase.Columns("Cyl") + Me.columnTransmissSpeedCount = MyBase.Columns("TransmissSpeedCount") + Me.columnTransmissAutomatic = MyBase.Columns("TransmissAutomatic") + Me.columnMPG_City = MyBase.Columns("MPG_City") + Me.columnMPG_Highway = MyBase.Columns("MPG_Highway") + Me.columnCategory = MyBase.Columns("Category") + Me.columnDescription = MyBase.Columns("Description") + Me.columnHyperlink = MyBase.Columns("Hyperlink") + Me.columnPicture = MyBase.Columns("Picture") + Me.columnPrice = MyBase.Columns("Price") + Me.columnRtfContent = MyBase.Columns("RtfContent") + End Sub + + + + Private Sub InitClass() + Me.columnID = New System.Data.DataColumn("ID", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnID) + Me.columnTrademark = New System.Data.DataColumn("Trademark", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnTrademark) + Me.columnModel = New System.Data.DataColumn("Model", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnModel) + Me.columnHP = New System.Data.DataColumn("HP", GetType(Short), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnHP) + Me.columnLiter = New System.Data.DataColumn("Liter", GetType(Double), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnLiter) + Me.columnCyl = New System.Data.DataColumn("Cyl", GetType(Byte), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnCyl) + Me.columnTransmissSpeedCount = New System.Data.DataColumn("TransmissSpeedCount", GetType(Byte), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnTransmissSpeedCount) + Me.columnTransmissAutomatic = New System.Data.DataColumn("TransmissAutomatic", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnTransmissAutomatic) + Me.columnMPG_City = New System.Data.DataColumn("MPG_City", GetType(Byte), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnMPG_City) + Me.columnMPG_Highway = New System.Data.DataColumn("MPG_Highway", GetType(Byte), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnMPG_Highway) + Me.columnCategory = New System.Data.DataColumn("Category", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnCategory) + Me.columnDescription = New System.Data.DataColumn("Description", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnDescription) + Me.columnHyperlink = New System.Data.DataColumn("Hyperlink", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnHyperlink) + Me.columnPicture = New System.Data.DataColumn("Picture", GetType(Byte()), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnPicture) + Me.columnPrice = New System.Data.DataColumn("Price", GetType(Decimal), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnPrice) + Me.columnRtfContent = New System.Data.DataColumn("RtfContent", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnRtfContent) + Me.Constraints.Add(New System.Data.UniqueConstraint("Constraint1", New System.Data.DataColumn() { Me.columnID}, True)) + Me.columnID.AutoIncrement = True + Me.columnID.AllowDBNull = False + Me.columnID.Unique = True + Me.columnTrademark.MaxLength = 50 + Me.columnModel.MaxLength = 50 + Me.columnTransmissAutomatic.MaxLength = 3 + Me.columnCategory.MaxLength = 7 + Me.columnDescription.MaxLength = 536870910 + Me.columnHyperlink.MaxLength = 50 + Me.columnRtfContent.MaxLength = 536870910 + End Sub + + + + Public Function NewCarsRow() As CarsRow + Return (CType(Me.NewRow(), CarsRow)) + End Function + + + + Protected Overrides Function NewRowFromBuilder(ByVal builder As System.Data.DataRowBuilder) As System.Data.DataRow + Return New CarsRow(builder) + End Function + + + + Protected Overrides Function GetRowType() As System.Type + Return GetType(CarsRow) + End Function + + + + Protected Overrides Sub OnRowChanged(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowChanged(e) + RaiseEvent CarsRowChanged(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowChanging(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowChanging(e) + RaiseEvent CarsRowChanging(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowDeleted(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowDeleted(e) + RaiseEvent CarsRowDeleted(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowDeleting(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowDeleting(e) + RaiseEvent CarsRowDeleting(Me, New CarsRowChangeEvent((CType(e.Row, CarsRow)), e.Action)) + End Sub + + + + Public Sub RemoveCarsRow(ByVal row As CarsRow) + Me.Rows.Remove(row) + End Sub + + + + Public Shared Function GetTypedTableSchema(ByVal xs As System.Xml.Schema.XmlSchemaSet) As System.Xml.Schema.XmlSchemaComplexType + Dim type As New System.Xml.Schema.XmlSchemaComplexType() + Dim sequence As New System.Xml.Schema.XmlSchemaSequence() + Dim ds As New CarsDBDataSet() + Dim any1 As New System.Xml.Schema.XmlSchemaAny() + any1.Namespace = "http://www.w3.org/2001/XMLSchema" + any1.MinOccurs = New Decimal(0) + any1.MaxOccurs = Decimal.MaxValue + any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax + sequence.Items.Add(any1) + Dim any2 As New System.Xml.Schema.XmlSchemaAny() + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" + any2.MinOccurs = New Decimal(1) + any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax + sequence.Items.Add(any2) + Dim attribute1 As New System.Xml.Schema.XmlSchemaAttribute() + attribute1.Name = "namespace" + attribute1.FixedValue = ds.Namespace + type.Attributes.Add(attribute1) + Dim attribute2 As New System.Xml.Schema.XmlSchemaAttribute() + attribute2.Name = "tableTypeName" + attribute2.FixedValue = "CarsDataTable" + type.Attributes.Add(attribute2) + type.Particle = sequence + Dim dsSchema As System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable() + If xs.Contains(dsSchema.TargetNamespace) Then + Dim s1 As New System.IO.MemoryStream() + Dim s2 As New System.IO.MemoryStream() + Try + Dim schema As System.Xml.Schema.XmlSchema = Nothing + dsSchema.Write(s1) + Dim schemas As System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator() + Do While schemas.MoveNext() + schema = (CType(schemas.Current, 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 (s1 IsNot Nothing) Then + s1.Close() + End If + If (s2 IsNot 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 CarSchedulingDataTable + Inherits System.Data.TypedTableBase(Of CarSchedulingRow) + + Private columnID As System.Data.DataColumn + + Private columnCarId As System.Data.DataColumn + + Private columnUserId As System.Data.DataColumn + + Private columnStatus As System.Data.DataColumn + + Private columnSubject As System.Data.DataColumn + + Private columnDescription As System.Data.DataColumn + + Private columnLabel As System.Data.DataColumn + + Private columnStartTime As System.Data.DataColumn + + Private columnEndTime As System.Data.DataColumn + + Private columnLocation As System.Data.DataColumn + + Private columnAllDay As System.Data.DataColumn + + Private columnEventType As System.Data.DataColumn + + Private columnRecurrenceInfo As System.Data.DataColumn + + Private columnReminderInfo As System.Data.DataColumn + + Private columnPrice As System.Data.DataColumn + + Private columnContactInfo As System.Data.DataColumn + + + + Public Sub New() + Me.TableName = "CarScheduling" + Me.BeginInit() + Me.InitClass() + Me.EndInit() + End Sub + + + + Friend Sub New(ByVal table As System.Data.DataTable) + 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 System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) + MyBase.New(info, context) + Me.InitVars() + End Sub + + + + Public ReadOnly Property IDColumn() As System.Data.DataColumn + Get + Return Me.columnID + End Get + End Property + + + + Public ReadOnly Property CarIdColumn() As System.Data.DataColumn + Get + Return Me.columnCarId + End Get + End Property + + + + Public ReadOnly Property UserIdColumn() As System.Data.DataColumn + Get + Return Me.columnUserId + End Get + End Property + + + + Public ReadOnly Property StatusColumn() As System.Data.DataColumn + Get + Return Me.columnStatus + End Get + End Property + + + + Public ReadOnly Property SubjectColumn() As System.Data.DataColumn + Get + Return Me.columnSubject + End Get + End Property + + + + Public ReadOnly Property DescriptionColumn() As System.Data.DataColumn + Get + Return Me.columnDescription + End Get + End Property + + + + Public ReadOnly Property LabelColumn() As System.Data.DataColumn + Get + Return Me.columnLabel + End Get + End Property + + + + Public ReadOnly Property StartTimeColumn() As System.Data.DataColumn + Get + Return Me.columnStartTime + End Get + End Property + + + + Public ReadOnly Property EndTimeColumn() As System.Data.DataColumn + Get + Return Me.columnEndTime + End Get + End Property + + + + Public ReadOnly Property LocationColumn() As System.Data.DataColumn + Get + Return Me.columnLocation + End Get + End Property + + + + Public ReadOnly Property AllDayColumn() As System.Data.DataColumn + Get + Return Me.columnAllDay + End Get + End Property + + + + Public ReadOnly Property EventTypeColumn() As System.Data.DataColumn + Get + Return Me.columnEventType + End Get + End Property + + + + Public ReadOnly Property RecurrenceInfoColumn() As System.Data.DataColumn + Get + Return Me.columnRecurrenceInfo + End Get + End Property + + + + Public ReadOnly Property ReminderInfoColumn() As System.Data.DataColumn + Get + Return Me.columnReminderInfo + End Get + End Property + + + + Public ReadOnly Property PriceColumn() As System.Data.DataColumn + Get + Return Me.columnPrice + End Get + End Property + + + + Public ReadOnly Property ContactInfoColumn() As System.Data.DataColumn + Get + Return Me.columnContactInfo + End Get + End Property + + + + + Public ReadOnly Overloads Property Count() As Integer + Get + Return Me.Rows.Count + End Get + End Property + + + + Default Public ReadOnly Property Item(ByVal index As Integer) As CarSchedulingRow + Get + Return (CType(Me.Rows(index), CarSchedulingRow)) + End Get + End Property + + + Public Event CarSchedulingRowChanging As CarSchedulingRowChangeEventHandler + + + Public Event CarSchedulingRowChanged As CarSchedulingRowChangeEventHandler + + + Public Event CarSchedulingRowDeleting As CarSchedulingRowChangeEventHandler + + + Public Event CarSchedulingRowDeleted As CarSchedulingRowChangeEventHandler + + + + Public Sub AddCarSchedulingRow(ByVal row As CarSchedulingRow) + Me.Rows.Add(row) + End Sub + + + + Public Function AddCarSchedulingRow(ByVal parentCarsRowByCarsCarScheduling As CarsRow, ByVal UserId As Integer, ByVal Status As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label As Integer, ByVal StartTime As DateTime, ByVal EndTime As DateTime, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price As Decimal, ByVal ContactInfo As String) As CarSchedulingRow + Dim rowCarSchedulingRow As CarSchedulingRow = (CType(Me.NewRow(), CarSchedulingRow)) + Dim columnValuesArray() As Object = { Nothing, Nothing, UserId, Status, Subject, Description, Label, StartTime, EndTime, Location, AllDay, EventType, RecurrenceInfo, ReminderInfo, Price, ContactInfo} + If (parentCarsRowByCarsCarScheduling IsNot Nothing) Then + columnValuesArray(1) = parentCarsRowByCarsCarScheduling(0) + End If + rowCarSchedulingRow.ItemArray = columnValuesArray + Me.Rows.Add(rowCarSchedulingRow) + Return rowCarSchedulingRow + End Function + + + + Public Function FindByID(ByVal ID As Integer) As CarSchedulingRow + Return (CType(Me.Rows.Find(New Object() { ID}), CarSchedulingRow)) + End Function + + + + Public Overrides Function Clone() As System.Data.DataTable + Dim cln As CarSchedulingDataTable = (CType(MyBase.Clone(), CarSchedulingDataTable)) + cln.InitVars() + Return cln + End Function + + + + Protected Overrides Function CreateInstance() As System.Data.DataTable + Return New CarSchedulingDataTable() + End Function + + + + Friend Sub InitVars() + Me.columnID = MyBase.Columns("ID") + Me.columnCarId = MyBase.Columns("CarId") + Me.columnUserId = MyBase.Columns("UserId") + Me.columnStatus = MyBase.Columns("Status") + Me.columnSubject = MyBase.Columns("Subject") + Me.columnDescription = MyBase.Columns("Description") + Me.columnLabel = MyBase.Columns("Label") + Me.columnStartTime = MyBase.Columns("StartTime") + Me.columnEndTime = MyBase.Columns("EndTime") + Me.columnLocation = MyBase.Columns("Location") + Me.columnAllDay = MyBase.Columns("AllDay") + Me.columnEventType = MyBase.Columns("EventType") + Me.columnRecurrenceInfo = MyBase.Columns("RecurrenceInfo") + Me.columnReminderInfo = MyBase.Columns("ReminderInfo") + Me.columnPrice = MyBase.Columns("Price") + Me.columnContactInfo = MyBase.Columns("ContactInfo") + End Sub + + + + Private Sub InitClass() + Me.columnID = New System.Data.DataColumn("ID", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnID) + Me.columnCarId = New System.Data.DataColumn("CarId", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnCarId) + Me.columnUserId = New System.Data.DataColumn("UserId", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnUserId) + Me.columnStatus = New System.Data.DataColumn("Status", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnStatus) + Me.columnSubject = New System.Data.DataColumn("Subject", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnSubject) + Me.columnDescription = New System.Data.DataColumn("Description", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnDescription) + Me.columnLabel = New System.Data.DataColumn("Label", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnLabel) + Me.columnStartTime = New System.Data.DataColumn("StartTime", GetType(DateTime), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnStartTime) + Me.columnEndTime = New System.Data.DataColumn("EndTime", GetType(DateTime), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnEndTime) + Me.columnLocation = New System.Data.DataColumn("Location", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnLocation) + Me.columnAllDay = New System.Data.DataColumn("AllDay", GetType(Boolean), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnAllDay) + Me.columnEventType = New System.Data.DataColumn("EventType", GetType(Integer), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnEventType) + Me.columnRecurrenceInfo = New System.Data.DataColumn("RecurrenceInfo", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnRecurrenceInfo) + Me.columnReminderInfo = New System.Data.DataColumn("ReminderInfo", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnReminderInfo) + Me.columnPrice = New System.Data.DataColumn("Price", GetType(Decimal), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnPrice) + Me.columnContactInfo = New System.Data.DataColumn("ContactInfo", GetType(String), Nothing, System.Data.MappingType.Element) + MyBase.Columns.Add(Me.columnContactInfo) + Me.Constraints.Add(New System.Data.UniqueConstraint("Constraint1", New System.Data.DataColumn() { Me.columnID}, True)) + Me.columnID.AutoIncrement = True + Me.columnID.AllowDBNull = False + Me.columnID.Unique = True + Me.columnSubject.MaxLength = 50 + Me.columnDescription.MaxLength = 536870910 + Me.columnLocation.MaxLength = 50 + Me.columnRecurrenceInfo.MaxLength = 536870910 + Me.columnReminderInfo.MaxLength = 536870910 + Me.columnContactInfo.MaxLength = 536870910 + End Sub + + + + Public Function NewCarSchedulingRow() As CarSchedulingRow + Return (CType(Me.NewRow(), CarSchedulingRow)) + End Function + + + + Protected Overrides Function NewRowFromBuilder(ByVal builder As System.Data.DataRowBuilder) As System.Data.DataRow + Return New CarSchedulingRow(builder) + End Function + + + + Protected Overrides Function GetRowType() As System.Type + Return GetType(CarSchedulingRow) + End Function + + + + Protected Overrides Sub OnRowChanged(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowChanged(e) + RaiseEvent CarSchedulingRowChanged(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowChanging(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowChanging(e) + RaiseEvent CarSchedulingRowChanging(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowDeleted(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowDeleted(e) + RaiseEvent CarSchedulingRowDeleted(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) + End Sub + + + + Protected Overrides Sub OnRowDeleting(ByVal e As System.Data.DataRowChangeEventArgs) + MyBase.OnRowDeleting(e) + RaiseEvent CarSchedulingRowDeleting(Me, New CarSchedulingRowChangeEvent((CType(e.Row, CarSchedulingRow)), e.Action)) + End Sub + + + + Public Sub RemoveCarSchedulingRow(ByVal row As CarSchedulingRow) + Me.Rows.Remove(row) + End Sub + + + + Public Shared Function GetTypedTableSchema(ByVal xs As System.Xml.Schema.XmlSchemaSet) As System.Xml.Schema.XmlSchemaComplexType + Dim type As New System.Xml.Schema.XmlSchemaComplexType() + Dim sequence As New System.Xml.Schema.XmlSchemaSequence() + Dim ds As New CarsDBDataSet() + Dim any1 As New System.Xml.Schema.XmlSchemaAny() + any1.Namespace = "http://www.w3.org/2001/XMLSchema" + any1.MinOccurs = New Decimal(0) + any1.MaxOccurs = Decimal.MaxValue + any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax + sequence.Items.Add(any1) + Dim any2 As New System.Xml.Schema.XmlSchemaAny() + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" + any2.MinOccurs = New Decimal(1) + any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax + sequence.Items.Add(any2) + Dim attribute1 As New System.Xml.Schema.XmlSchemaAttribute() + attribute1.Name = "namespace" + attribute1.FixedValue = ds.Namespace + type.Attributes.Add(attribute1) + Dim attribute2 As New System.Xml.Schema.XmlSchemaAttribute() + attribute2.Name = "tableTypeName" + attribute2.FixedValue = "CarSchedulingDataTable" + type.Attributes.Add(attribute2) + type.Particle = sequence + Dim dsSchema As System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable() + If xs.Contains(dsSchema.TargetNamespace) Then + Dim s1 As New System.IO.MemoryStream() + Dim s2 As New System.IO.MemoryStream() + Try + Dim schema As System.Xml.Schema.XmlSchema = Nothing + dsSchema.Write(s1) + Dim schemas As System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator() + Do While schemas.MoveNext() + schema = (CType(schemas.Current, 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 (s1 IsNot Nothing) Then + s1.Close() + End If + If (s2 IsNot 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 CarsRow + Inherits System.Data.DataRow + + Private tableCars As CarsDataTable + + + + Friend Sub New(ByVal rb As System.Data.DataRowBuilder) + MyBase.New(rb) + Me.tableCars = (CType(Me.Table, CarsDataTable)) + End Sub + + + + Public Property ID() As Integer + Get + Return (CInt(Me(Me.tableCars.IDColumn))) + End Get + Set(ByVal value As Integer) + Me(Me.tableCars.IDColumn) = value + End Set + End Property + + + + Public Property Trademark() As String + Get + Try + Return (CStr(Me(Me.tableCars.TrademarkColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Trademark' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.TrademarkColumn) = value + End Set + End Property + + + + Public Property Model() As String + Get + Try + Return (CStr(Me(Me.tableCars.ModelColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Model' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.ModelColumn) = value + End Set + End Property + + + + Public Property HP() As Short + Get + Try + Return (CShort(Me(Me.tableCars.HPColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'HP' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Short) + Me(Me.tableCars.HPColumn) = value + End Set + End Property + + + + Public Property Liter() As Double + Get + Try + Return (CDbl(Me(Me.tableCars.LiterColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Liter' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Double) + Me(Me.tableCars.LiterColumn) = value + End Set + End Property + + + + Public Property Cyl() As Byte + Get + Try + Return (CByte(Me(Me.tableCars.CylColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Cyl' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Byte) + Me(Me.tableCars.CylColumn) = value + End Set + End Property + + + + Public Property TransmissSpeedCount() As Byte + Get + Try + Return (CByte(Me(Me.tableCars.TransmissSpeedCountColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'TransmissSpeedCount' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Byte) + Me(Me.tableCars.TransmissSpeedCountColumn) = value + End Set + End Property + + + + Public Property TransmissAutomatic() As String + Get + Try + Return (CStr(Me(Me.tableCars.TransmissAutomaticColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'TransmissAutomatic' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.TransmissAutomaticColumn) = value + End Set + End Property + + + + Public Property MPG_City() As Byte + Get + Try + Return (CByte(Me(Me.tableCars.MPG_CityColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'MPG_City' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Byte) + Me(Me.tableCars.MPG_CityColumn) = value + End Set + End Property + + + + Public Property MPG_Highway() As Byte + Get + Try + Return (CByte(Me(Me.tableCars.MPG_HighwayColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'MPG_Highway' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Byte) + Me(Me.tableCars.MPG_HighwayColumn) = value + End Set + End Property + + + + Public Property Category() As String + Get + Try + Return (CStr(Me(Me.tableCars.CategoryColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Category' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.CategoryColumn) = value + End Set + End Property + + + + Public Property Description() As String + Get + Try + Return (CStr(Me(Me.tableCars.DescriptionColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Description' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.DescriptionColumn) = value + End Set + End Property + + + + Public Property Hyperlink() As String + Get + Try + Return (CStr(Me(Me.tableCars.HyperlinkColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Hyperlink' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.HyperlinkColumn) = value + End Set + End Property + + + + Public Property Picture() As Byte() + Get + Try + Return (CType(Me(Me.tableCars.PictureColumn), Byte())) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Picture' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Byte()) + Me(Me.tableCars.PictureColumn) = value + End Set + End Property + + + + Public Property Price() As Decimal + Get + Try + Return (CDec(Me(Me.tableCars.PriceColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Price' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As Decimal) + Me(Me.tableCars.PriceColumn) = value + End Set + End Property + + + + Public Property RtfContent() As String + Get + Try + Return (CStr(Me(Me.tableCars.RtfContentColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'RtfContent' in table 'Cars' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCars.RtfContentColumn) = value + End Set + End Property + + + + Public Function IsTrademarkNull() As Boolean + Return Me.IsNull(Me.tableCars.TrademarkColumn) + End Function + + + + Public Sub SetTrademarkNull() + Me(Me.tableCars.TrademarkColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsModelNull() As Boolean + Return Me.IsNull(Me.tableCars.ModelColumn) + End Function + + + + Public Sub SetModelNull() + Me(Me.tableCars.ModelColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsHPNull() As Boolean + Return Me.IsNull(Me.tableCars.HPColumn) + End Function + + + + Public Sub SetHPNull() + Me(Me.tableCars.HPColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsLiterNull() As Boolean + Return Me.IsNull(Me.tableCars.LiterColumn) + End Function + + + + Public Sub SetLiterNull() + Me(Me.tableCars.LiterColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsCylNull() As Boolean + Return Me.IsNull(Me.tableCars.CylColumn) + End Function + + + + Public Sub SetCylNull() + Me(Me.tableCars.CylColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsTransmissSpeedCountNull() As Boolean + Return Me.IsNull(Me.tableCars.TransmissSpeedCountColumn) + End Function + + + + Public Sub SetTransmissSpeedCountNull() + Me(Me.tableCars.TransmissSpeedCountColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsTransmissAutomaticNull() As Boolean + Return Me.IsNull(Me.tableCars.TransmissAutomaticColumn) + End Function + + + + Public Sub SetTransmissAutomaticNull() + Me(Me.tableCars.TransmissAutomaticColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsMPG_CityNull() As Boolean + Return Me.IsNull(Me.tableCars.MPG_CityColumn) + End Function + + + + Public Sub SetMPG_CityNull() + Me(Me.tableCars.MPG_CityColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsMPG_HighwayNull() As Boolean + Return Me.IsNull(Me.tableCars.MPG_HighwayColumn) + End Function + + + + Public Sub SetMPG_HighwayNull() + Me(Me.tableCars.MPG_HighwayColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsCategoryNull() As Boolean + Return Me.IsNull(Me.tableCars.CategoryColumn) + End Function + + + + Public Sub SetCategoryNull() + Me(Me.tableCars.CategoryColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsDescriptionNull() As Boolean + Return Me.IsNull(Me.tableCars.DescriptionColumn) + End Function + + + + Public Sub SetDescriptionNull() + Me(Me.tableCars.DescriptionColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsHyperlinkNull() As Boolean + Return Me.IsNull(Me.tableCars.HyperlinkColumn) + End Function + + + + Public Sub SetHyperlinkNull() + Me(Me.tableCars.HyperlinkColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsPictureNull() As Boolean + Return Me.IsNull(Me.tableCars.PictureColumn) + End Function + + + + Public Sub SetPictureNull() + Me(Me.tableCars.PictureColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsPriceNull() As Boolean + Return Me.IsNull(Me.tableCars.PriceColumn) + End Function + + + + Public Sub SetPriceNull() + Me(Me.tableCars.PriceColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsRtfContentNull() As Boolean + Return Me.IsNull(Me.tableCars.RtfContentColumn) + End Function + + + + Public Sub SetRtfContentNull() + Me(Me.tableCars.RtfContentColumn) = System.Convert.DBNull + End Sub + + + + Public Function GetCarSchedulingRows() As CarSchedulingRow() + If (Me.Table.ChildRelations("CarsCarScheduling") Is Nothing) Then + Return New CarSchedulingRow(){} + Else + Return (CType(MyBase.GetChildRows(Me.Table.ChildRelations("CarsCarScheduling")), CarSchedulingRow())) + End If + End Function + End Class + + ''' + '''Represents strongly named DataRow class. + ''' + Partial Public Class CarSchedulingRow + Inherits System.Data.DataRow + + Private tableCarScheduling As CarSchedulingDataTable + + + + Friend Sub New(ByVal rb As System.Data.DataRowBuilder) + MyBase.New(rb) + Me.tableCarScheduling = (CType(Me.Table, CarSchedulingDataTable)) + End Sub + + + + Public Property ID() As Integer + Get + Return (CInt(Me(Me.tableCarScheduling.IDColumn))) + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.IDColumn) = value + End Set + End Property + + + + Public Property CarId() As Integer + Get + Try + Return (CInt(Me(Me.tableCarScheduling.CarIdColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'CarId' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.CarIdColumn) = value + End Set + End Property + + + + Public Property UserId() As Integer + Get + Try + Return (CInt(Me(Me.tableCarScheduling.UserIdColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'UserId' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.UserIdColumn) = value + End Set + End Property + + + + Public Property Status() As Integer + Get + Try + Return (CInt(Me(Me.tableCarScheduling.StatusColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Status' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.StatusColumn) = value + End Set + End Property + + + + Public Property Subject() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.SubjectColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Subject' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.SubjectColumn) = value + End Set + End Property + + + + Public Property Description() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.DescriptionColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Description' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.DescriptionColumn) = value + End Set + End Property + + + + Public Property Label() As Integer + Get + Try + Return (CInt(Me(Me.tableCarScheduling.LabelColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Label' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.LabelColumn) = value + End Set + End Property + + + + Public Property StartTime() As DateTime + Get + Try + Return (CDate(Me(Me.tableCarScheduling.StartTimeColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'StartTime' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As DateTime) + Me(Me.tableCarScheduling.StartTimeColumn) = value + End Set + End Property + + + + Public Property EndTime() As DateTime + Get + Try + Return (CDate(Me(Me.tableCarScheduling.EndTimeColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'EndTime' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As DateTime) + Me(Me.tableCarScheduling.EndTimeColumn) = value + End Set + End Property + + + + Public Property Location() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.LocationColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Location' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.LocationColumn) = value + End Set + End Property + + + + Public Property AllDay() As Boolean + Get + Try + Return (CBool(Me(Me.tableCarScheduling.AllDayColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'AllDay' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Boolean) + Me(Me.tableCarScheduling.AllDayColumn) = value + End Set + End Property + + + + Public Property EventType() As Integer + Get + Try + Return (CInt(Me(Me.tableCarScheduling.EventTypeColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'EventType' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Integer) + Me(Me.tableCarScheduling.EventTypeColumn) = value + End Set + End Property + + + + Public Property RecurrenceInfo() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.RecurrenceInfoColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'RecurrenceInfo' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.RecurrenceInfoColumn) = value + End Set + End Property + + + + Public Property ReminderInfo() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.ReminderInfoColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'ReminderInfo' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.ReminderInfoColumn) = value + End Set + End Property + + + + Public Property Price() As Decimal + Get + Try + Return (CDec(Me(Me.tableCarScheduling.PriceColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'Price' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As Decimal) + Me(Me.tableCarScheduling.PriceColumn) = value + End Set + End Property + + + + Public Property ContactInfo() As String + Get + Try + Return (CStr(Me(Me.tableCarScheduling.ContactInfoColumn))) + Catch e As System.InvalidCastException + Throw New System.Data.StrongTypingException("The value for column 'ContactInfo' in table 'CarScheduling' is DBNull.", e) + End Try + End Get + Set(ByVal value As String) + Me(Me.tableCarScheduling.ContactInfoColumn) = value + End Set + End Property + + + + Public Property CarsRow() As CarsRow + Get + Return (CType(Me.GetParentRow(Me.Table.ParentRelations("CarsCarScheduling")), CarsRow)) + End Get + Set(ByVal value As CarsRow) + Me.SetParentRow(value, Me.Table.ParentRelations("CarsCarScheduling")) + End Set + End Property + + + + Public Function IsCarIdNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.CarIdColumn) + End Function + + + + Public Sub SetCarIdNull() + Me(Me.tableCarScheduling.CarIdColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsUserIdNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.UserIdColumn) + End Function + + + + Public Sub SetUserIdNull() + Me(Me.tableCarScheduling.UserIdColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsStatusNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.StatusColumn) + End Function + + + + Public Sub SetStatusNull() + Me(Me.tableCarScheduling.StatusColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsSubjectNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.SubjectColumn) + End Function + + + + Public Sub SetSubjectNull() + Me(Me.tableCarScheduling.SubjectColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsDescriptionNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.DescriptionColumn) + End Function + + + + Public Sub SetDescriptionNull() + Me(Me.tableCarScheduling.DescriptionColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsLabelNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.LabelColumn) + End Function + + + + Public Sub SetLabelNull() + Me(Me.tableCarScheduling.LabelColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsStartTimeNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.StartTimeColumn) + End Function + + + + Public Sub SetStartTimeNull() + Me(Me.tableCarScheduling.StartTimeColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsEndTimeNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.EndTimeColumn) + End Function + + + + Public Sub SetEndTimeNull() + Me(Me.tableCarScheduling.EndTimeColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsLocationNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.LocationColumn) + End Function + + + + Public Sub SetLocationNull() + Me(Me.tableCarScheduling.LocationColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsAllDayNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.AllDayColumn) + End Function + + + + Public Sub SetAllDayNull() + Me(Me.tableCarScheduling.AllDayColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsEventTypeNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.EventTypeColumn) + End Function + + + + Public Sub SetEventTypeNull() + Me(Me.tableCarScheduling.EventTypeColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsRecurrenceInfoNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.RecurrenceInfoColumn) + End Function + + + + Public Sub SetRecurrenceInfoNull() + Me(Me.tableCarScheduling.RecurrenceInfoColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsReminderInfoNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.ReminderInfoColumn) + End Function + + + + Public Sub SetReminderInfoNull() + Me(Me.tableCarScheduling.ReminderInfoColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsPriceNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.PriceColumn) + End Function + + + + Public Sub SetPriceNull() + Me(Me.tableCarScheduling.PriceColumn) = System.Convert.DBNull + End Sub + + + + Public Function IsContactInfoNull() As Boolean + Return Me.IsNull(Me.tableCarScheduling.ContactInfoColumn) + End Function + + + + Public Sub SetContactInfoNull() + Me(Me.tableCarScheduling.ContactInfoColumn) = System.Convert.DBNull + End Sub + End Class + + ''' + '''Row event argument class + ''' + + Public Class CarsRowChangeEvent + Inherits System.EventArgs + + Private eventRow As CarsRow + + Private eventAction As System.Data.DataRowAction + + + + Public Sub New(ByVal row As CarsRow, ByVal action As System.Data.DataRowAction) + Me.eventRow = row + Me.eventAction = action + End Sub + + + + Public ReadOnly Property Row() As CarsRow + Get + Return Me.eventRow + End Get + End Property + + + + Public ReadOnly Property Action() As System.Data.DataRowAction + Get + Return Me.eventAction + End Get + End Property + End Class + + ''' + '''Row event argument class + ''' + + Public Class CarSchedulingRowChangeEvent + Inherits System.EventArgs + + Private eventRow As CarSchedulingRow + + Private eventAction As System.Data.DataRowAction + + + + Public Sub New(ByVal row As CarSchedulingRow, ByVal action As System.Data.DataRowAction) + Me.eventRow = row + Me.eventAction = action + End Sub + + + + Public ReadOnly Property Row() As CarSchedulingRow + Get + Return Me.eventRow + End Get + End Property + + + + Public ReadOnly Property Action() As System.Data.DataRowAction + Get + Return Me.eventAction + End Get + End Property + End Class + End Class End Namespace Namespace SimpleCustomFields.CarsDBDataSetTableAdapters - ''' - '''Represents the connection and commands used to retrieve and save data. - ''' - - Partial Public Class CarsTableAdapter - Inherits System.ComponentModel.Component - - Private _adapter As Global.System.Data.OleDb.OleDbDataAdapter - - Private _connection As Global.System.Data.OleDb.OleDbConnection - - Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand - - Private _clearBeforeFill As Boolean - - - Public Sub New() - Me.ClearBeforeFill = True - End Sub - - - Private ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter - Get - If (Me._adapter Is Nothing) Then - Me.InitAdapter() - End If - Return Me._adapter - End Get - End Property - - - Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection - Get - If (Me._connection Is Nothing) Then - Me.InitConnection() - End If - Return Me._connection - End Get - Set(ByVal value As System.Data.OleDb.OleDbConnection) - Me._connection = value - If (Me.Adapter.InsertCommand IsNot Nothing) Then - Me.Adapter.InsertCommand.Connection = value - End If - If (Me.Adapter.DeleteCommand IsNot Nothing) Then - Me.Adapter.DeleteCommand.Connection = value - End If - If (Me.Adapter.UpdateCommand IsNot Nothing) Then - Me.Adapter.UpdateCommand.Connection = value - End If - Dim i As Integer = 0 - Do While (i < Me.CommandCollection.Length) - If (Me.CommandCollection(i) IsNot Nothing) Then - CType(Me.CommandCollection(i), Global.System.Data.OleDb.OleDbCommand).Connection = value - End If - i = (i + 1) - Loop - End Set - End Property - - - Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() - Get - If (Me._commandCollection Is Nothing) Then - Me.InitCommandCollection() - End If - Return Me._commandCollection - End Get - End Property - - - Public Property ClearBeforeFill() As Boolean - Get - Return Me._clearBeforeFill - End Get - Set(ByVal value As Boolean) - Me._clearBeforeFill = value - End Set - End Property - - - Private Sub InitAdapter() - Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() - Dim tableMapping As New Global.System.Data.Common.DataTableMapping() - tableMapping.SourceTable = "Table" - tableMapping.DataSetTable = "Cars" - tableMapping.ColumnMappings.Add("ID", "ID") - tableMapping.ColumnMappings.Add("Trademark", "Trademark") - tableMapping.ColumnMappings.Add("Model", "Model") - tableMapping.ColumnMappings.Add("HP", "HP") - tableMapping.ColumnMappings.Add("Liter", "Liter") - tableMapping.ColumnMappings.Add("Cyl", "Cyl") - tableMapping.ColumnMappings.Add("TransmissSpeedCount", "TransmissSpeedCount") - tableMapping.ColumnMappings.Add("TransmissAutomatic", "TransmissAutomatic") - tableMapping.ColumnMappings.Add("MPG_City", "MPG_City") - tableMapping.ColumnMappings.Add("MPG_Highway", "MPG_Highway") - tableMapping.ColumnMappings.Add("Category", "Category") - tableMapping.ColumnMappings.Add("Description", "Description") - tableMapping.ColumnMappings.Add("Hyperlink", "Hyperlink") - tableMapping.ColumnMappings.Add("Picture", "Picture") - tableMapping.ColumnMappings.Add("Price", "Price") - tableMapping.ColumnMappings.Add("RtfContent", "RtfContent") - Me._adapter.TableMappings.Add(tableMapping) - Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.DeleteCommand.Connection = Me.Connection - Me._adapter.DeleteCommand.CommandText = "DELETE FROM `Cars` WHERE ((`ID` = ?) AND ((? = 1 AND `Trademark` IS NULL) OR (`Trademark` = ?)) AND ((? = 1 AND `Model` IS NULL) OR (`Model` = ?)) AND ((? = 1 AND `HP` IS NULL) OR (`HP` = ?)) AND ((? = 1 AND `Liter` IS NULL) OR (`Liter` = ?)) AND ((? = 1 AND `Cyl` IS NULL) OR (`Cyl` = ?)) AND ((? = 1 AND `TransmissSpeedCount` IS NULL) OR (`TransmissSpeedCount` = ?)) AND ((? = 1 AND `TransmissAutomatic` IS NULL) OR (`TransmissAutomatic` = ?)) AND ((? = 1 AND `MPG_City` IS NULL) OR (`MPG_City` = ?)) AND ((? = 1 AND `MPG_Highway` IS NULL) OR (`MPG_Highway` = ?)) AND ((? = 1 AND `Category` IS NULL) OR (`Category` = ?)) AND ((? = 1 AND `Hyperlink` IS NULL) OR (`Hyperlink` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" - Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Trademark", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Trademark", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Model", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Model", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_HP", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_HP", Global.System.Data.OleDb.OleDbType.SmallInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Liter", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Liter", Global.System.Data.OleDb.OleDbType.Double, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cyl", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cyl", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_TransmissAutomatic", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_TransmissAutomatic", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MPG_City", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MPG_City", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MPG_Highway", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MPG_Highway", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Category", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Category", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Hyperlink", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Hyperlink", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.InsertCommand.Connection = Me.Connection - Me._adapter.InsertCommand.CommandText = "INSERT INTO `Cars` (`Trademark`, `Model`, `HP`, `Liter`, `Cyl`, `TransmissSpeedCount`, `TransmissAutomatic`, `MPG_City`, `MPG_Highway`, `Category`, `Description`, `Hyperlink`, `Picture`, `Price`, `RtfContent`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" - Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Trademark", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Model", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("HP", Global.System.Data.OleDb.OleDbType.SmallInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Liter", Global.System.Data.OleDb.OleDbType.Double, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cyl", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("TransmissAutomatic", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MPG_City", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MPG_Highway", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Category", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Description", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Hyperlink", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Picture", Global.System.Data.OleDb.OleDbType.LongVarBinary, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Picture", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("RtfContent", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RtfContent", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.UpdateCommand.Connection = Me.Connection - Me._adapter.UpdateCommand.CommandText = "UPDATE `Cars` SET `Trademark` = ?, `Model` = ?, `HP` = ?, `Liter` = ?, `Cyl` = ?, `TransmissSpeedCount` = ?, `TransmissAutomatic` = ?, `MPG_City` = ?, `MPG_Highway` = ?, `Category` = ?, `Description` = ?, `Hyperlink` = ?, `Picture` = ?, `Price` = ?, `RtfContent` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Trademark` IS NULL) OR (`Trademark` = ?)) AND ((? = 1 AND `Model` IS NULL) OR (`Model` = ?)) AND ((? = 1 AND `HP` IS NULL) OR (`HP` = ?)) AND ((? = 1 AND `Liter` IS NULL) OR (`Liter` = ?)) AND ((? = 1 AND `Cyl` IS NULL) OR (`Cyl` = ?)) AND ((? = 1 AND `TransmissSpeedCount` IS NULL) OR (`TransmissSpeedCount` = ?)) AND ((? = 1 AND `TransmissAutomatic` IS NULL) OR (`TransmissAutomatic` = ?)) AND ((? = 1 AND `MPG_City` IS NULL) OR (`MPG_City` = ?)) AND ((? = 1 AND `MPG_Highway` IS NULL) OR (`MPG_Highway` = ?)) AND ((? = 1 AND `Category` IS NULL) OR (`Category` = ?)) AND ((? = 1 AND `Hyperlink` IS NULL) OR (`Hyperlink` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" - Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Trademark", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Model", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("HP", Global.System.Data.OleDb.OleDbType.SmallInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Liter", Global.System.Data.OleDb.OleDbType.Double, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cyl", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("TransmissAutomatic", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MPG_City", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MPG_Highway", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Category", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Description", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Hyperlink", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Picture", Global.System.Data.OleDb.OleDbType.LongVarBinary, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Picture", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("RtfContent", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RtfContent", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Trademark", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Trademark", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Model", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Model", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_HP", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_HP", Global.System.Data.OleDb.OleDbType.SmallInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Liter", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Liter", Global.System.Data.OleDb.OleDbType.Double, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cyl", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cyl", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_TransmissSpeedCount", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_TransmissAutomatic", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_TransmissAutomatic", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MPG_City", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MPG_City", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MPG_Highway", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MPG_Highway", Global.System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Category", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Category", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Hyperlink", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Hyperlink", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, False, Nothing)) - End Sub - - - Private Sub InitConnection() - Me._connection = New Global.System.Data.OleDb.OleDbConnection() - Me._connection.ConnectionString = My.Settings.Default.CarsDBConnectionString - End Sub - - - Private Sub InitCommandCollection() - Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} - Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() - Me._commandCollection(0).Connection = Me.Connection - Me._commandCollection(0).CommandText = "SELECT ID, Trademark, Model, HP, Liter, Cyl, TransmissSpeedCount, TransmissAutoma" & "tic, MPG_City, MPG_Highway, Category, Description, Hyperlink, Picture, Price, R" & "tfContent FROM Cars" - Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text - End Sub - - - Public Overridable Function Fill(ByVal dataTable As CarsDBDataSet.CarsDataTable) As Integer - Me.Adapter.SelectCommand = Me.CommandCollection(0) - If (Me.ClearBeforeFill = True) Then - dataTable.Clear() - End If - Dim returnValue As Integer = Me.Adapter.Fill(dataTable) - Return returnValue - End Function - - - Public Overridable Function GetData() As CarsDBDataSet.CarsDataTable - Me.Adapter.SelectCommand = Me.CommandCollection(0) - Dim dataTable As New CarsDBDataSet.CarsDataTable() - Me.Adapter.Fill(dataTable) - Return dataTable - End Function - - - Public Overridable Function Update(ByVal dataTable As CarsDBDataSet.CarsDataTable) As Integer - Return Me.Adapter.Update(dataTable) - End Function - - - Public Overridable Function Update(ByVal dataSet As CarsDBDataSet) As Integer - Return Me.Adapter.Update(dataSet, "Cars") - End Function - - - Public 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 Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer - Return Me.Adapter.Update(dataRows) - End Function - - - Public Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_Trademark As String, ByVal Original_Model As String, ByVal Original_HP? As Short, ByVal Original_Liter? As Double, ByVal Original_Cyl? As Byte, ByVal Original_TransmissSpeedCount? As Byte, ByVal Original_TransmissAutomatic As String, ByVal Original_MPG_City? As Byte, ByVal Original_MPG_Highway? As Byte, ByVal Original_Category As String, ByVal Original_Hyperlink As String, ByVal Original_Price? As Decimal) As Integer - Me.Adapter.DeleteCommand.Parameters(0).Value = (CInt(Original_ID)) - If (Original_Trademark Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(2).Value = (CStr(Original_Trademark)) - End If - If (Original_Model Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(4).Value = (CStr(Original_Model)) - End If - If (Original_HP.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(6).Value = (CShort(Original_HP.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value - End If - If (Original_Liter.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(8).Value = (CDbl(Original_Liter.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(8).Value = Global.System.DBNull.Value - End If - If (Original_Cyl.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(10).Value = (CByte(Original_Cyl.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(10).Value = Global.System.DBNull.Value - End If - If (Original_TransmissSpeedCount.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(12).Value = (CByte(Original_TransmissSpeedCount.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(12).Value = Global.System.DBNull.Value - End If - If (Original_TransmissAutomatic Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(14).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(14).Value = (CStr(Original_TransmissAutomatic)) - End If - If (Original_MPG_City.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(16).Value = (CByte(Original_MPG_City.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(16).Value = Global.System.DBNull.Value - End If - If (Original_MPG_Highway.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(18).Value = (CByte(Original_MPG_Highway.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(18).Value = Global.System.DBNull.Value - End If - If (Original_Category Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(20).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(20).Value = (CStr(Original_Category)) - End If - If (Original_Hyperlink Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(22).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(22).Value = (CStr(Original_Hyperlink)) - End If - If (Original_Price.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(23).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(24).Value = (CDec(Original_Price.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(23).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(24).Value = Global.System.DBNull.Value - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State - If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.DeleteCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.DeleteCommand.Connection.Close() - End If - End Try - End Function - - - Public Overridable Function Insert(ByVal Trademark As String, ByVal Model As String, ByVal HP? As Short, ByVal Liter? As Double, ByVal Cyl? As Byte, ByVal TransmissSpeedCount? As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City? As Byte, ByVal MPG_Highway? As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price? As Decimal, ByVal RtfContent As String) As Integer - If (Trademark Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(0).Value = (CStr(Trademark)) - End If - If (Model Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(1).Value = (CStr(Model)) - End If - If (HP.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(2).Value = (CShort(HP.Value)) - Else - Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value - End If - If (Liter.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(3).Value = (CDbl(Liter.Value)) - Else - Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value - End If - If (Cyl.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(4).Value = (CByte(Cyl.Value)) - Else - Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value - End If - If (TransmissSpeedCount.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(5).Value = (CByte(TransmissSpeedCount.Value)) - Else - Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value - End If - If (TransmissAutomatic Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(6).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(6).Value = (CStr(TransmissAutomatic)) - End If - If (MPG_City.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(7).Value = (CByte(MPG_City.Value)) - Else - Me.Adapter.InsertCommand.Parameters(7).Value = Global.System.DBNull.Value - End If - If (MPG_Highway.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(8).Value = (CByte(MPG_Highway.Value)) - Else - Me.Adapter.InsertCommand.Parameters(8).Value = Global.System.DBNull.Value - End If - If (Category Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(9).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(9).Value = (CStr(Category)) - End If - If (Description Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(10).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(10).Value = (CStr(Description)) - End If - If (Hyperlink Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(11).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(11).Value = (CStr(Hyperlink)) - End If - If (Picture Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(12).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(12).Value = (CType(Picture, Byte())) - End If - If (Price.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(13).Value = (CDec(Price.Value)) - Else - Me.Adapter.InsertCommand.Parameters(13).Value = Global.System.DBNull.Value - End If - If (RtfContent Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(14).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(14).Value = (CStr(RtfContent)) - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State - If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.InsertCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.InsertCommand.Connection.Close() - End If - End Try - End Function - - - Public Overridable Function Update(ByVal Trademark As String, ByVal Model As String, ByVal HP? As Short, ByVal Liter? As Double, ByVal Cyl? As Byte, ByVal TransmissSpeedCount? As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City? As Byte, ByVal MPG_Highway? As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price? As Decimal, ByVal RtfContent As String, ByVal Original_ID As Integer, ByVal Original_Trademark As String, ByVal Original_Model As String, ByVal Original_HP? As Short, ByVal Original_Liter? As Double, ByVal Original_Cyl? As Byte, ByVal Original_TransmissSpeedCount? As Byte, ByVal Original_TransmissAutomatic As String, ByVal Original_MPG_City? As Byte, ByVal Original_MPG_Highway? As Byte, ByVal Original_Category As String, ByVal Original_Hyperlink As String, ByVal Original_Price? As Decimal) As Integer - If (Trademark Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(0).Value = (CStr(Trademark)) - End If - If (Model Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(1).Value = (CStr(Model)) - End If - If (HP.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(2).Value = (CShort(HP.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value - End If - If (Liter.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(3).Value = (CDbl(Liter.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value - End If - If (Cyl.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(4).Value = (CByte(Cyl.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value - End If - If (TransmissSpeedCount.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(5).Value = (CByte(TransmissSpeedCount.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value - End If - If (TransmissAutomatic Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(6).Value = (CStr(TransmissAutomatic)) - End If - If (MPG_City.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(7).Value = (CByte(MPG_City.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value - End If - If (MPG_Highway.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(8).Value = (CByte(MPG_Highway.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value - End If - If (Category Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(9).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(9).Value = (CStr(Category)) - End If - If (Description Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(10).Value = (CStr(Description)) - End If - If (Hyperlink Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(11).Value = (CStr(Hyperlink)) - End If - If (Picture Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(12).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(12).Value = (CType(Picture, Byte())) - End If - If (Price.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(13).Value = (CDec(Price.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(13).Value = Global.System.DBNull.Value - End If - If (RtfContent Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(14).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(14).Value = (CStr(RtfContent)) - End If - Me.Adapter.UpdateCommand.Parameters(15).Value = (CInt(Original_ID)) - If (Original_Trademark Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(17).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(17).Value = (CStr(Original_Trademark)) - End If - If (Original_Model Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(19).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(19).Value = (CStr(Original_Model)) - End If - If (Original_HP.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(21).Value = (CShort(Original_HP.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(21).Value = Global.System.DBNull.Value - End If - If (Original_Liter.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(23).Value = (CDbl(Original_Liter.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(23).Value = Global.System.DBNull.Value - End If - If (Original_Cyl.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(25).Value = (CByte(Original_Cyl.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(25).Value = Global.System.DBNull.Value - End If - If (Original_TransmissSpeedCount.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(27).Value = (CByte(Original_TransmissSpeedCount.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(27).Value = Global.System.DBNull.Value - End If - If (Original_TransmissAutomatic Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(29).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(29).Value = (CStr(Original_TransmissAutomatic)) - End If - If (Original_MPG_City.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(31).Value = (CByte(Original_MPG_City.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(31).Value = Global.System.DBNull.Value - End If - If (Original_MPG_Highway.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(33).Value = (CByte(Original_MPG_Highway.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(33).Value = Global.System.DBNull.Value - End If - If (Original_Category Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(35).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(35).Value = (CStr(Original_Category)) - End If - If (Original_Hyperlink Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(37).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(37).Value = (CStr(Original_Hyperlink)) - End If - If (Original_Price.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(38).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(39).Value = (CDec(Original_Price.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(38).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(39).Value = Global.System.DBNull.Value - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State - If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.UpdateCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.UpdateCommand.Connection.Close() - End If - End Try - End Function - End Class - - ''' - '''Represents the connection and commands used to retrieve and save data. - ''' - - Partial Public Class CarSchedulingTableAdapter - Inherits System.ComponentModel.Component - - Private _adapter As Global.System.Data.OleDb.OleDbDataAdapter - - Private _connection As Global.System.Data.OleDb.OleDbConnection - - Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand - - Private _clearBeforeFill As Boolean - - - Public Sub New() - Me.ClearBeforeFill = True - End Sub - - - Public ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter - Get - If (Me._adapter Is Nothing) Then - Me.InitAdapter() - End If - Return Me._adapter - End Get - End Property - - - Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection - Get - If (Me._connection Is Nothing) Then - Me.InitConnection() - End If - Return Me._connection - End Get - Set(ByVal value As System.Data.OleDb.OleDbConnection) - Me._connection = value - If (Me.Adapter.InsertCommand IsNot Nothing) Then - Me.Adapter.InsertCommand.Connection = value - End If - If (Me.Adapter.DeleteCommand IsNot Nothing) Then - Me.Adapter.DeleteCommand.Connection = value - End If - If (Me.Adapter.UpdateCommand IsNot Nothing) Then - Me.Adapter.UpdateCommand.Connection = value - End If - Dim i As Integer = 0 - Do While (i < Me.CommandCollection.Length) - If (Me.CommandCollection(i) IsNot Nothing) Then - CType(Me.CommandCollection(i), Global.System.Data.OleDb.OleDbCommand).Connection = value - End If - i = (i + 1) - Loop - End Set - End Property - - - Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() - Get - If (Me._commandCollection Is Nothing) Then - Me.InitCommandCollection() - End If - Return Me._commandCollection - End Get - End Property - - - Public Property ClearBeforeFill() As Boolean - Get - Return Me._clearBeforeFill - End Get - Set(ByVal value As Boolean) - Me._clearBeforeFill = value - End Set - End Property - - - Private Sub InitAdapter() - Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() - Dim tableMapping As New Global.System.Data.Common.DataTableMapping() - tableMapping.SourceTable = "Table" - tableMapping.DataSetTable = "CarScheduling" - tableMapping.ColumnMappings.Add("ID", "ID") - tableMapping.ColumnMappings.Add("CarId", "CarId") - tableMapping.ColumnMappings.Add("UserId", "UserId") - tableMapping.ColumnMappings.Add("Status", "Status") - tableMapping.ColumnMappings.Add("Subject", "Subject") - tableMapping.ColumnMappings.Add("Description", "Description") - tableMapping.ColumnMappings.Add("Label", "Label") - tableMapping.ColumnMappings.Add("StartTime", "StartTime") - tableMapping.ColumnMappings.Add("EndTime", "EndTime") - tableMapping.ColumnMappings.Add("Location", "Location") - tableMapping.ColumnMappings.Add("AllDay", "AllDay") - tableMapping.ColumnMappings.Add("EventType", "EventType") - tableMapping.ColumnMappings.Add("RecurrenceInfo", "RecurrenceInfo") - tableMapping.ColumnMappings.Add("ReminderInfo", "ReminderInfo") - tableMapping.ColumnMappings.Add("Price", "Price") - tableMapping.ColumnMappings.Add("ContactInfo", "ContactInfo") - Me._adapter.TableMappings.Add(tableMapping) - Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.DeleteCommand.Connection = Me.Connection - Me._adapter.DeleteCommand.CommandText = "DELETE FROM `CarScheduling` WHERE ((`ID` = ?) AND ((? = 1 AND `CarId` IS NULL) OR (`CarId` = ?)) AND ((? = 1 AND `UserId` IS NULL) OR (`UserId` = ?)) AND ((? = 1 AND `Status` IS NULL) OR (`Status` = ?)) AND ((? = 1 AND `Subject` IS NULL) OR (`Subject` = ?)) AND ((? = 1 AND `Label` IS NULL) OR (`Label` = ?)) AND ((? = 1 AND `StartTime` IS NULL) OR (`StartTime` = ?)) AND ((? = 1 AND `EndTime` IS NULL) OR (`EndTime` = ?)) AND ((? = 1 AND `Location` IS NULL) OR (`Location` = ?)) AND ((? = 1 AND `AllDay` IS NULL) OR (`AllDay` = ?)) AND ((? = 1 AND `EventType` IS NULL) OR (`EventType` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" - Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Subject", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Subject", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_StartTime", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_StartTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_EndTime", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_EndTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Location", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Location", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_AllDay", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_AllDay", Global.System.Data.OleDb.OleDbType.Boolean, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.InsertCommand.Connection = Me.Connection - Me._adapter.InsertCommand.CommandText = "INSERT INTO `CarScheduling` (`CarId`, `UserId`, `Status`, `Subject`, `Description`, `Label`, `StartTime`, `EndTime`, `Location`, `AllDay`, `EventType`, `RecurrenceInfo`, `ReminderInfo`, `Price`, `ContactInfo`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" - Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Subject", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Description", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("StartTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("EndTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Location", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("AllDay", Global.System.Data.OleDb.OleDbType.Boolean, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("RecurrenceInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RecurrenceInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ReminderInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ReminderInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ContactInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ContactInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() - Me._adapter.UpdateCommand.Connection = Me.Connection - Me._adapter.UpdateCommand.CommandText = "UPDATE `CarScheduling` SET `CarId` = ?, `UserId` = ?, `Status` = ?, `Subject` = ?, `Description` = ?, `Label` = ?, `StartTime` = ?, `EndTime` = ?, `Location` = ?, `AllDay` = ?, `EventType` = ?, `RecurrenceInfo` = ?, `ReminderInfo` = ?, `Price` = ?, `ContactInfo` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `CarId` IS NULL) OR (`CarId` = ?)) AND ((? = 1 AND `UserId` IS NULL) OR (`UserId` = ?)) AND ((? = 1 AND `Status` IS NULL) OR (`Status` = ?)) AND ((? = 1 AND `Subject` IS NULL) OR (`Subject` = ?)) AND ((? = 1 AND `Label` IS NULL) OR (`Label` = ?)) AND ((? = 1 AND `StartTime` IS NULL) OR (`StartTime` = ?)) AND ((? = 1 AND `EndTime` IS NULL) OR (`EndTime` = ?)) AND ((? = 1 AND `Location` IS NULL) OR (`Location` = ?)) AND ((? = 1 AND `AllDay` IS NULL) OR (`AllDay` = ?)) AND ((? = 1 AND `EventType` IS NULL) OR (`EventType` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" - Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Subject", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Description", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("StartTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("EndTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Location", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("AllDay", Global.System.Data.OleDb.OleDbType.Boolean, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("RecurrenceInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RecurrenceInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ReminderInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ReminderInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ContactInfo", Global.System.Data.OleDb.OleDbType.LongVarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ContactInfo", Global.System.Data.DataRowVersion.Current, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_CarId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_UserId", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Status", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Subject", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Subject", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Label", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_StartTime", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_StartTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_EndTime", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_EndTime", Global.System.Data.OleDb.OleDbType.Date, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Location", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Location", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_AllDay", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_AllDay", Global.System.Data.OleDb.OleDbType.Boolean, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_EventType", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", Global.System.Data.DataRowVersion.Original, False, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.Integer, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, True, Nothing)) - Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", Global.System.Data.DataRowVersion.Original, False, Nothing)) - End Sub - - - Private Sub InitConnection() - Me._connection = New Global.System.Data.OleDb.OleDbConnection() - Me._connection.ConnectionString = My.Settings.Default.CarsDBConnectionString - End Sub - - - Private Sub InitCommandCollection() - Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} - Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() - Me._commandCollection(0).Connection = Me.Connection - Me._commandCollection(0).CommandText = "SELECT ID, CarId, UserId, Status, Subject, Description, Label, StartTime, EndTime" & ", Location, AllDay, EventType, RecurrenceInfo, ReminderInfo, Price, ContactInfo" & " FROM CarScheduling" - Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text - End Sub - - - Public Overridable Function Fill(ByVal dataTable As CarsDBDataSet.CarSchedulingDataTable) As Integer - Me.Adapter.SelectCommand = Me.CommandCollection(0) - If (Me.ClearBeforeFill = True) Then - dataTable.Clear() - End If - Dim returnValue As Integer = Me.Adapter.Fill(dataTable) - Return returnValue - End Function - - - Public Overridable Function GetData() As CarsDBDataSet.CarSchedulingDataTable - Me.Adapter.SelectCommand = Me.CommandCollection(0) - Dim dataTable As New CarsDBDataSet.CarSchedulingDataTable() - Me.Adapter.Fill(dataTable) - Return dataTable - End Function - - - Public Overridable Function Update(ByVal dataTable As CarsDBDataSet.CarSchedulingDataTable) As Integer - Return Me.Adapter.Update(dataTable) - End Function - - - Public Overridable Function Update(ByVal dataSet As CarsDBDataSet) As Integer - Return Me.Adapter.Update(dataSet, "CarScheduling") - End Function - - - Public 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 Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer - Return Me.Adapter.Update(dataRows) - End Function - - - Public Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_CarId? As Integer, ByVal Original_UserId? As Integer, ByVal Original_Status? As Integer, ByVal Original_Subject As String, ByVal Original_Label? As Integer, ByVal Original_StartTime? As Global.System.DateTime, ByVal Original_EndTime? As Global.System.DateTime, ByVal Original_Location As String, ByVal Original_AllDay As Boolean, ByVal Original_EventType? As Integer, ByVal Original_Price? As Decimal) As Integer - Me.Adapter.DeleteCommand.Parameters(0).Value = (CInt(Original_ID)) - If (Original_CarId.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(2).Value = (CInt(Original_CarId.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value - End If - If (Original_UserId.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(4).Value = (CInt(Original_UserId.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value - End If - If (Original_Status.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(6).Value = (CInt(Original_Status.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value - End If - If (Original_Subject Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(8).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(8).Value = (CStr(Original_Subject)) - End If - If (Original_Label.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(10).Value = (CInt(Original_Label.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(10).Value = Global.System.DBNull.Value - End If - If (Original_StartTime.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(12).Value = (CDate(Original_StartTime.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(12).Value = Global.System.DBNull.Value - End If - If (Original_EndTime.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(14).Value = (CDate(Original_EndTime.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(14).Value = Global.System.DBNull.Value - End If - If (Original_Location Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(16).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(16).Value = (CStr(Original_Location)) - End If - Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(18).Value = (CBool(Original_AllDay)) - If (Original_EventType.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(20).Value = (CInt(Original_EventType.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(20).Value = Global.System.DBNull.Value - End If - If (Original_Price.HasValue = True) Then - Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(0)) - Me.Adapter.DeleteCommand.Parameters(22).Value = (CDec(Original_Price.Value)) - Else - Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(1)) - Me.Adapter.DeleteCommand.Parameters(22).Value = Global.System.DBNull.Value - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State - If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.DeleteCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.DeleteCommand.Connection.Close() - End If - End Try - End Function - - - Public Overridable Function Insert(ByVal CarId? As Integer, ByVal UserId? As Integer, ByVal Status? As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label? As Integer, ByVal StartTime? As Global.System.DateTime, ByVal EndTime? As Global.System.DateTime, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType? As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price? As Decimal, ByVal ContactInfo As String) As Integer - If (CarId.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(0).Value = (CInt(CarId.Value)) - Else - Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value - End If - If (UserId.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(1).Value = (CInt(UserId.Value)) - Else - Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value - End If - If (Status.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(2).Value = (CInt(Status.Value)) - Else - Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value - End If - If (Subject Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(3).Value = (CStr(Subject)) - End If - If (Description Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(4).Value = (CStr(Description)) - End If - If (Label.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(5).Value = (CInt(Label.Value)) - Else - Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value - End If - If (StartTime.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(6).Value = (CDate(StartTime.Value)) - Else - Me.Adapter.InsertCommand.Parameters(6).Value = Global.System.DBNull.Value - End If - If (EndTime.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(7).Value = (CDate(EndTime.Value)) - Else - Me.Adapter.InsertCommand.Parameters(7).Value = Global.System.DBNull.Value - End If - If (Location Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(8).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(8).Value = (CStr(Location)) - End If - Me.Adapter.InsertCommand.Parameters(9).Value = (CBool(AllDay)) - If (EventType.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(10).Value = (CInt(EventType.Value)) - Else - Me.Adapter.InsertCommand.Parameters(10).Value = Global.System.DBNull.Value - End If - If (RecurrenceInfo Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(11).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(11).Value = (CStr(RecurrenceInfo)) - End If - If (ReminderInfo Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(12).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(12).Value = (CStr(ReminderInfo)) - End If - If (Price.HasValue = True) Then - Me.Adapter.InsertCommand.Parameters(13).Value = (CDec(Price.Value)) - Else - Me.Adapter.InsertCommand.Parameters(13).Value = Global.System.DBNull.Value - End If - If (ContactInfo Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(14).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(14).Value = (CStr(ContactInfo)) - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State - If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.InsertCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.InsertCommand.Connection.Close() - End If - End Try - End Function - - - Public Overridable Function Update(ByVal CarId? As Integer, ByVal UserId? As Integer, ByVal Status? As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label? As Integer, ByVal StartTime? As Global.System.DateTime, ByVal EndTime? As Global.System.DateTime, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType? As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price? As Decimal, ByVal ContactInfo As String, ByVal Original_ID As Integer, ByVal Original_CarId? As Integer, ByVal Original_UserId? As Integer, ByVal Original_Status? As Integer, ByVal Original_Subject As String, ByVal Original_Label? As Integer, ByVal Original_StartTime? As Global.System.DateTime, ByVal Original_EndTime? As Global.System.DateTime, ByVal Original_Location As String, ByVal Original_AllDay As Boolean, ByVal Original_EventType? As Integer, ByVal Original_Price? As Decimal) As Integer - If (CarId.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(0).Value = (CInt(CarId.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value - End If - If (UserId.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(1).Value = (CInt(UserId.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value - End If - If (Status.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(2).Value = (CInt(Status.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value - End If - If (Subject Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(3).Value = (CStr(Subject)) - End If - If (Description Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(4).Value = (CStr(Description)) - End If - If (Label.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(5).Value = (CInt(Label.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value - End If - If (StartTime.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(6).Value = (CDate(StartTime.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value - End If - If (EndTime.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(7).Value = (CDate(EndTime.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value - End If - If (Location Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(8).Value = (CStr(Location)) - End If - Me.Adapter.UpdateCommand.Parameters(9).Value = (CBool(AllDay)) - If (EventType.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(10).Value = (CInt(EventType.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value - End If - If (RecurrenceInfo Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(11).Value = (CStr(RecurrenceInfo)) - End If - If (ReminderInfo Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(12).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(12).Value = (CStr(ReminderInfo)) - End If - If (Price.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(13).Value = (CDec(Price.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(13).Value = Global.System.DBNull.Value - End If - If (ContactInfo Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(14).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(14).Value = (CStr(ContactInfo)) - End If - Me.Adapter.UpdateCommand.Parameters(15).Value = (CInt(Original_ID)) - If (Original_CarId.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(17).Value = (CInt(Original_CarId.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(17).Value = Global.System.DBNull.Value - End If - If (Original_UserId.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(19).Value = (CInt(Original_UserId.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(19).Value = Global.System.DBNull.Value - End If - If (Original_Status.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(21).Value = (CInt(Original_Status.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(21).Value = Global.System.DBNull.Value - End If - If (Original_Subject Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(23).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(23).Value = (CStr(Original_Subject)) - End If - If (Original_Label.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(25).Value = (CInt(Original_Label.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(25).Value = Global.System.DBNull.Value - End If - If (Original_StartTime.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(27).Value = (CDate(Original_StartTime.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(27).Value = Global.System.DBNull.Value - End If - If (Original_EndTime.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(29).Value = (CDate(Original_EndTime.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(29).Value = Global.System.DBNull.Value - End If - If (Original_Location Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(31).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(31).Value = (CStr(Original_Location)) - End If - Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(33).Value = (CBool(Original_AllDay)) - If (Original_EventType.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(35).Value = (CInt(Original_EventType.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(35).Value = Global.System.DBNull.Value - End If - If (Original_Price.HasValue = True) Then - Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(0)) - Me.Adapter.UpdateCommand.Parameters(37).Value = (CDec(Original_Price.Value)) - Else - Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(1)) - Me.Adapter.UpdateCommand.Parameters(37).Value = Global.System.DBNull.Value - End If - Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State - If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) <> Global.System.Data.ConnectionState.Open) Then - Me.Adapter.UpdateCommand.Connection.Open() - End If - Try - Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery() - Return returnValue - Finally - If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then - Me.Adapter.UpdateCommand.Connection.Close() - End If - End Try - End Function - End Class + ''' + '''Represents the connection and commands used to retrieve and save data. + ''' + + + + + + Partial Public Class CarsTableAdapter + Inherits System.ComponentModel.Component + + Private _adapter As System.Data.OleDb.OleDbDataAdapter + + Private _connection As System.Data.OleDb.OleDbConnection + + Private _commandCollection() As System.Data.OleDb.OleDbCommand + + Private _clearBeforeFill As Boolean + + + + Public Sub New() + Me.ClearBeforeFill = True + End Sub + + + + Private ReadOnly Property Adapter() As System.Data.OleDb.OleDbDataAdapter + Get + If (Me._adapter Is Nothing) Then + Me.InitAdapter() + End If + Return Me._adapter + End Get + End Property + + + + Friend Property Connection() As System.Data.OleDb.OleDbConnection + Get + If (Me._connection Is Nothing) Then + Me.InitConnection() + End If + Return Me._connection + End Get + Set(ByVal value As System.Data.OleDb.OleDbConnection) + Me._connection = value + If (Me.Adapter.InsertCommand IsNot Nothing) Then + Me.Adapter.InsertCommand.Connection = value + End If + If (Me.Adapter.DeleteCommand IsNot Nothing) Then + Me.Adapter.DeleteCommand.Connection = value + End If + If (Me.Adapter.UpdateCommand IsNot Nothing) Then + Me.Adapter.UpdateCommand.Connection = value + End If + Dim i As Integer = 0 + Do While (i < Me.CommandCollection.Length) + If (Me.CommandCollection(i) IsNot Nothing) Then + CType(Me.CommandCollection(i), System.Data.OleDb.OleDbCommand).Connection = value + End If + i = (i + 1) + Loop + End Set + End Property + + + + Protected ReadOnly Property CommandCollection() As System.Data.OleDb.OleDbCommand() + Get + If (Me._commandCollection Is Nothing) Then + Me.InitCommandCollection() + End If + Return Me._commandCollection + End Get + End Property + + + + Public Property ClearBeforeFill() As Boolean + Get + Return Me._clearBeforeFill + End Get + Set(ByVal value As Boolean) + Me._clearBeforeFill = value + End Set + End Property + + + + Private Sub InitAdapter() + Me._adapter = New System.Data.OleDb.OleDbDataAdapter() + Dim tableMapping As New System.Data.Common.DataTableMapping() + tableMapping.SourceTable = "Table" + tableMapping.DataSetTable = "Cars" + tableMapping.ColumnMappings.Add("ID", "ID") + tableMapping.ColumnMappings.Add("Trademark", "Trademark") + tableMapping.ColumnMappings.Add("Model", "Model") + tableMapping.ColumnMappings.Add("HP", "HP") + tableMapping.ColumnMappings.Add("Liter", "Liter") + tableMapping.ColumnMappings.Add("Cyl", "Cyl") + tableMapping.ColumnMappings.Add("TransmissSpeedCount", "TransmissSpeedCount") + tableMapping.ColumnMappings.Add("TransmissAutomatic", "TransmissAutomatic") + tableMapping.ColumnMappings.Add("MPG_City", "MPG_City") + tableMapping.ColumnMappings.Add("MPG_Highway", "MPG_Highway") + tableMapping.ColumnMappings.Add("Category", "Category") + tableMapping.ColumnMappings.Add("Description", "Description") + tableMapping.ColumnMappings.Add("Hyperlink", "Hyperlink") + tableMapping.ColumnMappings.Add("Picture", "Picture") + tableMapping.ColumnMappings.Add("Price", "Price") + tableMapping.ColumnMappings.Add("RtfContent", "RtfContent") + Me._adapter.TableMappings.Add(tableMapping) + Me._adapter.DeleteCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.DeleteCommand.Connection = Me.Connection + Me._adapter.DeleteCommand.CommandText = "DELETE FROM `Cars` WHERE ((`ID` = ?) AND ((? = 1 AND `Trademark` IS NULL) OR (`Trademark` = ?)) AND ((? = 1 AND `Model` IS NULL) OR (`Model` = ?)) AND ((? = 1 AND `HP` IS NULL) OR (`HP` = ?)) AND ((? = 1 AND `Liter` IS NULL) OR (`Liter` = ?)) AND ((? = 1 AND `Cyl` IS NULL) OR (`Cyl` = ?)) AND ((? = 1 AND `TransmissSpeedCount` IS NULL) OR (`TransmissSpeedCount` = ?)) AND ((? = 1 AND `TransmissAutomatic` IS NULL) OR (`TransmissAutomatic` = ?)) AND ((? = 1 AND `MPG_City` IS NULL) OR (`MPG_City` = ?)) AND ((? = 1 AND `MPG_Highway` IS NULL) OR (`MPG_Highway` = ?)) AND ((? = 1 AND `Category` IS NULL) OR (`Category` = ?)) AND ((? = 1 AND `Hyperlink` IS NULL) OR (`Hyperlink` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" + Me._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Trademark", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Trademark", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Model", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Model", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_HP", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_HP", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Liter", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Liter", System.Data.OleDb.OleDbType.Double, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Cyl", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Cyl", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_TransmissSpeedCount", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_TransmissSpeedCount", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_TransmissAutomatic", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_TransmissAutomatic", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_MPG_City", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MPG_City", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_MPG_Highway", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MPG_Highway", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Category", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Category", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Hyperlink", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Hyperlink", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Price", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.InsertCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.InsertCommand.Connection = Me.Connection + Me._adapter.InsertCommand.CommandText = "INSERT INTO `Cars` (`Trademark`, `Model`, `HP`, `Liter`, `Cyl`, `TransmissSpeedCount`, `TransmissAutomatic`, `MPG_City`, `MPG_Highway`, `Category`, `Description`, `Hyperlink`, `Picture`, `Price`, `RtfContent`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" + Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Trademark", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Model", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("HP", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Liter", System.Data.OleDb.OleDbType.Double, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Cyl", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("TransmissSpeedCount", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("TransmissAutomatic", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("MPG_City", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("MPG_Highway", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Category", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Hyperlink", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Picture", System.Data.OleDb.OleDbType.LongVarBinary, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Picture", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("RtfContent", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RtfContent", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.UpdateCommand.Connection = Me.Connection + Me._adapter.UpdateCommand.CommandText = "UPDATE `Cars` SET `Trademark` = ?, `Model` = ?, `HP` = ?, `Liter` = ?, `Cyl` = ?, `TransmissSpeedCount` = ?, `TransmissAutomatic` = ?, `MPG_City` = ?, `MPG_Highway` = ?, `Category` = ?, `Description` = ?, `Hyperlink` = ?, `Picture` = ?, `Price` = ?, `RtfContent` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Trademark` IS NULL) OR (`Trademark` = ?)) AND ((? = 1 AND `Model` IS NULL) OR (`Model` = ?)) AND ((? = 1 AND `HP` IS NULL) OR (`HP` = ?)) AND ((? = 1 AND `Liter` IS NULL) OR (`Liter` = ?)) AND ((? = 1 AND `Cyl` IS NULL) OR (`Cyl` = ?)) AND ((? = 1 AND `TransmissSpeedCount` IS NULL) OR (`TransmissSpeedCount` = ?)) AND ((? = 1 AND `TransmissAutomatic` IS NULL) OR (`TransmissAutomatic` = ?)) AND ((? = 1 AND `MPG_City` IS NULL) OR (`MPG_City` = ?)) AND ((? = 1 AND `MPG_Highway` IS NULL) OR (`MPG_Highway` = ?)) AND ((? = 1 AND `Category` IS NULL) OR (`Category` = ?)) AND ((? = 1 AND `Hyperlink` IS NULL) OR (`Hyperlink` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" + Me._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Trademark", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Model", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("HP", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Liter", System.Data.OleDb.OleDbType.Double, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Cyl", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("TransmissSpeedCount", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("TransmissAutomatic", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("MPG_City", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("MPG_Highway", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Category", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Hyperlink", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Picture", System.Data.OleDb.OleDbType.LongVarBinary, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Picture", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("RtfContent", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RtfContent", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Trademark", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Trademark", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Trademark", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Model", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Model", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Model", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_HP", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_HP", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "HP", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Liter", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Liter", System.Data.OleDb.OleDbType.Double, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Liter", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Cyl", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Cyl", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Cyl", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_TransmissSpeedCount", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_TransmissSpeedCount", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissSpeedCount", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_TransmissAutomatic", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_TransmissAutomatic", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "TransmissAutomatic", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_MPG_City", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MPG_City", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_City", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_MPG_Highway", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_MPG_Highway", System.Data.OleDb.OleDbType.UnsignedTinyInt, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "MPG_Highway", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Category", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Category", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Category", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Hyperlink", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Hyperlink", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Hyperlink", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Price", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, False, Nothing)) + End Sub + + + + Private Sub InitConnection() + Me._connection = New System.Data.OleDb.OleDbConnection() + Me._connection.ConnectionString = Global.SimpleCustomFields.Properties.Settings.Default.CarsDBConnectionString + End Sub + + + + Private Sub InitCommandCollection() + Me._commandCollection = New System.Data.OleDb.OleDbCommand(0){} + Me._commandCollection(0) = New System.Data.OleDb.OleDbCommand() + Me._commandCollection(0).Connection = Me.Connection + Me._commandCollection(0).CommandText = "SELECT ID, Trademark, Model, HP, Liter, Cyl, TransmissSpeedCount, TransmissAutoma" & "tic, MPG_City, MPG_Highway, Category, Description, Hyperlink, Picture, Price, R" & "tfContent FROM Cars" + Me._commandCollection(0).CommandType = System.Data.CommandType.Text + End Sub + + + + + + Public Overridable Function Fill(ByVal dataTable As CarsDBDataSet.CarsDataTable) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(0) + If (Me.ClearBeforeFill = True) Then + dataTable.Clear() + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + + + + + Public Overridable Function GetData() As CarsDBDataSet.CarsDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(0) + Dim dataTable As New CarsDBDataSet.CarsDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + + + + + Public Overridable Function Update(ByVal dataTable As CarsDBDataSet.CarsDataTable) As Integer + Return Me.Adapter.Update(dataTable) + End Function + + + + + Public Overridable Function Update(ByVal dataSet As CarsDBDataSet) As Integer + Return Me.Adapter.Update(dataSet, "Cars") + End Function + + + + + Public Overridable Function Update(ByVal dataRow As System.Data.DataRow) As Integer + Return Me.Adapter.Update(New System.Data.DataRow() { dataRow}) + End Function + + + + + Public Overridable Function Update(ByVal dataRows() As System.Data.DataRow) As Integer + Return Me.Adapter.Update(dataRows) + End Function + + + + + + Public Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_Trademark As String, ByVal Original_Model As String, ByVal Original_HP? As Short, ByVal Original_Liter? As Double, ByVal Original_Cyl? As Byte, ByVal Original_TransmissSpeedCount? As Byte, ByVal Original_TransmissAutomatic As String, ByVal Original_MPG_City? As Byte, ByVal Original_MPG_Highway? As Byte, ByVal Original_Category As String, ByVal Original_Hyperlink As String, ByVal Original_Price? As Decimal) As Integer + Me.Adapter.DeleteCommand.Parameters(0).Value = (CInt(Original_ID)) + If (Original_Trademark Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(2).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(2).Value = (CStr(Original_Trademark)) + End If + If (Original_Model Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(4).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(4).Value = (CStr(Original_Model)) + End If + If (Original_HP.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(6).Value = (CShort(Original_HP.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(6).Value = System.DBNull.Value + End If + If (Original_Liter.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(8).Value = (CDbl(Original_Liter.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(8).Value = System.DBNull.Value + End If + If (Original_Cyl.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(10).Value = (CByte(Original_Cyl.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(10).Value = System.DBNull.Value + End If + If (Original_TransmissSpeedCount.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(12).Value = (CByte(Original_TransmissSpeedCount.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(12).Value = System.DBNull.Value + End If + If (Original_TransmissAutomatic Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(14).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(14).Value = (CStr(Original_TransmissAutomatic)) + End If + If (Original_MPG_City.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(16).Value = (CByte(Original_MPG_City.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(16).Value = System.DBNull.Value + End If + If (Original_MPG_Highway.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(18).Value = (CByte(Original_MPG_Highway.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(18).Value = System.DBNull.Value + End If + If (Original_Category Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(20).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(20).Value = (CStr(Original_Category)) + End If + If (Original_Hyperlink Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(22).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(22).Value = (CStr(Original_Hyperlink)) + End If + If (Original_Price.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(23).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(24).Value = (CDec(Original_Price.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(23).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(24).Value = System.DBNull.Value + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State + If ((Me.Adapter.DeleteCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.DeleteCommand.Connection.Close() + End If + End Try + End Function + + + + + + Public Overridable Function Insert(ByVal Trademark As String, ByVal Model As String, ByVal HP? As Short, ByVal Liter? As Double, ByVal Cyl? As Byte, ByVal TransmissSpeedCount? As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City? As Byte, ByVal MPG_Highway? As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price? As Decimal, ByVal RtfContent As String) As Integer + If (Trademark Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(0).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(0).Value = (CStr(Trademark)) + End If + If (Model Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(1).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(1).Value = (CStr(Model)) + End If + If (HP.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(2).Value = (CShort(HP.Value)) + Else + Me.Adapter.InsertCommand.Parameters(2).Value = System.DBNull.Value + End If + If (Liter.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(3).Value = (CDbl(Liter.Value)) + Else + Me.Adapter.InsertCommand.Parameters(3).Value = System.DBNull.Value + End If + If (Cyl.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(4).Value = (CByte(Cyl.Value)) + Else + Me.Adapter.InsertCommand.Parameters(4).Value = System.DBNull.Value + End If + If (TransmissSpeedCount.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(5).Value = (CByte(TransmissSpeedCount.Value)) + Else + Me.Adapter.InsertCommand.Parameters(5).Value = System.DBNull.Value + End If + If (TransmissAutomatic Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(6).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(6).Value = (CStr(TransmissAutomatic)) + End If + If (MPG_City.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(7).Value = (CByte(MPG_City.Value)) + Else + Me.Adapter.InsertCommand.Parameters(7).Value = System.DBNull.Value + End If + If (MPG_Highway.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(8).Value = (CByte(MPG_Highway.Value)) + Else + Me.Adapter.InsertCommand.Parameters(8).Value = System.DBNull.Value + End If + If (Category Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(9).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(9).Value = (CStr(Category)) + End If + If (Description Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(10).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(10).Value = (CStr(Description)) + End If + If (Hyperlink Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(11).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(11).Value = (CStr(Hyperlink)) + End If + If (Picture Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(12).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(12).Value = (CType(Picture, Byte())) + End If + If (Price.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(13).Value = (CDec(Price.Value)) + Else + Me.Adapter.InsertCommand.Parameters(13).Value = System.DBNull.Value + End If + If (RtfContent Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(14).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(14).Value = (CStr(RtfContent)) + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State + If ((Me.Adapter.InsertCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.InsertCommand.Connection.Close() + End If + End Try + End Function + + + + + + Public Overridable Function Update(ByVal Trademark As String, ByVal Model As String, ByVal HP? As Short, ByVal Liter? As Double, ByVal Cyl? As Byte, ByVal TransmissSpeedCount? As Byte, ByVal TransmissAutomatic As String, ByVal MPG_City? As Byte, ByVal MPG_Highway? As Byte, ByVal Category As String, ByVal Description As String, ByVal Hyperlink As String, ByVal Picture() As Byte, ByVal Price? As Decimal, ByVal RtfContent As String, ByVal Original_ID As Integer, ByVal Original_Trademark As String, ByVal Original_Model As String, ByVal Original_HP? As Short, ByVal Original_Liter? As Double, ByVal Original_Cyl? As Byte, ByVal Original_TransmissSpeedCount? As Byte, ByVal Original_TransmissAutomatic As String, ByVal Original_MPG_City? As Byte, ByVal Original_MPG_Highway? As Byte, ByVal Original_Category As String, ByVal Original_Hyperlink As String, ByVal Original_Price? As Decimal) As Integer + If (Trademark Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(0).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(0).Value = (CStr(Trademark)) + End If + If (Model Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(1).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(1).Value = (CStr(Model)) + End If + If (HP.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(2).Value = (CShort(HP.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(2).Value = System.DBNull.Value + End If + If (Liter.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(3).Value = (CDbl(Liter.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(3).Value = System.DBNull.Value + End If + If (Cyl.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(4).Value = (CByte(Cyl.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(4).Value = System.DBNull.Value + End If + If (TransmissSpeedCount.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(5).Value = (CByte(TransmissSpeedCount.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(5).Value = System.DBNull.Value + End If + If (TransmissAutomatic Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(6).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(6).Value = (CStr(TransmissAutomatic)) + End If + If (MPG_City.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(7).Value = (CByte(MPG_City.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(7).Value = System.DBNull.Value + End If + If (MPG_Highway.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(8).Value = (CByte(MPG_Highway.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(8).Value = System.DBNull.Value + End If + If (Category Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(9).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(9).Value = (CStr(Category)) + End If + If (Description Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(10).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(10).Value = (CStr(Description)) + End If + If (Hyperlink Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(11).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(11).Value = (CStr(Hyperlink)) + End If + If (Picture Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(12).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(12).Value = (CType(Picture, Byte())) + End If + If (Price.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(13).Value = (CDec(Price.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(13).Value = System.DBNull.Value + End If + If (RtfContent Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(14).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(14).Value = (CStr(RtfContent)) + End If + Me.Adapter.UpdateCommand.Parameters(15).Value = (CInt(Original_ID)) + If (Original_Trademark Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(17).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(17).Value = (CStr(Original_Trademark)) + End If + If (Original_Model Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(19).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(19).Value = (CStr(Original_Model)) + End If + If (Original_HP.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(21).Value = (CShort(Original_HP.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(21).Value = System.DBNull.Value + End If + If (Original_Liter.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(23).Value = (CDbl(Original_Liter.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(23).Value = System.DBNull.Value + End If + If (Original_Cyl.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(25).Value = (CByte(Original_Cyl.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(25).Value = System.DBNull.Value + End If + If (Original_TransmissSpeedCount.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(27).Value = (CByte(Original_TransmissSpeedCount.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(27).Value = System.DBNull.Value + End If + If (Original_TransmissAutomatic Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(29).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(29).Value = (CStr(Original_TransmissAutomatic)) + End If + If (Original_MPG_City.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(31).Value = (CByte(Original_MPG_City.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(31).Value = System.DBNull.Value + End If + If (Original_MPG_Highway.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(33).Value = (CByte(Original_MPG_Highway.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(33).Value = System.DBNull.Value + End If + If (Original_Category Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(35).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(35).Value = (CStr(Original_Category)) + End If + If (Original_Hyperlink Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(37).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(37).Value = (CStr(Original_Hyperlink)) + End If + If (Original_Price.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(38).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(39).Value = (CDec(Original_Price.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(38).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(39).Value = System.DBNull.Value + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State + If ((Me.Adapter.UpdateCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.UpdateCommand.Connection.Close() + End If + End Try + End Function + End Class + + ''' + '''Represents the connection and commands used to retrieve and save data. + ''' + + + + + + Partial Public Class CarSchedulingTableAdapter + Inherits System.ComponentModel.Component + + Private _adapter As System.Data.OleDb.OleDbDataAdapter + + Private _connection As System.Data.OleDb.OleDbConnection + + Private _commandCollection() As System.Data.OleDb.OleDbCommand + + Private _clearBeforeFill As Boolean + + + + Public Sub New() + Me.ClearBeforeFill = True + End Sub + + + + Public ReadOnly Property Adapter() As System.Data.OleDb.OleDbDataAdapter + Get + If (Me._adapter Is Nothing) Then + Me.InitAdapter() + End If + Return Me._adapter + End Get + End Property + + + + Friend Property Connection() As System.Data.OleDb.OleDbConnection + Get + If (Me._connection Is Nothing) Then + Me.InitConnection() + End If + Return Me._connection + End Get + Set(ByVal value As System.Data.OleDb.OleDbConnection) + Me._connection = value + If (Me.Adapter.InsertCommand IsNot Nothing) Then + Me.Adapter.InsertCommand.Connection = value + End If + If (Me.Adapter.DeleteCommand IsNot Nothing) Then + Me.Adapter.DeleteCommand.Connection = value + End If + If (Me.Adapter.UpdateCommand IsNot Nothing) Then + Me.Adapter.UpdateCommand.Connection = value + End If + Dim i As Integer = 0 + Do While (i < Me.CommandCollection.Length) + If (Me.CommandCollection(i) IsNot Nothing) Then + CType(Me.CommandCollection(i), System.Data.OleDb.OleDbCommand).Connection = value + End If + i = (i + 1) + Loop + End Set + End Property + + + + Protected ReadOnly Property CommandCollection() As System.Data.OleDb.OleDbCommand() + Get + If (Me._commandCollection Is Nothing) Then + Me.InitCommandCollection() + End If + Return Me._commandCollection + End Get + End Property + + + + Public Property ClearBeforeFill() As Boolean + Get + Return Me._clearBeforeFill + End Get + Set(ByVal value As Boolean) + Me._clearBeforeFill = value + End Set + End Property + + + + Private Sub InitAdapter() + Me._adapter = New System.Data.OleDb.OleDbDataAdapter() + Dim tableMapping As New System.Data.Common.DataTableMapping() + tableMapping.SourceTable = "Table" + tableMapping.DataSetTable = "CarScheduling" + tableMapping.ColumnMappings.Add("ID", "ID") + tableMapping.ColumnMappings.Add("CarId", "CarId") + tableMapping.ColumnMappings.Add("UserId", "UserId") + tableMapping.ColumnMappings.Add("Status", "Status") + tableMapping.ColumnMappings.Add("Subject", "Subject") + tableMapping.ColumnMappings.Add("Description", "Description") + tableMapping.ColumnMappings.Add("Label", "Label") + tableMapping.ColumnMappings.Add("StartTime", "StartTime") + tableMapping.ColumnMappings.Add("EndTime", "EndTime") + tableMapping.ColumnMappings.Add("Location", "Location") + tableMapping.ColumnMappings.Add("AllDay", "AllDay") + tableMapping.ColumnMappings.Add("EventType", "EventType") + tableMapping.ColumnMappings.Add("RecurrenceInfo", "RecurrenceInfo") + tableMapping.ColumnMappings.Add("ReminderInfo", "ReminderInfo") + tableMapping.ColumnMappings.Add("Price", "Price") + tableMapping.ColumnMappings.Add("ContactInfo", "ContactInfo") + Me._adapter.TableMappings.Add(tableMapping) + Me._adapter.DeleteCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.DeleteCommand.Connection = Me.Connection + Me._adapter.DeleteCommand.CommandText = "DELETE FROM `CarScheduling` WHERE ((`ID` = ?) AND ((? = 1 AND `CarId` IS NULL) OR (`CarId` = ?)) AND ((? = 1 AND `UserId` IS NULL) OR (`UserId` = ?)) AND ((? = 1 AND `Status` IS NULL) OR (`Status` = ?)) AND ((? = 1 AND `Subject` IS NULL) OR (`Subject` = ?)) AND ((? = 1 AND `Label` IS NULL) OR (`Label` = ?)) AND ((? = 1 AND `StartTime` IS NULL) OR (`StartTime` = ?)) AND ((? = 1 AND `EndTime` IS NULL) OR (`EndTime` = ?)) AND ((? = 1 AND `Location` IS NULL) OR (`Location` = ?)) AND ((? = 1 AND `AllDay` IS NULL) OR (`AllDay` = ?)) AND ((? = 1 AND `EventType` IS NULL) OR (`EventType` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" + Me._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Subject", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Subject", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_StartTime", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StartTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_EndTime", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_EndTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Location", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Location", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_AllDay", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_AllDay", System.Data.OleDb.OleDbType.Boolean, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Price", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.InsertCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.InsertCommand.Connection = Me.Connection + Me._adapter.InsertCommand.CommandText = "INSERT INTO `CarScheduling` (`CarId`, `UserId`, `Status`, `Subject`, `Description`, `Label`, `StartTime`, `EndTime`, `Location`, `AllDay`, `EventType`, `RecurrenceInfo`, `ReminderInfo`, `Price`, `ContactInfo`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" + Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Subject", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("StartTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("EndTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Location", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("AllDay", System.Data.OleDb.OleDbType.Boolean, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecurrenceInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RecurrenceInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("ReminderInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ReminderInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("ContactInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ContactInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand = New System.Data.OleDb.OleDbCommand() + Me._adapter.UpdateCommand.Connection = Me.Connection + Me._adapter.UpdateCommand.CommandText = "UPDATE `CarScheduling` SET `CarId` = ?, `UserId` = ?, `Status` = ?, `Subject` = ?, `Description` = ?, `Label` = ?, `StartTime` = ?, `EndTime` = ?, `Location` = ?, `AllDay` = ?, `EventType` = ?, `RecurrenceInfo` = ?, `ReminderInfo` = ?, `Price` = ?, `ContactInfo` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `CarId` IS NULL) OR (`CarId` = ?)) AND ((? = 1 AND `UserId` IS NULL) OR (`UserId` = ?)) AND ((? = 1 AND `Status` IS NULL) OR (`Status` = ?)) AND ((? = 1 AND `Subject` IS NULL) OR (`Subject` = ?)) AND ((? = 1 AND `Label` IS NULL) OR (`Label` = ?)) AND ((? = 1 AND `StartTime` IS NULL) OR (`StartTime` = ?)) AND ((? = 1 AND `EndTime` IS NULL) OR (`EndTime` = ?)) AND ((? = 1 AND `Location` IS NULL) OR (`Location` = ?)) AND ((? = 1 AND `AllDay` IS NULL) OR (`AllDay` = ?)) AND ((? = 1 AND `EventType` IS NULL) OR (`EventType` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" + Me._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Subject", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Description", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("StartTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("EndTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Location", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("AllDay", System.Data.OleDb.OleDbType.Boolean, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("RecurrenceInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "RecurrenceInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("ReminderInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ReminderInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("ContactInfo", System.Data.OleDb.OleDbType.LongVarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ContactInfo", System.Data.DataRowVersion.Current, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "ID", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_CarId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "CarId", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_UserId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "UserId", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Status", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Status", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Subject", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Subject", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Subject", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Label", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Label", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_StartTime", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_StartTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "StartTime", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_EndTime", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_EndTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EndTime", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Location", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Location", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Location", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_AllDay", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_AllDay", System.Data.OleDb.OleDbType.Boolean, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "AllDay", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_EventType", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "EventType", System.Data.DataRowVersion.Original, False, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Price", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, True, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Price", System.Data.OleDb.OleDbType.Currency, 0, System.Data.ParameterDirection.Input, (CByte(0)), (CByte(0)), "Price", System.Data.DataRowVersion.Original, False, Nothing)) + End Sub + + + + Private Sub InitConnection() + Me._connection = New System.Data.OleDb.OleDbConnection() + Me._connection.ConnectionString = Global.SimpleCustomFields.Properties.Settings.Default.CarsDBConnectionString + End Sub + + + + Private Sub InitCommandCollection() + Me._commandCollection = New System.Data.OleDb.OleDbCommand(0){} + Me._commandCollection(0) = New System.Data.OleDb.OleDbCommand() + Me._commandCollection(0).Connection = Me.Connection + Me._commandCollection(0).CommandText = "SELECT ID, CarId, UserId, Status, Subject, Description, Label, StartTime, EndTime" & ", Location, AllDay, EventType, RecurrenceInfo, ReminderInfo, Price, ContactInfo" & " FROM CarScheduling" + Me._commandCollection(0).CommandType = System.Data.CommandType.Text + End Sub + + + + + + Public Overridable Function Fill(ByVal dataTable As CarsDBDataSet.CarSchedulingDataTable) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(0) + If (Me.ClearBeforeFill = True) Then + dataTable.Clear() + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + + + + + Public Overridable Function GetData() As CarsDBDataSet.CarSchedulingDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(0) + Dim dataTable As New CarsDBDataSet.CarSchedulingDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + + + + + Public Overridable Function Update(ByVal dataTable As CarsDBDataSet.CarSchedulingDataTable) As Integer + Return Me.Adapter.Update(dataTable) + End Function + + + + + Public Overridable Function Update(ByVal dataSet As CarsDBDataSet) As Integer + Return Me.Adapter.Update(dataSet, "CarScheduling") + End Function + + + + + Public Overridable Function Update(ByVal dataRow As System.Data.DataRow) As Integer + Return Me.Adapter.Update(New System.Data.DataRow() { dataRow}) + End Function + + + + + Public Overridable Function Update(ByVal dataRows() As System.Data.DataRow) As Integer + Return Me.Adapter.Update(dataRows) + End Function + + + + + + Public Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_CarId? As Integer, ByVal Original_UserId? As Integer, ByVal Original_Status? As Integer, ByVal Original_Subject As String, ByVal Original_Label? As Integer, ByVal Original_StartTime? As DateTime, ByVal Original_EndTime? As DateTime, ByVal Original_Location As String, ByVal Original_AllDay As Boolean, ByVal Original_EventType? As Integer, ByVal Original_Price? As Decimal) As Integer + Me.Adapter.DeleteCommand.Parameters(0).Value = (CInt(Original_ID)) + If (Original_CarId.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(2).Value = (CInt(Original_CarId.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(1).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(2).Value = System.DBNull.Value + End If + If (Original_UserId.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(4).Value = (CInt(Original_UserId.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(3).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(4).Value = System.DBNull.Value + End If + If (Original_Status.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(6).Value = (CInt(Original_Status.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(5).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(6).Value = System.DBNull.Value + End If + If (Original_Subject Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(8).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(7).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(8).Value = (CStr(Original_Subject)) + End If + If (Original_Label.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(10).Value = (CInt(Original_Label.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(9).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(10).Value = System.DBNull.Value + End If + If (Original_StartTime.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(12).Value = (CDate(Original_StartTime.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(11).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(12).Value = System.DBNull.Value + End If + If (Original_EndTime.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(14).Value = (CDate(Original_EndTime.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(13).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(14).Value = System.DBNull.Value + End If + If (Original_Location Is Nothing) Then + Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(16).Value = System.DBNull.Value + Else + Me.Adapter.DeleteCommand.Parameters(15).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(16).Value = (CStr(Original_Location)) + End If + Me.Adapter.DeleteCommand.Parameters(17).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(18).Value = (CBool(Original_AllDay)) + If (Original_EventType.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(20).Value = (CInt(Original_EventType.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(19).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(20).Value = System.DBNull.Value + End If + If (Original_Price.HasValue = True) Then + Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(0)) + Me.Adapter.DeleteCommand.Parameters(22).Value = (CDec(Original_Price.Value)) + Else + Me.Adapter.DeleteCommand.Parameters(21).Value = (CObj(1)) + Me.Adapter.DeleteCommand.Parameters(22).Value = System.DBNull.Value + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State + If ((Me.Adapter.DeleteCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.DeleteCommand.Connection.Close() + End If + End Try + End Function + + + + + + Public Overridable Function Insert(ByVal CarId? As Integer, ByVal UserId? As Integer, ByVal Status? As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label? As Integer, ByVal StartTime? As DateTime, ByVal EndTime? As DateTime, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType? As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price? As Decimal, ByVal ContactInfo As String) As Integer + If (CarId.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(0).Value = (CInt(CarId.Value)) + Else + Me.Adapter.InsertCommand.Parameters(0).Value = System.DBNull.Value + End If + If (UserId.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(1).Value = (CInt(UserId.Value)) + Else + Me.Adapter.InsertCommand.Parameters(1).Value = System.DBNull.Value + End If + If (Status.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(2).Value = (CInt(Status.Value)) + Else + Me.Adapter.InsertCommand.Parameters(2).Value = System.DBNull.Value + End If + If (Subject Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(3).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(3).Value = (CStr(Subject)) + End If + If (Description Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(4).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(4).Value = (CStr(Description)) + End If + If (Label.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(5).Value = (CInt(Label.Value)) + Else + Me.Adapter.InsertCommand.Parameters(5).Value = System.DBNull.Value + End If + If (StartTime.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(6).Value = (CDate(StartTime.Value)) + Else + Me.Adapter.InsertCommand.Parameters(6).Value = System.DBNull.Value + End If + If (EndTime.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(7).Value = (CDate(EndTime.Value)) + Else + Me.Adapter.InsertCommand.Parameters(7).Value = System.DBNull.Value + End If + If (Location Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(8).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(8).Value = (CStr(Location)) + End If + Me.Adapter.InsertCommand.Parameters(9).Value = (CBool(AllDay)) + If (EventType.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(10).Value = (CInt(EventType.Value)) + Else + Me.Adapter.InsertCommand.Parameters(10).Value = System.DBNull.Value + End If + If (RecurrenceInfo Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(11).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(11).Value = (CStr(RecurrenceInfo)) + End If + If (ReminderInfo Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(12).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(12).Value = (CStr(ReminderInfo)) + End If + If (Price.HasValue = True) Then + Me.Adapter.InsertCommand.Parameters(13).Value = (CDec(Price.Value)) + Else + Me.Adapter.InsertCommand.Parameters(13).Value = System.DBNull.Value + End If + If (ContactInfo Is Nothing) Then + Me.Adapter.InsertCommand.Parameters(14).Value = System.DBNull.Value + Else + Me.Adapter.InsertCommand.Parameters(14).Value = (CStr(ContactInfo)) + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State + If ((Me.Adapter.InsertCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.InsertCommand.Connection.Close() + End If + End Try + End Function + + + + + + Public Overridable Function Update(ByVal CarId? As Integer, ByVal UserId? As Integer, ByVal Status? As Integer, ByVal Subject As String, ByVal Description As String, ByVal Label? As Integer, ByVal StartTime? As DateTime, ByVal EndTime? As DateTime, ByVal Location As String, ByVal AllDay As Boolean, ByVal EventType? As Integer, ByVal RecurrenceInfo As String, ByVal ReminderInfo As String, ByVal Price? As Decimal, ByVal ContactInfo As String, ByVal Original_ID As Integer, ByVal Original_CarId? As Integer, ByVal Original_UserId? As Integer, ByVal Original_Status? As Integer, ByVal Original_Subject As String, ByVal Original_Label? As Integer, ByVal Original_StartTime? As DateTime, ByVal Original_EndTime? As DateTime, ByVal Original_Location As String, ByVal Original_AllDay As Boolean, ByVal Original_EventType? As Integer, ByVal Original_Price? As Decimal) As Integer + If (CarId.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(0).Value = (CInt(CarId.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(0).Value = System.DBNull.Value + End If + If (UserId.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(1).Value = (CInt(UserId.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(1).Value = System.DBNull.Value + End If + If (Status.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(2).Value = (CInt(Status.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(2).Value = System.DBNull.Value + End If + If (Subject Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(3).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(3).Value = (CStr(Subject)) + End If + If (Description Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(4).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(4).Value = (CStr(Description)) + End If + If (Label.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(5).Value = (CInt(Label.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(5).Value = System.DBNull.Value + End If + If (StartTime.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(6).Value = (CDate(StartTime.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(6).Value = System.DBNull.Value + End If + If (EndTime.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(7).Value = (CDate(EndTime.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(7).Value = System.DBNull.Value + End If + If (Location Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(8).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(8).Value = (CStr(Location)) + End If + Me.Adapter.UpdateCommand.Parameters(9).Value = (CBool(AllDay)) + If (EventType.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(10).Value = (CInt(EventType.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(10).Value = System.DBNull.Value + End If + If (RecurrenceInfo Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(11).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(11).Value = (CStr(RecurrenceInfo)) + End If + If (ReminderInfo Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(12).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(12).Value = (CStr(ReminderInfo)) + End If + If (Price.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(13).Value = (CDec(Price.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(13).Value = System.DBNull.Value + End If + If (ContactInfo Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(14).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(14).Value = (CStr(ContactInfo)) + End If + Me.Adapter.UpdateCommand.Parameters(15).Value = (CInt(Original_ID)) + If (Original_CarId.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(17).Value = (CInt(Original_CarId.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(16).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(17).Value = System.DBNull.Value + End If + If (Original_UserId.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(19).Value = (CInt(Original_UserId.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(18).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(19).Value = System.DBNull.Value + End If + If (Original_Status.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(21).Value = (CInt(Original_Status.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(20).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(21).Value = System.DBNull.Value + End If + If (Original_Subject Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(23).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(22).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(23).Value = (CStr(Original_Subject)) + End If + If (Original_Label.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(25).Value = (CInt(Original_Label.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(24).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(25).Value = System.DBNull.Value + End If + If (Original_StartTime.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(27).Value = (CDate(Original_StartTime.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(26).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(27).Value = System.DBNull.Value + End If + If (Original_EndTime.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(29).Value = (CDate(Original_EndTime.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(28).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(29).Value = System.DBNull.Value + End If + If (Original_Location Is Nothing) Then + Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(31).Value = System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(30).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(31).Value = (CStr(Original_Location)) + End If + Me.Adapter.UpdateCommand.Parameters(32).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(33).Value = (CBool(Original_AllDay)) + If (Original_EventType.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(35).Value = (CInt(Original_EventType.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(34).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(35).Value = System.DBNull.Value + End If + If (Original_Price.HasValue = True) Then + Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(0)) + Me.Adapter.UpdateCommand.Parameters(37).Value = (CDec(Original_Price.Value)) + Else + Me.Adapter.UpdateCommand.Parameters(36).Value = (CObj(1)) + Me.Adapter.UpdateCommand.Parameters(37).Value = System.DBNull.Value + End If + Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State + If ((Me.Adapter.UpdateCommand.Connection.State And System.Data.ConnectionState.Open) <> 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 = System.Data.ConnectionState.Closed) Then + Me.Adapter.UpdateCommand.Connection.Close() + End If + End Try + End Function + End Class End Namespace +#Enable Warning BC1591 \ No newline at end of file diff --git a/VB/SimpleCustomFields/Form1.Designer.vb b/VB/SimpleCustomFields/Form1.Designer.vb index 8b3a101..dfdada1 100644 --- a/VB/SimpleCustomFields/Form1.Designer.vb +++ b/VB/SimpleCustomFields/Form1.Designer.vb @@ -1,149 +1,155 @@ Namespace SimpleCustomFields - Partial Public Class Form1 - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing + Partial Public Class Form1 + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (components IsNot Nothing) Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - #Region "Windows Form Designer generated code" + #Region "Windows Form Designer generated code" - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Dim timeRuler1 As New DevExpress.XtraScheduler.TimeRuler() - Dim timeRuler2 As New DevExpress.XtraScheduler.TimeRuler() - Me.schedulerControl1 = New DevExpress.XtraScheduler.SchedulerControl() - Me.schedulerDataStorage1 = New DevExpress.XtraScheduler.SchedulerDataStorage(Me.components) - Me.carSchedulingBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.carsDBDataSet_Renamed = New CarsDBDataSet() - Me.carsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.dateNavigator1 = New DevExpress.XtraScheduler.DateNavigator() - Me.carSchedulingTableAdapter = New CarsDBDataSetTableAdapters.CarSchedulingTableAdapter() - Me.carsTableAdapter = New CarsDBDataSetTableAdapters.CarsTableAdapter() - CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.schedulerDataStorage1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.carSchedulingBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.carsDBDataSet_Renamed, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.carsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.dateNavigator1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.dateNavigator1.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - ' schedulerControl1 - ' - Me.schedulerControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.schedulerControl1.Location = New System.Drawing.Point(0, 0) - Me.schedulerControl1.Name = "schedulerControl1" - Me.schedulerControl1.Size = New System.Drawing.Size(699, 561) - Me.schedulerControl1.Start = New Date(2010, 7, 1, 0, 0, 0, 0) - Me.schedulerControl1.DataStorage = Me.schedulerDataStorage1 - Me.schedulerControl1.TabIndex = 0 - Me.schedulerControl1.Text = "schedulerControl1" - Me.schedulerControl1.Views.DayView.TimeRulers.Add(timeRuler1) - Me.schedulerControl1.Views.WorkWeekView.TimeRulers.Add(timeRuler2) - ' - ' schedulerStorage1 - ' - Me.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(New DevExpress.XtraScheduler.AppointmentCustomFieldMapping("Amount", "Price")) - Me.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(New DevExpress.XtraScheduler.AppointmentCustomFieldMapping("ContactInfo", "ContactInfo")) - Me.schedulerDataStorage1.Appointments.DataSource = Me.carSchedulingBindingSource - Me.schedulerDataStorage1.Appointments.Mappings.AllDay = "AllDay" - Me.schedulerDataStorage1.Appointments.Mappings.Description = "Description" - Me.schedulerDataStorage1.Appointments.Mappings.End = "EndTime" - Me.schedulerDataStorage1.Appointments.Mappings.Label = "Label" - Me.schedulerDataStorage1.Appointments.Mappings.Location = "Location" - Me.schedulerDataStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo" - Me.schedulerDataStorage1.Appointments.Mappings.ReminderInfo = "ReminderInfo" - Me.schedulerDataStorage1.Appointments.Mappings.ResourceId = "CarId" - Me.schedulerDataStorage1.Appointments.Mappings.Start = "StartTime" - Me.schedulerDataStorage1.Appointments.Mappings.Status = "Status" - Me.schedulerDataStorage1.Appointments.Mappings.Subject = "Subject" - Me.schedulerDataStorage1.Appointments.Mappings.Type = "EventType" - Me.schedulerDataStorage1.Resources.DataSource = Me.carsBindingSource - Me.schedulerDataStorage1.Resources.Mappings.Caption = "Trademark" - Me.schedulerDataStorage1.Resources.Mappings.Id = "ID" - Me.schedulerDataStorage1.Resources.Mappings.Image = "Picture" - ' - ' carSchedulingBindingSource - ' - Me.carSchedulingBindingSource.DataMember = "CarScheduling" - Me.carSchedulingBindingSource.DataSource = Me.carsDBDataSet_Renamed - ' - ' carsDBDataSet - ' - Me.carsDBDataSet_Renamed.DataSetName = "CarsDBDataSet" - Me.carsDBDataSet_Renamed.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - ' carsBindingSource - ' - Me.carsBindingSource.DataMember = "Cars" - Me.carsBindingSource.DataSource = Me.carsDBDataSet_Renamed - ' - ' dateNavigator1 - ' - Me.dateNavigator1.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.dateNavigator1.Dock = System.Windows.Forms.DockStyle.Right - Me.dateNavigator1.FirstDayOfWeek = System.DayOfWeek.Sunday - Me.dateNavigator1.Location = New System.Drawing.Point(699, 0) - Me.dateNavigator1.Name = "dateNavigator1" - Me.dateNavigator1.CellPadding = New System.Windows.Forms.Padding(2) - Me.dateNavigator1.SchedulerControl = Me.schedulerControl1 - Me.dateNavigator1.Size = New System.Drawing.Size(249, 561) - Me.dateNavigator1.TabIndex = 1 - ' - ' carSchedulingTableAdapter - ' - Me.carSchedulingTableAdapter.ClearBeforeFill = True - ' - ' carsTableAdapter - ' - Me.carsTableAdapter.ClearBeforeFill = True - ' - ' Form1 - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(948, 561) - Me.Controls.Add(Me.schedulerControl1) - Me.Controls.Add(Me.dateNavigator1) - Me.Name = "Form1" - Me.Text = "Custom Fields Example" - CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.schedulerDataStorage1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.carSchedulingBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.carsDBDataSet_Renamed, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.carsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.dateNavigator1.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.dateNavigator1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim timeRuler1 As New DevExpress.XtraScheduler.TimeRuler() + Dim timeRuler2 As New DevExpress.XtraScheduler.TimeRuler() + Me.schedulerControl1 = New DevExpress.XtraScheduler.SchedulerControl() + Me.schedulerDataStorage1 = New DevExpress.XtraScheduler.SchedulerDataStorage(Me.components) + Me.carSchedulingBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.carsDBDataSet_Conflict = New SimpleCustomFields.CarsDBDataSet() + Me.carsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.dateNavigator1 = New DevExpress.XtraScheduler.DateNavigator() + Me.carSchedulingTableAdapter = New SimpleCustomFields.CarsDBDataSetTableAdapters.CarSchedulingTableAdapter() + Me.carsTableAdapter = New SimpleCustomFields.CarsDBDataSetTableAdapters.CarsTableAdapter() + CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.schedulerDataStorage1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.carSchedulingBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.carsDBDataSet_Conflict, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.carsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dateNavigator1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dateNavigator1.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + ' schedulerControl1 + ' + Me.schedulerControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.schedulerControl1.Location = New System.Drawing.Point(0, 0) + Me.schedulerControl1.Name = "schedulerControl1" + Me.schedulerControl1.Size = New System.Drawing.Size(699, 561) + Me.schedulerControl1.Start = New DateTime(2010, 7, 1, 0, 0, 0, 0) + Me.schedulerControl1.DataStorage = Me.schedulerDataStorage1 + Me.schedulerControl1.TabIndex = 0 + Me.schedulerControl1.Text = "schedulerControl1" + Me.schedulerControl1.Views.DayView.TimeRulers.Add(timeRuler1) + Me.schedulerControl1.Views.WorkWeekView.TimeRulers.Add(timeRuler2) +'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: +'ORIGINAL LINE: this.schedulerControl1.InitNewAppointment += new DevExpress.XtraScheduler.AppointmentEventHandler(this.schedulerControl1_InitNewAppointment); +'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: +'ORIGINAL LINE: this.schedulerControl1.EditAppointmentFormShowing += new DevExpress.XtraScheduler.AppointmentFormEventHandler(this.schedulerControl1_EditAppointmentFormShowing); + ' + ' schedulerStorage1 + ' + Me.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(New DevExpress.XtraScheduler.AppointmentCustomFieldMapping("Amount", "Price")) + Me.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(New DevExpress.XtraScheduler.AppointmentCustomFieldMapping("ContactInfo", "ContactInfo")) + Me.schedulerDataStorage1.Appointments.DataSource = Me.carSchedulingBindingSource + Me.schedulerDataStorage1.Appointments.Mappings.AllDay = "AllDay" + Me.schedulerDataStorage1.Appointments.Mappings.Description = "Description" + Me.schedulerDataStorage1.Appointments.Mappings.End = "EndTime" + Me.schedulerDataStorage1.Appointments.Mappings.Label = "Label" + Me.schedulerDataStorage1.Appointments.Mappings.Location = "Location" + Me.schedulerDataStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo" + Me.schedulerDataStorage1.Appointments.Mappings.ReminderInfo = "ReminderInfo" + Me.schedulerDataStorage1.Appointments.Mappings.ResourceId = "CarId" + Me.schedulerDataStorage1.Appointments.Mappings.Start = "StartTime" + Me.schedulerDataStorage1.Appointments.Mappings.Status = "Status" + Me.schedulerDataStorage1.Appointments.Mappings.Subject = "Subject" + Me.schedulerDataStorage1.Appointments.Mappings.Type = "EventType" + Me.schedulerDataStorage1.Resources.DataSource = Me.carsBindingSource + Me.schedulerDataStorage1.Resources.Mappings.Caption = "Trademark" + Me.schedulerDataStorage1.Resources.Mappings.Id = "ID" + Me.schedulerDataStorage1.Resources.Mappings.Image = "Picture" + ' + ' carSchedulingBindingSource + ' + Me.carSchedulingBindingSource.DataMember = "CarScheduling" + Me.carSchedulingBindingSource.DataSource = Me.carsDBDataSet_Conflict + ' + ' carsDBDataSet + ' + Me.carsDBDataSet_Conflict.DataSetName = "CarsDBDataSet" + Me.carsDBDataSet_Conflict.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + ' carsBindingSource + ' + Me.carsBindingSource.DataMember = "Cars" + Me.carsBindingSource.DataSource = Me.carsDBDataSet_Conflict + ' + ' dateNavigator1 + ' + Me.dateNavigator1.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.dateNavigator1.Dock = System.Windows.Forms.DockStyle.Right + Me.dateNavigator1.FirstDayOfWeek = System.DayOfWeek.Sunday + Me.dateNavigator1.Location = New System.Drawing.Point(699, 0) + Me.dateNavigator1.Name = "dateNavigator1" + Me.dateNavigator1.CellPadding = New System.Windows.Forms.Padding(2) + Me.dateNavigator1.SchedulerControl = Me.schedulerControl1 + Me.dateNavigator1.Size = New System.Drawing.Size(249, 561) + Me.dateNavigator1.TabIndex = 1 + ' + ' carSchedulingTableAdapter + ' + Me.carSchedulingTableAdapter.ClearBeforeFill = True + ' + ' carsTableAdapter + ' + Me.carsTableAdapter.ClearBeforeFill = True + ' + ' Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(948, 561) + Me.Controls.Add(Me.schedulerControl1) + Me.Controls.Add(Me.dateNavigator1) + Me.Name = "Form1" + Me.Text = "Custom Fields Example" +'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: +'ORIGINAL LINE: this.Load += new System.EventHandler(this.Form1_Load); + CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.schedulerDataStorage1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.carSchedulingBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.carsDBDataSet_Conflict, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.carsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dateNavigator1.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dateNavigator1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) - End Sub + End Sub -#End Region + #End Region - Private WithEvents schedulerControl1 As DevExpress.XtraScheduler.SchedulerControl - Private schedulerDataStorage1 As DevExpress.XtraScheduler.SchedulerDataStorage - Private dateNavigator1 As DevExpress.XtraScheduler.DateNavigator - - Private carsDBDataSet_Renamed As CarsDBDataSet - Private carSchedulingBindingSource As System.Windows.Forms.BindingSource - Private carSchedulingTableAdapter As CarsDBDataSetTableAdapters.CarSchedulingTableAdapter - Private carsBindingSource As System.Windows.Forms.BindingSource - Private carsTableAdapter As CarsDBDataSetTableAdapters.CarsTableAdapter - End Class + Private WithEvents schedulerControl1 As DevExpress.XtraScheduler.SchedulerControl + Private schedulerDataStorage1 As DevExpress.XtraScheduler.SchedulerDataStorage + Private dateNavigator1 As DevExpress.XtraScheduler.DateNavigator +'INSTANT VB NOTE: The variable carsDBDataSet was renamed since it may cause conflicts with calls to static members of the user-defined type with this name: + Private carsDBDataSet_Conflict As CarsDBDataSet + Private carSchedulingBindingSource As System.Windows.Forms.BindingSource + Private carSchedulingTableAdapter As SimpleCustomFields.CarsDBDataSetTableAdapters.CarSchedulingTableAdapter + Private carsBindingSource As System.Windows.Forms.BindingSource + Private carsTableAdapter As SimpleCustomFields.CarsDBDataSetTableAdapters.CarsTableAdapter + End Class End Namespace diff --git a/VB/SimpleCustomFields/Form1.vb b/VB/SimpleCustomFields/Form1.vb index 2d5a1b6..d8092c2 100644 --- a/VB/SimpleCustomFields/Form1.vb +++ b/VB/SimpleCustomFields/Form1.vb @@ -11,80 +11,80 @@ Imports DevExpress.XtraScheduler #End Region ' #usings Namespace SimpleCustomFields - Partial Public Class Form1 - Inherits Form + Partial Public Class Form1 + Inherits Form - Public Sub New() - InitializeComponent() + Public Sub New() + InitializeComponent() - AddHandler schedulerDataStorage1.AppointmentInserting, AddressOf SchedulerStorage1_AppointmentInserting - AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted - AddHandler schedulerDataStorage1.AppointmentChanging, AddressOf SchedulerStorage1_AppointmentChanging - AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted - AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted + AddHandler schedulerDataStorage1.AppointmentInserting, AddressOf SchedulerStorage1_AppointmentInserting + AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted + AddHandler schedulerDataStorage1.AppointmentChanging, AddressOf SchedulerStorage1_AppointmentChanging + AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted + AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted - Me.schedulerControl1.Start = New Date(2010, 7, 1) - End Sub + Me.schedulerControl1.Start = New DateTime(2010, 07, 01) + End Sub - Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - ' TODO: This line of code loads data into the 'carsDBDataSet.Cars' table. You can move, or remove it, as needed. - Me.carsTableAdapter.Fill(Me.carsDBDataSet_Renamed.Cars) - ' TODO: This line of code loads data into the 'carsDBDataSet.CarScheduling' table. You can move, or remove it, as needed. - Me.carSchedulingTableAdapter.Fill(Me.carsDBDataSet_Renamed.CarScheduling) - AddHandler carSchedulingTableAdapter.Adapter.RowUpdated, AddressOf carSchedulingTableAdapter_RowUpdated + Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load + ' TODO: This line of code loads data into the 'carsDBDataSet.Cars' table. You can move, or remove it, as needed. + Me.carsTableAdapter.Fill(Me.carsDBDataSet_Conflict.Cars) + ' TODO: This line of code loads data into the 'carsDBDataSet.CarScheduling' table. You can move, or remove it, as needed. + Me.carSchedulingTableAdapter.Fill(Me.carsDBDataSet_Conflict.CarScheduling) + AddHandler carSchedulingTableAdapter.Adapter.RowUpdated, AddressOf carSchedulingTableAdapter_RowUpdated - End Sub + End Sub - Private Sub OnApptChangedInsertedDeleted(ByVal sender As Object, ByVal e As PersistentObjectsEventArgs) - carSchedulingTableAdapter.Update(carsDBDataSet_Renamed) - carsDBDataSet_Renamed.AcceptChanges() - End Sub + Private Sub OnApptChangedInsertedDeleted(ByVal sender As Object, ByVal e As PersistentObjectsEventArgs) + carSchedulingTableAdapter.Update(carsDBDataSet_Conflict) + carsDBDataSet_Conflict.AcceptChanges() + End Sub - Private Sub carSchedulingTableAdapter_RowUpdated(ByVal sender As Object, ByVal e As OleDbRowUpdatedEventArgs) - If e.Status = UpdateStatus.Continue AndAlso e.StatementType = StatementType.Insert Then - Dim id As Integer = 0 - Using cmd As New OleDbCommand("SELECT @@IDENTITY", carSchedulingTableAdapter.Connection) - id = DirectCast(cmd.ExecuteScalar(), Integer) - End Using - e.Row("ID") = id - End If - End Sub -#Region "#EditAppointmentFormShowing" - Private Sub schedulerControl1_EditAppointmentFormShowing(ByVal sender As Object, ByVal e As AppointmentFormEventArgs) Handles schedulerControl1.EditAppointmentFormShowing - Dim form As New MyAppointmentForm(TryCast(sender, SchedulerControl), e.Appointment, e.OpenRecurrenceForm) - Try - e.DialogResult = form.ShowDialog() - e.Handled = True - Finally - form.Dispose() - End Try - End Sub -#End Region ' #EditAppointmentFormShowing + Private Sub carSchedulingTableAdapter_RowUpdated(ByVal sender As Object, ByVal e As OleDbRowUpdatedEventArgs) + If e.Status = UpdateStatus.Continue AndAlso e.StatementType = StatementType.Insert Then + Dim id As Integer = 0 + Using cmd As New OleDbCommand("SELECT @@IDENTITY", carSchedulingTableAdapter.Connection) + id = DirectCast(cmd.ExecuteScalar(), Integer) + End Using + e.Row("ID") = id + End If + End Sub + #Region "#EditAppointmentFormShowing" + Private Sub schedulerControl1_EditAppointmentFormShowing(ByVal sender As Object, ByVal e As AppointmentFormEventArgs) Handles schedulerControl1.EditAppointmentFormShowing + Dim form As New MyAppointmentForm(TryCast(sender, SchedulerControl), e.Appointment, e.OpenRecurrenceForm) + Try + e.DialogResult = form.ShowDialog() + e.Handled = True + Finally + form.Dispose() + End Try + End Sub + #End Region ' #EditAppointmentFormShowing -#Region "#InitNewAppointment" - Private Sub schedulerControl1_InitNewAppointment(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentEventArgs) Handles schedulerControl1.InitNewAppointment - e.Appointment.Description &= "Created at runtime at " & String.Format("{0:g}", Date.Now) - e.Appointment.CustomFields("Amount") = 0.01R - e.Appointment.CustomFields("ContactInfo") = "someone@somecompany.com" - End Sub -#End Region ' #InitNewAppointment -#Region "#AppointmentInserting" - Private Sub SchedulerStorage1_AppointmentInserting(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs) - If CType(e.Object, Appointment).Start < Date.Now Then - e.Cancel = True - End If - End Sub -#End Region ' #AppointmentInserting -#Region "#AppointmentChanging" - Private Sub SchedulerStorage1_AppointmentChanging(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs) - If CType(e, DevExpress.XtraScheduler.AdvPersistentObjectCancelEventArgs).PropertyName = "StatusKey" Then - Return - End If - Dim busyKey As Object = schedulerDataStorage1.Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id - If CType(e.Object, Appointment).StatusKey.Equals(busyKey) Then - e.Cancel = True - End If - End Sub -#End Region ' #AppointmentChanging - End Class + #Region "#InitNewAppointment" + Private Sub schedulerControl1_InitNewAppointment(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentEventArgs) Handles schedulerControl1.InitNewAppointment + e.Appointment.Description &= "Created at runtime at " & String.Format("{0:g}", DateTime.Now) + e.Appointment.CustomFields("Amount") = 00.01R + e.Appointment.CustomFields("ContactInfo") = "someone@somecompany.com" + End Sub + #End Region ' #InitNewAppointment + #Region "#AppointmentInserting" + Private Sub SchedulerStorage1_AppointmentInserting(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs) + If CType(e.Object, Appointment).Start < DateTime.Now Then + e.Cancel = True + End If + End Sub + #End Region ' #AppointmentInserting + #Region "#AppointmentChanging" + Private Sub SchedulerStorage1_AppointmentChanging(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs) + If CType(e, DevExpress.XtraScheduler.AdvPersistentObjectCancelEventArgs).PropertyName = "StatusKey" Then + Return + End If + Dim busyKey As Object = schedulerDataStorage1.Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id + If CType(e.Object, Appointment).StatusKey.Equals(busyKey) Then + e.Cancel = True + End If + End Sub + #End Region ' #AppointmentChanging + End Class End Namespace \ No newline at end of file diff --git a/VB/SimpleCustomFields/My Project/Resources.Designer.vb b/VB/SimpleCustomFields/My Project/Resources.Designer.vb index 00e4632..e5a9d01 100644 --- a/VB/SimpleCustomFields/My Project/Resources.Designer.vb +++ b/VB/SimpleCustomFields/My Project/Resources.Designer.vb @@ -13,51 +13,53 @@ Namespace My.Resources - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - ' This class was auto-generated by the StronglyTypedResourceBuilder - ' class via a tool like ResGen or Visual Studio. - ' To add or remove a member, edit your .ResX file then rerun ResGen - ' with the /str option, or rebuild your VS project. - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - -' internal Resources() -' { -' } - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As New Global.System.Resources.ResourceManager("Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + ' This class was auto-generated by the StronglyTypedResourceBuilder + ' class via a tool like ResGen or Visual Studio. + ' To add or remove a member, edit your .ResX file then rerun ResGen + ' with the /str option, or rebuild your VS project. + + + + Friend Module Resources + + Private resourceMan As System.Resources.ResourceManager + + Private resourceCulture As System.Globalization.CultureInfo + +' internal Resources() +' { +' } + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + + Friend ReadOnly Property ResourceManager() As System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As New System.Resources.ResourceManager("Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + + Friend Property Culture() As System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module End Namespace diff --git a/VB/SimpleCustomFields/My Project/Settings.Designer.vb b/VB/SimpleCustomFields/My Project/Settings.Designer.vb index 466202c..b4819e0 100644 --- a/VB/SimpleCustomFields/My Project/Settings.Designer.vb +++ b/VB/SimpleCustomFields/My Project/Settings.Designer.vb @@ -11,23 +11,27 @@ Namespace My - _ - Friend NotInheritable Partial Class Settings - Inherits System.Configuration.ApplicationSettingsBase + + + Friend NotInheritable Partial Class Settings + Inherits System.Configuration.ApplicationSettingsBase - Private Shared defaultInstance As Settings = (CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings)) + Private Shared defaultInstance As Settings = (CType(System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings)) - Public Shared ReadOnly Property [Default]() As Settings - Get - Return defaultInstance - End Get - End Property + Public Shared ReadOnly Property [Default]() As Settings + Get + Return defaultInstance + End Get + End Property - _ - Public ReadOnly Property CarsDBConnectionString() As String - Get - Return (DirectCast(Me("CarsDBConnectionString"), String)) - End Get - End Property - End Class + + + + + Public ReadOnly Property CarsDBConnectionString() As String + Get + Return (DirectCast(Me("CarsDBConnectionString"), String)) + End Get + End Property + End Class End Namespace diff --git a/VB/SimpleCustomFields/MyAppointmentForm.Designer.vb b/VB/SimpleCustomFields/MyAppointmentForm.Designer.vb index 552d7e3..d848ac7 100644 --- a/VB/SimpleCustomFields/MyAppointmentForm.Designer.vb +++ b/VB/SimpleCustomFields/MyAppointmentForm.Designer.vb @@ -1,295 +1,299 @@ Namespace SimpleCustomFields - Partial Public Class MyAppointmentForm - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing + Partial Public Class MyAppointmentForm + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (components IsNot Nothing) Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - #Region "Windows Form Designer generated code" + #Region "Windows Form Designer generated code" - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - Me.lblAmount = New DevExpress.XtraEditors.LabelControl() - Me.calcAmount = New DevExpress.XtraEditors.CalcEdit() - Me.mruEdit1 = New DevExpress.XtraEditors.MRUEdit() - Me.tbContact = New DevExpress.XtraEditors.MemoEdit() - Me.lblContactInfo = New DevExpress.XtraEditors.LabelControl() - Me.carsDBDataSet_Renamed = New CarsDBDataSet() - CType(Me.chkAllDay.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtStartDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtStartDate.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtEndDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtEndDate.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtStartTime.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtEndTime.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtLabel.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtShowTimeAs.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.tbSubject.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtResource.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtResources.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.edtResources.ResourcesCheckedListBoxControl, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.chkReminder.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.tbDescription.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.cbReminder.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.tbLocation.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.panel1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.panel1.SuspendLayout() - Me.progressPanel.SuspendLayout() - CType(Me.tbProgress, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.tbProgress.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.calcAmount.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.mruEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.tbContact.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.carsDBDataSet_Renamed, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - ' lblLabel - ' - Me.lblLabel.Appearance.BackColor = System.Drawing.Color.Transparent - ' - ' chkAllDay - ' - ' - ' btnOk - ' - Me.btnOk.Location = New System.Drawing.Point(16, 354) - ' - ' btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(104, 354) - ' - ' btnDelete - ' - Me.btnDelete.Location = New System.Drawing.Point(192, 354) - ' - ' btnRecurrence - ' - Me.btnRecurrence.Location = New System.Drawing.Point(280, 354) - ' - ' edtStartDate - ' - Me.edtStartDate.EditValue = New Date(2005, 3, 31, 0, 0, 0, 0) - Me.edtStartDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton() _ - }) - Me.edtStartDate.Size = New System.Drawing.Size(126, 20) - ' - ' edtEndDate - ' - Me.edtEndDate.EditValue = New Date(2005, 3, 31, 0, 0, 0, 0) - Me.edtEndDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton(), _ - New DevExpress.XtraEditors.Controls.EditorButton() _ - }) - Me.edtEndDate.Size = New System.Drawing.Size(126, 20) - ' - ' edtStartTime - ' - Me.edtStartTime.EditValue = New Date(2005, 3, 31, 0, 0, 0, 0) - Me.edtStartTime.Location = New System.Drawing.Point(230, 79) - ' - ' edtEndTime - ' - Me.edtEndTime.EditValue = New Date(2005, 3, 31, 0, 0, 0, 0) - Me.edtEndTime.Location = New System.Drawing.Point(230, 103) - ' - ' edtLabel - ' - ' - ' edtShowTimeAs - ' - Me.edtShowTimeAs.Size = New System.Drawing.Size(222, 20) - ' - ' tbSubject - ' - Me.tbSubject.Size = New System.Drawing.Size(422, 20) - ' - ' edtResource - ' - ' - ' edtResources - ' - ' - ' - ' - Me.edtResources.ResourcesCheckedListBoxControl.CheckOnClick = True - Me.edtResources.ResourcesCheckedListBoxControl.Dock = System.Windows.Forms.DockStyle.Fill - Me.edtResources.ResourcesCheckedListBoxControl.Location = New System.Drawing.Point(0, 0) - Me.edtResources.ResourcesCheckedListBoxControl.Name = "" - Me.edtResources.ResourcesCheckedListBoxControl.Size = New System.Drawing.Size(200, 100) - Me.edtResources.ResourcesCheckedListBoxControl.TabIndex = 0 - ' - ' chkReminder - ' - ' - ' tbDescription - ' - Me.tbDescription.Location = New System.Drawing.Point(16, 280) - Me.tbDescription.Size = New System.Drawing.Size(496, 56) - ' - ' cbReminder - ' - ' - ' tbLocation - ' - Me.tbLocation.Size = New System.Drawing.Size(222, 20) - ' - ' tbProgress - ' - Me.tbProgress.Properties.LabelAppearance.Options.UseTextOptions = True - Me.tbProgress.Properties.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center - ' - ' lblPercentComplete - ' - Me.lblPercentComplete.Appearance.BackColor = System.Drawing.Color.Transparent - ' - ' lblPercentCompleteValue - ' - Me.lblPercentCompleteValue.Appearance.BackColor = System.Drawing.Color.Transparent - ' - ' lblAmount - ' - Me.lblAmount.Location = New System.Drawing.Point(16, 183) - Me.lblAmount.Name = "lblAmount" - Me.lblAmount.Size = New System.Drawing.Size(27, 13) - Me.lblAmount.TabIndex = 37 - Me.lblAmount.Text = "Amount:" - ' - ' calcAmount - ' - Me.calcAmount.Location = New System.Drawing.Point(96, 180) - Me.calcAmount.Name = "calcAmount" - Me.calcAmount.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.calcAmount.Size = New System.Drawing.Size(100, 20) - Me.calcAmount.TabIndex = 38 - ' - ' mruEdit1 - ' - Me.mruEdit1.Location = New System.Drawing.Point(352, 310) - Me.mruEdit1.Name = "mruEdit1" - Me.mruEdit1.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) - Me.mruEdit1.Size = New System.Drawing.Size(8, 20) - Me.mruEdit1.TabIndex = 39 - ' - ' tbContact - ' - Me.tbContact.Location = New System.Drawing.Point(330, 194) - Me.tbContact.Name = "tbContact" - Me.tbContact.Size = New System.Drawing.Size(182, 41) - Me.tbContact.TabIndex = 40 - ' - ' lblContactInfo - ' - Me.lblContactInfo.Location = New System.Drawing.Point(330, 174) - Me.lblContactInfo.Name = "lblContactInfo" - Me.lblContactInfo.Size = New System.Drawing.Size(65, 13) - Me.lblContactInfo.TabIndex = 41 - Me.lblContactInfo.Text = "Contact Info:" - ' - ' carsDBDataSet - ' - Me.carsDBDataSet_Renamed.DataSetName = "CarsDBDataSet" - Me.carsDBDataSet_Renamed.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - ' MyAppointmentForm - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(528, 382) - Me.Controls.Add(Me.mruEdit1) - Me.Controls.Add(Me.lblAmount) - Me.Controls.Add(Me.lblContactInfo) - Me.Controls.Add(Me.tbContact) - Me.Controls.Add(Me.calcAmount) - Me.MinimumSize = New System.Drawing.Size(506, 294) - Me.Name = "MyAppointmentForm" - Me.Text = "MyAppointmentForm" - Me.Controls.SetChildIndex(Me.calcAmount, 0) - Me.Controls.SetChildIndex(Me.tbContact, 0) - Me.Controls.SetChildIndex(Me.lblContactInfo, 0) - Me.Controls.SetChildIndex(Me.lblAmount, 0) - Me.Controls.SetChildIndex(Me.mruEdit1, 0) - Me.Controls.SetChildIndex(Me.edtShowTimeAs, 0) - Me.Controls.SetChildIndex(Me.edtEndTime, 0) - Me.Controls.SetChildIndex(Me.edtEndDate, 0) - Me.Controls.SetChildIndex(Me.btnRecurrence, 0) - Me.Controls.SetChildIndex(Me.btnDelete, 0) - Me.Controls.SetChildIndex(Me.btnCancel, 0) - Me.Controls.SetChildIndex(Me.lblShowTimeAs, 0) - Me.Controls.SetChildIndex(Me.lblEndTime, 0) - Me.Controls.SetChildIndex(Me.tbLocation, 0) - Me.Controls.SetChildIndex(Me.lblSubject, 0) - Me.Controls.SetChildIndex(Me.lblLocation, 0) - Me.Controls.SetChildIndex(Me.tbSubject, 0) - Me.Controls.SetChildIndex(Me.lblStartTime, 0) - Me.Controls.SetChildIndex(Me.btnOk, 0) - Me.Controls.SetChildIndex(Me.edtStartDate, 0) - Me.Controls.SetChildIndex(Me.edtStartTime, 0) - Me.Controls.SetChildIndex(Me.panel1, 0) - Me.Controls.SetChildIndex(Me.progressPanel, 0) - Me.Controls.SetChildIndex(Me.tbDescription, 0) - CType(Me.chkAllDay.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtStartDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtStartDate.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtEndDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtEndDate.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtStartTime.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtEndTime.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtLabel.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtShowTimeAs.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.tbSubject.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtResource.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtResources.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.edtResources.ResourcesCheckedListBoxControl, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.chkReminder.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.tbDescription.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.cbReminder.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.tbLocation.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.panel1, System.ComponentModel.ISupportInitialize).EndInit() - Me.panel1.ResumeLayout(False) - Me.panel1.PerformLayout() - Me.progressPanel.ResumeLayout(False) - Me.progressPanel.PerformLayout() - CType(Me.tbProgress.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.tbProgress, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.calcAmount.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.mruEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.tbContact.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.carsDBDataSet_Renamed, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Me.lblAmount = New DevExpress.XtraEditors.LabelControl() + Me.calcAmount = New DevExpress.XtraEditors.CalcEdit() + Me.mruEdit1 = New DevExpress.XtraEditors.MRUEdit() + Me.tbContact = New DevExpress.XtraEditors.MemoEdit() + Me.lblContactInfo = New DevExpress.XtraEditors.LabelControl() + Me.carsDBDataSet_Conflict = New SimpleCustomFields.CarsDBDataSet() + CType(Me.chkAllDay.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtStartDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtStartDate.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtEndDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtEndDate.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtStartTime.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtEndTime.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtLabel.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtShowTimeAs.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.tbSubject.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtResource.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtResources.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.edtResources.ResourcesCheckedListBoxControl, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.chkReminder.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.tbDescription.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.cbReminder.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.tbLocation.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.panel1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.panel1.SuspendLayout() + Me.progressPanel.SuspendLayout() + CType(Me.tbProgress, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.tbProgress.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.calcAmount.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.mruEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.tbContact.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.carsDBDataSet_Conflict, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + ' lblLabel + ' + Me.lblLabel.Appearance.BackColor = System.Drawing.Color.Transparent + ' + ' chkAllDay + ' + ' + ' btnOk + ' + Me.btnOk.Location = New System.Drawing.Point(16, 354) + ' + ' btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(104, 354) + ' + ' btnDelete + ' + Me.btnDelete.Location = New System.Drawing.Point(192, 354) + ' + ' btnRecurrence + ' + Me.btnRecurrence.Location = New System.Drawing.Point(280, 354) + ' + ' edtStartDate + ' + Me.edtStartDate.EditValue = New DateTime(2005, 3, 31, 0, 0, 0, 0) + Me.edtStartDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton() + }) + Me.edtStartDate.Size = New System.Drawing.Size(126, 20) + ' + ' edtEndDate + ' + Me.edtEndDate.EditValue = New DateTime(2005, 3, 31, 0, 0, 0, 0) + Me.edtEndDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton(), + New DevExpress.XtraEditors.Controls.EditorButton() + }) + Me.edtEndDate.Size = New System.Drawing.Size(126, 20) + ' + ' edtStartTime + ' + Me.edtStartTime.EditValue = New DateTime(2005, 3, 31, 0, 0, 0, 0) + Me.edtStartTime.Location = New System.Drawing.Point(230, 79) + ' + ' edtEndTime + ' + Me.edtEndTime.EditValue = New DateTime(2005, 3, 31, 0, 0, 0, 0) + Me.edtEndTime.Location = New System.Drawing.Point(230, 103) + ' + ' edtLabel + ' + ' + ' edtShowTimeAs + ' + Me.edtShowTimeAs.Size = New System.Drawing.Size(222, 20) + ' + ' tbSubject + ' + Me.tbSubject.Size = New System.Drawing.Size(422, 20) + ' + ' edtResource + ' + ' + ' edtResources + ' + ' + ' + ' + Me.edtResources.ResourcesCheckedListBoxControl.CheckOnClick = True + Me.edtResources.ResourcesCheckedListBoxControl.Dock = System.Windows.Forms.DockStyle.Fill + Me.edtResources.ResourcesCheckedListBoxControl.Location = New System.Drawing.Point(0, 0) + Me.edtResources.ResourcesCheckedListBoxControl.Name = "" + Me.edtResources.ResourcesCheckedListBoxControl.Size = New System.Drawing.Size(200, 100) + Me.edtResources.ResourcesCheckedListBoxControl.TabIndex = 0 + ' + ' chkReminder + ' + ' + ' tbDescription + ' + Me.tbDescription.Location = New System.Drawing.Point(16, 280) + Me.tbDescription.Size = New System.Drawing.Size(496, 56) + ' + ' cbReminder + ' + ' + ' tbLocation + ' + Me.tbLocation.Size = New System.Drawing.Size(222, 20) + ' + ' tbProgress + ' + Me.tbProgress.Properties.LabelAppearance.Options.UseTextOptions = True + Me.tbProgress.Properties.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center + ' + ' lblPercentComplete + ' + Me.lblPercentComplete.Appearance.BackColor = System.Drawing.Color.Transparent + ' + ' lblPercentCompleteValue + ' + Me.lblPercentCompleteValue.Appearance.BackColor = System.Drawing.Color.Transparent + ' + ' lblAmount + ' + Me.lblAmount.Location = New System.Drawing.Point(16, 183) + Me.lblAmount.Name = "lblAmount" + Me.lblAmount.Size = New System.Drawing.Size(27, 13) + Me.lblAmount.TabIndex = 37 + Me.lblAmount.Text = "Amount:" + ' + ' calcAmount + ' + Me.calcAmount.Location = New System.Drawing.Point(96, 180) + Me.calcAmount.Name = "calcAmount" + Me.calcAmount.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.calcAmount.Size = New System.Drawing.Size(100, 20) + Me.calcAmount.TabIndex = 38 +'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: +'ORIGINAL LINE: this.calcAmount.EditValueChanged += new System.EventHandler(this.calcAmount_EditValueChanged); + ' + ' mruEdit1 + ' + Me.mruEdit1.Location = New System.Drawing.Point(352, 310) + Me.mruEdit1.Name = "mruEdit1" + Me.mruEdit1.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() { New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.mruEdit1.Size = New System.Drawing.Size(8, 20) + Me.mruEdit1.TabIndex = 39 + ' + ' tbContact + ' + Me.tbContact.Location = New System.Drawing.Point(330, 194) + Me.tbContact.Name = "tbContact" + Me.tbContact.Size = New System.Drawing.Size(182, 41) + Me.tbContact.TabIndex = 40 +'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: +'ORIGINAL LINE: this.tbContact.EditValueChanged += new System.EventHandler(this.tbContact_EditValueChanged); + ' + ' lblContactInfo + ' + Me.lblContactInfo.Location = New System.Drawing.Point(330, 174) + Me.lblContactInfo.Name = "lblContactInfo" + Me.lblContactInfo.Size = New System.Drawing.Size(65, 13) + Me.lblContactInfo.TabIndex = 41 + Me.lblContactInfo.Text = "Contact Info:" + ' + ' carsDBDataSet + ' + Me.carsDBDataSet_Conflict.DataSetName = "CarsDBDataSet" + Me.carsDBDataSet_Conflict.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + ' MyAppointmentForm + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(528, 382) + Me.Controls.Add(Me.mruEdit1) + Me.Controls.Add(Me.lblAmount) + Me.Controls.Add(Me.lblContactInfo) + Me.Controls.Add(Me.tbContact) + Me.Controls.Add(Me.calcAmount) + Me.MinimumSize = New System.Drawing.Size(506, 294) + Me.Name = "MyAppointmentForm" + Me.Text = "MyAppointmentForm" + Me.Controls.SetChildIndex(Me.calcAmount, 0) + Me.Controls.SetChildIndex(Me.tbContact, 0) + Me.Controls.SetChildIndex(Me.lblContactInfo, 0) + Me.Controls.SetChildIndex(Me.lblAmount, 0) + Me.Controls.SetChildIndex(Me.mruEdit1, 0) + Me.Controls.SetChildIndex(Me.edtShowTimeAs, 0) + Me.Controls.SetChildIndex(Me.edtEndTime, 0) + Me.Controls.SetChildIndex(Me.edtEndDate, 0) + Me.Controls.SetChildIndex(Me.btnRecurrence, 0) + Me.Controls.SetChildIndex(Me.btnDelete, 0) + Me.Controls.SetChildIndex(Me.btnCancel, 0) + Me.Controls.SetChildIndex(Me.lblShowTimeAs, 0) + Me.Controls.SetChildIndex(Me.lblEndTime, 0) + Me.Controls.SetChildIndex(Me.tbLocation, 0) + Me.Controls.SetChildIndex(Me.lblSubject, 0) + Me.Controls.SetChildIndex(Me.lblLocation, 0) + Me.Controls.SetChildIndex(Me.tbSubject, 0) + Me.Controls.SetChildIndex(Me.lblStartTime, 0) + Me.Controls.SetChildIndex(Me.btnOk, 0) + Me.Controls.SetChildIndex(Me.edtStartDate, 0) + Me.Controls.SetChildIndex(Me.edtStartTime, 0) + Me.Controls.SetChildIndex(Me.panel1, 0) + Me.Controls.SetChildIndex(Me.progressPanel, 0) + Me.Controls.SetChildIndex(Me.tbDescription, 0) + CType(Me.chkAllDay.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtStartDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtStartDate.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtEndDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtEndDate.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtStartTime.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtEndTime.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtLabel.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtShowTimeAs.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.tbSubject.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtResource.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtResources.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.edtResources.ResourcesCheckedListBoxControl, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.chkReminder.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.tbDescription.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.cbReminder.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.tbLocation.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.panel1, System.ComponentModel.ISupportInitialize).EndInit() + Me.panel1.ResumeLayout(False) + Me.panel1.PerformLayout() + Me.progressPanel.ResumeLayout(False) + Me.progressPanel.PerformLayout() + CType(Me.tbProgress.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.tbProgress, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.calcAmount.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.mruEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.tbContact.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.carsDBDataSet_Conflict, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub + End Sub - #End Region + #End Region - Private lblAmount As DevExpress.XtraEditors.LabelControl - Private WithEvents calcAmount As DevExpress.XtraEditors.CalcEdit - Private mruEdit1 As DevExpress.XtraEditors.MRUEdit - Private WithEvents tbContact As DevExpress.XtraEditors.MemoEdit - Private lblContactInfo As DevExpress.XtraEditors.LabelControl - - Private carsDBDataSet_Renamed As CarsDBDataSet - End Class + Private lblAmount As DevExpress.XtraEditors.LabelControl + Private WithEvents calcAmount As DevExpress.XtraEditors.CalcEdit + Private mruEdit1 As DevExpress.XtraEditors.MRUEdit + Private WithEvents tbContact As DevExpress.XtraEditors.MemoEdit + Private lblContactInfo As DevExpress.XtraEditors.LabelControl +'INSTANT VB NOTE: The variable carsDBDataSet was renamed since it may cause conflicts with calls to static members of the user-defined type with this name: + Private carsDBDataSet_Conflict As CarsDBDataSet + End Class End Namespace \ No newline at end of file diff --git a/VB/SimpleCustomFields/MyAppointmentForm.vb b/VB/SimpleCustomFields/MyAppointmentForm.vb index d5dc356..37cc9a0 100644 --- a/VB/SimpleCustomFields/MyAppointmentForm.vb +++ b/VB/SimpleCustomFields/MyAppointmentForm.vb @@ -11,119 +11,119 @@ Imports DevExpress.XtraScheduler #End Region ' #usingsform Namespace SimpleCustomFields - Partial Public Class MyAppointmentForm - Inherits DevExpress.XtraScheduler.UI.AppointmentForm + Partial Public Class MyAppointmentForm + Inherits DevExpress.XtraScheduler.UI.AppointmentForm - Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment) - MyBase.New(control, apt) - ' Required to initialize custom field editors. - InitializeComponent() - End Sub + Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment) + MyBase.New(control, apt) + ' Required to initialize custom field editors. + InitializeComponent() + End Sub - Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment, ByVal openRecurrenceForm As Boolean) - MyBase.New(control, apt, openRecurrenceForm) - ' Required to initialize custom field editors. - InitializeComponent() - End Sub + Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment, ByVal openRecurrenceForm As Boolean) + MyBase.New(control, apt, openRecurrenceForm) + ' Required to initialize custom field editors. + InitializeComponent() + End Sub - Public Overrides Sub LoadFormData(ByVal apt As Appointment) - MyBase.LoadFormData(apt) - UpdateCustomFieldEditors() - End Sub - #Region "#Form-Controller" - Protected Overrides Function CreateController(ByVal control As SchedulerControl, ByVal apt As Appointment) As AppointmentFormController - Return New MyAppointmentFormController(control, apt) - End Function + Public Overrides Sub LoadFormData(ByVal apt As Appointment) + MyBase.LoadFormData(apt) + UpdateCustomFieldEditors() + End Sub + #Region "#Form-Controller" + Protected Overrides Function CreateController(ByVal control As SchedulerControl, ByVal apt As Appointment) As AppointmentFormController + Return New MyAppointmentFormController(control, apt) + End Function - Protected Sub UpdateCustomFieldEditors() - calcAmount.Value = CType(MyBase.Controller, MyAppointmentFormController).Amount - tbContact.Text = CType(MyBase.Controller, MyAppointmentFormController).ContactInfo - End Sub + Protected Sub UpdateCustomFieldEditors() + calcAmount.Value = CType(MyBase.Controller, MyAppointmentFormController).Amount + tbContact.Text = CType(MyBase.Controller, MyAppointmentFormController).ContactInfo + End Sub - Private Sub calcAmount_EditValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles calcAmount.EditValueChanged - CType(MyBase.Controller, MyAppointmentFormController).Amount = calcAmount.Value - End Sub + Private Sub calcAmount_EditValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles calcAmount.EditValueChanged + CType(MyBase.Controller, MyAppointmentFormController).Amount = calcAmount.Value + End Sub - Private Sub tbContact_EditValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tbContact.EditValueChanged - CType(MyBase.Controller, MyAppointmentFormController).ContactInfo = tbContact.Text - End Sub - #End Region ' #Form-Controller - End Class + Private Sub tbContact_EditValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tbContact.EditValueChanged + CType(MyBase.Controller, MyAppointmentFormController).ContactInfo = tbContact.Text + End Sub + #End Region ' #Form-Controller + End Class - Friend Class MyAppointmentFormController - Inherits AppointmentFormController + Friend Class MyAppointmentFormController + Inherits AppointmentFormController - Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment) - MyBase.New(control, apt) - End Sub - #Region "#CustomFieldProperties" - Public Property Amount() As Decimal - Get - If MyBase.EditedAppointmentCopy.CustomFields("Amount") IsNot Nothing Then - Return Convert.ToDecimal(MyBase.EditedAppointmentCopy.CustomFields("Amount")) - Else - Return 0.0D - End If - End Get - Set(ByVal value As Decimal) - MyBase.EditedAppointmentCopy.CustomFields("Amount") = value - End Set - End Property - Public Property ContactInfo() As String - Get - If MyBase.EditedAppointmentCopy.CustomFields("ContactInfo") IsNot Nothing Then - Return MyBase.EditedAppointmentCopy.CustomFields("ContactInfo").ToString() - Else - Return String.Empty - End If - End Get - Set(ByVal value As String) - MyBase.EditedAppointmentCopy.CustomFields("ContactInfo") = value - End Set - End Property + Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment) + MyBase.New(control, apt) + End Sub + #Region "#CustomFieldProperties" + Public Property Amount() As Decimal + Get + If MyBase.EditedAppointmentCopy.CustomFields("Amount") IsNot Nothing Then + Return Convert.ToDecimal(MyBase.EditedAppointmentCopy.CustomFields("Amount")) + Else + Return 0.0D + End If + End Get + Set(ByVal value As Decimal) + MyBase.EditedAppointmentCopy.CustomFields("Amount") = value + End Set + End Property + Public Property ContactInfo() As String + Get + If MyBase.EditedAppointmentCopy.CustomFields("ContactInfo") IsNot Nothing Then + Return MyBase.EditedAppointmentCopy.CustomFields("ContactInfo").ToString() + Else + Return String.Empty + End If + End Get + Set(ByVal value As String) + MyBase.EditedAppointmentCopy.CustomFields("ContactInfo") = value + End Set + End Property - Public Property SourceAmount() As Decimal - Get + Public Property SourceAmount() As Decimal + Get - If MyBase.SourceAppointment.CustomFields("Amount") IsNot Nothing Then - Return Convert.ToDecimal(MyBase.SourceAppointment.CustomFields("Amount")) - Else - Return CDec(0) - End If - End Get - Set(ByVal value As Decimal) - MyBase.SourceAppointment.CustomFields("Amount") = value - End Set - End Property - Public Property SourceContactInfo() As String - Get - If MyBase.SourceAppointment.CustomFields("ContactInfo") IsNot Nothing Then - Return MyBase.SourceAppointment.CustomFields("ContactInfo").ToString() - Else - Return String.Empty - End If - End Get - Set(ByVal value As String) - MyBase.SourceAppointment.CustomFields("ContactInfo") = value - End Set - End Property - #End Region ' #CustomFieldProperties + If MyBase.SourceAppointment.CustomFields("Amount") IsNot Nothing Then + Return Convert.ToDecimal(MyBase.SourceAppointment.CustomFields("Amount")) + Else + Return CDec(0) + End If + End Get + Set(ByVal value As Decimal) + MyBase.SourceAppointment.CustomFields("Amount") = value + End Set + End Property + Public Property SourceContactInfo() As String + Get + If MyBase.SourceAppointment.CustomFields("ContactInfo") IsNot Nothing Then + Return MyBase.SourceAppointment.CustomFields("ContactInfo").ToString() + Else + Return String.Empty + End If + End Get + Set(ByVal value As String) + MyBase.SourceAppointment.CustomFields("ContactInfo") = value + End Set + End Property + #End Region ' #CustomFieldProperties - ' Indicate whether an occurrence should be converted into an exception when the Recurrence Form is invoked - #Region "#IsAppointmentChanged" - Public Overrides Function IsAppointmentChanged() As Boolean - If MyBase.IsAppointmentChanged() Then - Return True - End If - Return SourceAmount <> Amount OrElse SourceContactInfo <> ContactInfo - End Function - #End Region ' #IsAppointmentChanged - #Region "#ApplyCustomFieldsValues" - Protected Overrides Sub ApplyCustomFieldsValues() - MyBase.SourceAppointment.CustomFields("Amount") = Amount - MyBase.SourceAppointment.CustomFields("ContactInfo") = ContactInfo - MyBase.ApplyCustomFieldsValues() - End Sub - #End Region ' #ApplyCustomFieldsValues - End Class + ' Indicate whether an occurrence should be converted into an exception when the Recurrence Form is invoked + #Region "#IsAppointmentChanged" + Public Overrides Function IsAppointmentChanged() As Boolean + If MyBase.IsAppointmentChanged() Then + Return True + End If + Return SourceAmount <> Amount OrElse SourceContactInfo <> ContactInfo + End Function + #End Region ' #IsAppointmentChanged + #Region "#ApplyCustomFieldsValues" + Protected Overrides Sub ApplyCustomFieldsValues() + MyBase.SourceAppointment.CustomFields("Amount") = Amount + MyBase.SourceAppointment.CustomFields("ContactInfo") = ContactInfo + MyBase.ApplyCustomFieldsValues() + End Sub + #End Region ' #ApplyCustomFieldsValues + End Class End Namespace \ No newline at end of file diff --git a/VB/SimpleCustomFields/Program.vb b/VB/SimpleCustomFields/Program.vb index 8c688dd..afef6c3 100644 --- a/VB/SimpleCustomFields/Program.vb +++ b/VB/SimpleCustomFields/Program.vb @@ -3,19 +3,15 @@ Imports System.Collections.Generic Imports System.Windows.Forms Namespace SimpleCustomFields - Friend NotInheritable Class Program - - Private Sub New() - End Sub - - ''' - ''' The main entry point for the application. - ''' - _ - Shared Sub Main() - Application.EnableVisualStyles() - Application.SetCompatibleTextRenderingDefault(False) - Application.Run(New Form1()) - End Sub - End Class + Friend Module Program + ''' + ''' The main entry point for the application. + ''' + + Sub Main() + Application.EnableVisualStyles() + Application.SetCompatibleTextRenderingDefault(False) + Application.Run(New Form1()) + End Sub + End Module End Namespace \ No newline at end of file diff --git a/VB/SimpleCustomFields/SimpleCustomFields.vbproj b/VB/SimpleCustomFields/SimpleCustomFields.vbproj index 322babd..15ea3ef 100644 --- a/VB/SimpleCustomFields/SimpleCustomFields.vbproj +++ b/VB/SimpleCustomFields/SimpleCustomFields.vbproj @@ -1,4 +1,4 @@ - + Debug @@ -7,13 +7,15 @@ 2.0 {F186F991-4F38-4A91-9C7C-5D59A121C104} WinExe - + + SimpleCustomFields v4.5 - - + + + + 2.0 - publish\ true Disk @@ -45,6 +47,7 @@ true false x86 + true pdbonly @@ -54,6 +57,7 @@ true prompt false + true true @@ -65,6 +69,7 @@ x86 prompt MinimumRecommendedRules.ruleset + true bin\x86\Release\ @@ -75,60 +80,91 @@ x86 prompt MinimumRecommendedRules.ruleset + true - + + + + - False + True + C:\DXDlls\18.1.16\DevExpress.Data.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.Pdf.v18.1.Core.dll False + True + C:\DXDlls\18.1.16\DevExpress.Office.v18.1.Core.dll False + True + C:\DXDlls\18.1.16\DevExpress.RichEdit.v18.1.Core.dll False + True + C:\DXDlls\18.1.16\DevExpress.RichEdit.v18.1.Export.dll False + True + C:\DXDlls\18.1.16\DevExpress.Printing.v18.1.Core.dll False + True + C:\DXDlls\18.1.16\DevExpress.Utils.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraEditors.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraPrinting.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraBars.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraGrid.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraScheduler.v18.1.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraScheduler.v18.1.Core.dll False + True + C:\DXDlls\18.1.16\DevExpress.XtraScheduler.v18.1.Reporting.Extensions.dll @@ -187,6 +223,7 @@ SettingsSingleFileGenerator Settings.Designer.vb + My True @@ -225,4 +262,4 @@ --> - + \ No newline at end of file diff --git a/VB/SimpleCustomFields/app.config b/VB/SimpleCustomFields/app.config index a34f068..1349728 100644 --- a/VB/SimpleCustomFields/app.config +++ b/VB/SimpleCustomFields/app.config @@ -1,4 +1,4 @@ - +