'------------------------------------------------------------------------------
'
' 這段程式碼是由工具產生的。
' 執行階段版本:4.0.30319.42000
'
' 對這個檔案所做的變更可能會造成錯誤的行為,而且如果重新產生程式碼,
' 變更將會遺失。
'
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
'''
'''Represents a strongly typed in-memory cache of data.
'''
_
Partial Public Class 謎鹿DataSet
Inherits Global.System.Data.DataSet
Private table商品 As 商品DataTable
Private table會員 As 會員DataTable
Private table訂單 As 訂單DataTable
Private table購物車 As 購物車DataTable
Private table紀錄 As 紀錄DataTable
Private table訂購 As 訂購DataTable
Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
_
Public Sub New()
MyBase.New
Me.BeginInit
Me.InitClass
Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler
AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler
Me.EndInit
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context, false)
If (Me.IsBinarySerialized(info, context) = true) Then
Me.InitVars(false)
Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1
AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1
Return
End If
Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String)
If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then
Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet()
ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema)))
If (Not (ds.Tables("商品")) Is Nothing) Then
MyBase.Tables.Add(New 商品DataTable(ds.Tables("商品")))
End If
If (Not (ds.Tables("會員")) Is Nothing) Then
MyBase.Tables.Add(New 會員DataTable(ds.Tables("會員")))
End If
If (Not (ds.Tables("訂單")) Is Nothing) Then
MyBase.Tables.Add(New 訂單DataTable(ds.Tables("訂單")))
End If
If (Not (ds.Tables("購物車")) Is Nothing) Then
MyBase.Tables.Add(New 購物車DataTable(ds.Tables("購物車")))
End If
If (Not (ds.Tables("紀錄")) Is Nothing) Then
MyBase.Tables.Add(New 紀錄DataTable(ds.Tables("紀錄")))
End If
If (Not (ds.Tables("訂購")) Is Nothing) Then
MyBase.Tables.Add(New 訂購DataTable(ds.Tables("訂購")))
End If
Me.DataSetName = ds.DataSetName
Me.Prefix = ds.Prefix
Me.Namespace = ds.Namespace
Me.Locale = ds.Locale
Me.CaseSensitive = ds.CaseSensitive
Me.EnforceConstraints = ds.EnforceConstraints
Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add)
Me.InitVars
Else
Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema)))
End If
Me.GetSerializationData(info, context)
Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler
AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
End Sub
_
Public ReadOnly Property 商品() As 商品DataTable
Get
Return Me.table商品
End Get
End Property
_
Public ReadOnly Property 會員() As 會員DataTable
Get
Return Me.table會員
End Get
End Property
_
Public ReadOnly Property 訂單() As 訂單DataTable
Get
Return Me.table訂單
End Get
End Property
_
Public ReadOnly Property 購物車() As 購物車DataTable
Get
Return Me.table購物車
End Get
End Property
_
Public ReadOnly Property 紀錄() As 紀錄DataTable
Get
Return Me.table紀錄
End Get
End Property
_
Public ReadOnly Property 訂購() As 訂購DataTable
Get
Return Me.table訂購
End Get
End Property
_
Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode
Get
Return Me._schemaSerializationMode
End Get
Set
Me._schemaSerializationMode = value
End Set
End Property
_
Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection
Get
Return MyBase.Tables
End Get
End Property
_
Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection
Get
Return MyBase.Relations
End Get
End Property
_
Protected Overrides Sub InitializeDerivedDataSet()
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Public Overrides Function Clone() As Global.System.Data.DataSet
Dim cln As 謎鹿DataSet = CType(MyBase.Clone,謎鹿DataSet)
cln.InitVars
cln.SchemaSerializationMode = Me.SchemaSerializationMode
Return cln
End Function
_
Protected Overrides Function ShouldSerializeTables() As Boolean
Return false
End Function
_
Protected Overrides Function ShouldSerializeRelations() As Boolean
Return false
End Function
_
Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader)
If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then
Me.Reset
Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet()
ds.ReadXml(reader)
If (Not (ds.Tables("商品")) Is Nothing) Then
MyBase.Tables.Add(New 商品DataTable(ds.Tables("商品")))
End If
If (Not (ds.Tables("會員")) Is Nothing) Then
MyBase.Tables.Add(New 會員DataTable(ds.Tables("會員")))
End If
If (Not (ds.Tables("訂單")) Is Nothing) Then
MyBase.Tables.Add(New 訂單DataTable(ds.Tables("訂單")))
End If
If (Not (ds.Tables("購物車")) Is Nothing) Then
MyBase.Tables.Add(New 購物車DataTable(ds.Tables("購物車")))
End If
If (Not (ds.Tables("紀錄")) Is Nothing) Then
MyBase.Tables.Add(New 紀錄DataTable(ds.Tables("紀錄")))
End If
If (Not (ds.Tables("訂購")) Is Nothing) Then
MyBase.Tables.Add(New 訂購DataTable(ds.Tables("訂購")))
End If
Me.DataSetName = ds.DataSetName
Me.Prefix = ds.Prefix
Me.Namespace = ds.Namespace
Me.Locale = ds.Locale
Me.CaseSensitive = ds.CaseSensitive
Me.EnforceConstraints = ds.EnforceConstraints
Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add)
Me.InitVars
Else
Me.ReadXml(reader)
Me.InitVars
End If
End Sub
_
Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema
Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing))
stream.Position = 0
Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing)
End Function
_
Friend Overloads Sub InitVars()
Me.InitVars(true)
End Sub
_
Friend Overloads Sub InitVars(ByVal initTable As Boolean)
Me.table商品 = CType(MyBase.Tables("商品"),商品DataTable)
If (initTable = true) Then
If (Not (Me.table商品) Is Nothing) Then
Me.table商品.InitVars
End If
End If
Me.table會員 = CType(MyBase.Tables("會員"),會員DataTable)
If (initTable = true) Then
If (Not (Me.table會員) Is Nothing) Then
Me.table會員.InitVars
End If
End If
Me.table訂單 = CType(MyBase.Tables("訂單"),訂單DataTable)
If (initTable = true) Then
If (Not (Me.table訂單) Is Nothing) Then
Me.table訂單.InitVars
End If
End If
Me.table購物車 = CType(MyBase.Tables("購物車"),購物車DataTable)
If (initTable = true) Then
If (Not (Me.table購物車) Is Nothing) Then
Me.table購物車.InitVars
End If
End If
Me.table紀錄 = CType(MyBase.Tables("紀錄"),紀錄DataTable)
If (initTable = true) Then
If (Not (Me.table紀錄) Is Nothing) Then
Me.table紀錄.InitVars
End If
End If
Me.table訂購 = CType(MyBase.Tables("訂購"),訂購DataTable)
If (initTable = true) Then
If (Not (Me.table訂購) Is Nothing) Then
Me.table訂購.InitVars
End If
End If
End Sub
_
Private Sub InitClass()
Me.DataSetName = "謎鹿DataSet"
Me.Prefix = ""
Me.Namespace = "http://tempuri.org/謎鹿DataSet.xsd"
Me.EnforceConstraints = true
Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema
Me.table商品 = New 商品DataTable()
MyBase.Tables.Add(Me.table商品)
Me.table會員 = New 會員DataTable()
MyBase.Tables.Add(Me.table會員)
Me.table訂單 = New 訂單DataTable()
MyBase.Tables.Add(Me.table訂單)
Me.table購物車 = New 購物車DataTable()
MyBase.Tables.Add(Me.table購物車)
Me.table紀錄 = New 紀錄DataTable()
MyBase.Tables.Add(Me.table紀錄)
Me.table訂購 = New 訂購DataTable()
MyBase.Tables.Add(Me.table訂購)
End Sub
_
Private Function ShouldSerialize商品() As Boolean
Return false
End Function
_
Private Function ShouldSerialize會員() As Boolean
Return false
End Function
_
Private Function ShouldSerialize訂單() As Boolean
Return false
End Function
_
Private Function ShouldSerialize購物車() As Boolean
Return false
End Function
_
Private Function ShouldSerialize紀錄() As Boolean
Return false
End Function
_
Private Function ShouldSerialize訂購() 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 謎鹿DataSet = New 謎鹿DataSet()
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any.Namespace = ds.Namespace
sequence.Items.Add(any)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
_
Public Delegate Sub 商品RowChangeEventHandler(ByVal sender As Object, ByVal e As 商品RowChangeEvent)
_
Public Delegate Sub 會員RowChangeEventHandler(ByVal sender As Object, ByVal e As 會員RowChangeEvent)
_
Public Delegate Sub 訂單RowChangeEventHandler(ByVal sender As Object, ByVal e As 訂單RowChangeEvent)
_
Public Delegate Sub 購物車RowChangeEventHandler(ByVal sender As Object, ByVal e As 購物車RowChangeEvent)
_
Public Delegate Sub 紀錄RowChangeEventHandler(ByVal sender As Object, ByVal e As 紀錄RowChangeEvent)
_
Public Delegate Sub 訂購RowChangeEventHandler(ByVal sender As Object, ByVal e As 訂購RowChangeEvent)
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 商品DataTable
Inherits Global.System.Data.TypedTableBase(Of 商品Row)
Private column商品編號 As Global.System.Data.DataColumn
Private column商品名稱 As Global.System.Data.DataColumn
Private column庫存數量 As Global.System.Data.DataColumn
Private column定價 As Global.System.Data.DataColumn
Private column種類 As Global.System.Data.DataColumn
Private column管理者編號 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "商品"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 商品編號Column() As Global.System.Data.DataColumn
Get
Return Me.column商品編號
End Get
End Property
_
Public ReadOnly Property 商品名稱Column() As Global.System.Data.DataColumn
Get
Return Me.column商品名稱
End Get
End Property
_
Public ReadOnly Property 庫存數量Column() As Global.System.Data.DataColumn
Get
Return Me.column庫存數量
End Get
End Property
_
Public ReadOnly Property 定價Column() As Global.System.Data.DataColumn
Get
Return Me.column定價
End Get
End Property
_
Public ReadOnly Property 種類Column() As Global.System.Data.DataColumn
Get
Return Me.column種類
End Get
End Property
_
Public ReadOnly Property 管理者編號Column() As Global.System.Data.DataColumn
Get
Return Me.column管理者編號
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 商品Row
Get
Return CType(Me.Rows(index),商品Row)
End Get
End Property
_
Public Event 商品RowChanging As 商品RowChangeEventHandler
_
Public Event 商品RowChanged As 商品RowChangeEventHandler
_
Public Event 商品RowDeleting As 商品RowChangeEventHandler
_
Public Event 商品RowDeleted As 商品RowChangeEventHandler
_
Public Overloads Sub Add商品Row(ByVal row As 商品Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add商品Row(ByVal 商品編號 As String, ByVal 商品名稱 As String, ByVal 庫存數量 As String, ByVal 定價 As String, ByVal 種類 As String, ByVal 管理者編號 As String) As 商品Row
Dim row商品Row As 商品Row = CType(Me.NewRow,商品Row)
Dim columnValuesArray() As Object = New Object() {商品編號, 商品名稱, 庫存數量, 定價, 種類, 管理者編號}
row商品Row.ItemArray = columnValuesArray
Me.Rows.Add(row商品Row)
Return row商品Row
End Function
_
Public Function FindBy商品編號(ByVal 商品編號 As String) As 商品Row
Return CType(Me.Rows.Find(New Object() {商品編號}),商品Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 商品DataTable = CType(MyBase.Clone,商品DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 商品DataTable()
End Function
_
Friend Sub InitVars()
Me.column商品編號 = MyBase.Columns("商品編號")
Me.column商品名稱 = MyBase.Columns("商品名稱")
Me.column庫存數量 = MyBase.Columns("庫存數量")
Me.column定價 = MyBase.Columns("定價")
Me.column種類 = MyBase.Columns("種類")
Me.column管理者編號 = MyBase.Columns("管理者編號")
End Sub
_
Private Sub InitClass()
Me.column商品編號 = New Global.System.Data.DataColumn("商品編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column商品編號)
Me.column商品名稱 = New Global.System.Data.DataColumn("商品名稱", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column商品名稱)
Me.column庫存數量 = New Global.System.Data.DataColumn("庫存數量", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column庫存數量)
Me.column定價 = New Global.System.Data.DataColumn("定價", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column定價)
Me.column種類 = New Global.System.Data.DataColumn("種類", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column種類)
Me.column管理者編號 = New Global.System.Data.DataColumn("管理者編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column管理者編號)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column商品編號}, true))
Me.column商品編號.AllowDBNull = false
Me.column商品編號.Unique = true
Me.column商品名稱.MaxLength = 10
Me.column庫存數量.MaxLength = 10
Me.column定價.MaxLength = 10
Me.column種類.MaxLength = 10
Me.column管理者編號.MaxLength = 10
End Sub
_
Public Function New商品Row() As 商品Row
Return CType(Me.NewRow,商品Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 商品Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(商品Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.商品RowChangedEvent) Is Nothing) Then
RaiseEvent 商品RowChanged(Me, New 商品RowChangeEvent(CType(e.Row,商品Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.商品RowChangingEvent) Is Nothing) Then
RaiseEvent 商品RowChanging(Me, New 商品RowChangeEvent(CType(e.Row,商品Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.商品RowDeletedEvent) Is Nothing) Then
RaiseEvent 商品RowDeleted(Me, New 商品RowChangeEvent(CType(e.Row,商品Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.商品RowDeletingEvent) Is Nothing) Then
RaiseEvent 商品RowDeleting(Me, New 商品RowChangeEvent(CType(e.Row,商品Row), e.Action))
End If
End Sub
_
Public Sub Remove商品Row(ByVal row As 商品Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "商品DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 會員DataTable
Inherits Global.System.Data.TypedTableBase(Of 會員Row)
Private column會員編號 As Global.System.Data.DataColumn
Private column帳號 As Global.System.Data.DataColumn
Private column密碼 As Global.System.Data.DataColumn
Private column姓名 As Global.System.Data.DataColumn
Private column電話 As Global.System.Data.DataColumn
Private column住址 As Global.System.Data.DataColumn
Private columnemail As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "會員"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 會員編號Column() As Global.System.Data.DataColumn
Get
Return Me.column會員編號
End Get
End Property
_
Public ReadOnly Property 帳號Column() As Global.System.Data.DataColumn
Get
Return Me.column帳號
End Get
End Property
_
Public ReadOnly Property 密碼Column() As Global.System.Data.DataColumn
Get
Return Me.column密碼
End Get
End Property
_
Public ReadOnly Property 姓名Column() As Global.System.Data.DataColumn
Get
Return Me.column姓名
End Get
End Property
_
Public ReadOnly Property 電話Column() As Global.System.Data.DataColumn
Get
Return Me.column電話
End Get
End Property
_
Public ReadOnly Property 住址Column() As Global.System.Data.DataColumn
Get
Return Me.column住址
End Get
End Property
_
Public ReadOnly Property emailColumn() As Global.System.Data.DataColumn
Get
Return Me.columnemail
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 會員Row
Get
Return CType(Me.Rows(index),會員Row)
End Get
End Property
_
Public Event 會員RowChanging As 會員RowChangeEventHandler
_
Public Event 會員RowChanged As 會員RowChangeEventHandler
_
Public Event 會員RowDeleting As 會員RowChangeEventHandler
_
Public Event 會員RowDeleted As 會員RowChangeEventHandler
_
Public Overloads Sub Add會員Row(ByVal row As 會員Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add會員Row(ByVal 會員編號 As String, ByVal 帳號 As String, ByVal 密碼 As String, ByVal 姓名 As String, ByVal 電話 As String, ByVal 住址 As String, ByVal email As String) As 會員Row
Dim row會員Row As 會員Row = CType(Me.NewRow,會員Row)
Dim columnValuesArray() As Object = New Object() {會員編號, 帳號, 密碼, 姓名, 電話, 住址, email}
row會員Row.ItemArray = columnValuesArray
Me.Rows.Add(row會員Row)
Return row會員Row
End Function
_
Public Function FindBy會員編號(ByVal 會員編號 As String) As 會員Row
Return CType(Me.Rows.Find(New Object() {會員編號}),會員Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 會員DataTable = CType(MyBase.Clone,會員DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 會員DataTable()
End Function
_
Friend Sub InitVars()
Me.column會員編號 = MyBase.Columns("會員編號")
Me.column帳號 = MyBase.Columns("帳號")
Me.column密碼 = MyBase.Columns("密碼")
Me.column姓名 = MyBase.Columns("姓名")
Me.column電話 = MyBase.Columns("電話")
Me.column住址 = MyBase.Columns("住址")
Me.columnemail = MyBase.Columns("email")
End Sub
_
Private Sub InitClass()
Me.column會員編號 = New Global.System.Data.DataColumn("會員編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column會員編號)
Me.column帳號 = New Global.System.Data.DataColumn("帳號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column帳號)
Me.column密碼 = New Global.System.Data.DataColumn("密碼", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column密碼)
Me.column姓名 = New Global.System.Data.DataColumn("姓名", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column姓名)
Me.column電話 = New Global.System.Data.DataColumn("電話", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column電話)
Me.column住址 = New Global.System.Data.DataColumn("住址", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column住址)
Me.columnemail = New Global.System.Data.DataColumn("email", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnemail)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column會員編號}, true))
Me.column會員編號.AllowDBNull = false
Me.column會員編號.Unique = true
Me.column會員編號.MaxLength = 50
Me.column帳號.MaxLength = 50
Me.column密碼.MaxLength = 50
Me.column姓名.MaxLength = 50
Me.column電話.MaxLength = 50
Me.column住址.MaxLength = 50
Me.columnemail.MaxLength = 50
End Sub
_
Public Function New會員Row() As 會員Row
Return CType(Me.NewRow,會員Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 會員Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(會員Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.會員RowChangedEvent) Is Nothing) Then
RaiseEvent 會員RowChanged(Me, New 會員RowChangeEvent(CType(e.Row,會員Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.會員RowChangingEvent) Is Nothing) Then
RaiseEvent 會員RowChanging(Me, New 會員RowChangeEvent(CType(e.Row,會員Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.會員RowDeletedEvent) Is Nothing) Then
RaiseEvent 會員RowDeleted(Me, New 會員RowChangeEvent(CType(e.Row,會員Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.會員RowDeletingEvent) Is Nothing) Then
RaiseEvent 會員RowDeleting(Me, New 會員RowChangeEvent(CType(e.Row,會員Row), e.Action))
End If
End Sub
_
Public Sub Remove會員Row(ByVal row As 會員Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "會員DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 訂單DataTable
Inherits Global.System.Data.TypedTableBase(Of 訂單Row)
Private column訂單編號 As Global.System.Data.DataColumn
Private column付款方式 As Global.System.Data.DataColumn
Private column取貨方式 As Global.System.Data.DataColumn
Private column訂單日期 As Global.System.Data.DataColumn
Private column會員編號 As Global.System.Data.DataColumn
Private column購物車編號 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "訂單"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 訂單編號Column() As Global.System.Data.DataColumn
Get
Return Me.column訂單編號
End Get
End Property
_
Public ReadOnly Property 付款方式Column() As Global.System.Data.DataColumn
Get
Return Me.column付款方式
End Get
End Property
_
Public ReadOnly Property 取貨方式Column() As Global.System.Data.DataColumn
Get
Return Me.column取貨方式
End Get
End Property
_
Public ReadOnly Property 訂單日期Column() As Global.System.Data.DataColumn
Get
Return Me.column訂單日期
End Get
End Property
_
Public ReadOnly Property 會員編號Column() As Global.System.Data.DataColumn
Get
Return Me.column會員編號
End Get
End Property
_
Public ReadOnly Property 購物車編號Column() As Global.System.Data.DataColumn
Get
Return Me.column購物車編號
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 訂單Row
Get
Return CType(Me.Rows(index),訂單Row)
End Get
End Property
_
Public Event 訂單RowChanging As 訂單RowChangeEventHandler
_
Public Event 訂單RowChanged As 訂單RowChangeEventHandler
_
Public Event 訂單RowDeleting As 訂單RowChangeEventHandler
_
Public Event 訂單RowDeleted As 訂單RowChangeEventHandler
_
Public Overloads Sub Add訂單Row(ByVal row As 訂單Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add訂單Row(ByVal 訂單編號 As String, ByVal 付款方式 As String, ByVal 取貨方式 As String, ByVal 訂單日期 As String, ByVal 會員編號 As String, ByVal 購物車編號 As String) As 訂單Row
Dim row訂單Row As 訂單Row = CType(Me.NewRow,訂單Row)
Dim columnValuesArray() As Object = New Object() {訂單編號, 付款方式, 取貨方式, 訂單日期, 會員編號, 購物車編號}
row訂單Row.ItemArray = columnValuesArray
Me.Rows.Add(row訂單Row)
Return row訂單Row
End Function
_
Public Function FindBy訂單編號(ByVal 訂單編號 As String) As 訂單Row
Return CType(Me.Rows.Find(New Object() {訂單編號}),訂單Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 訂單DataTable = CType(MyBase.Clone,訂單DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 訂單DataTable()
End Function
_
Friend Sub InitVars()
Me.column訂單編號 = MyBase.Columns("訂單編號")
Me.column付款方式 = MyBase.Columns("付款方式")
Me.column取貨方式 = MyBase.Columns("取貨方式")
Me.column訂單日期 = MyBase.Columns("訂單日期")
Me.column會員編號 = MyBase.Columns("會員編號")
Me.column購物車編號 = MyBase.Columns("購物車編號")
End Sub
_
Private Sub InitClass()
Me.column訂單編號 = New Global.System.Data.DataColumn("訂單編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column訂單編號)
Me.column付款方式 = New Global.System.Data.DataColumn("付款方式", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column付款方式)
Me.column取貨方式 = New Global.System.Data.DataColumn("取貨方式", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column取貨方式)
Me.column訂單日期 = New Global.System.Data.DataColumn("訂單日期", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column訂單日期)
Me.column會員編號 = New Global.System.Data.DataColumn("會員編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column會員編號)
Me.column購物車編號 = New Global.System.Data.DataColumn("購物車編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column購物車編號)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column訂單編號}, true))
Me.column訂單編號.AllowDBNull = false
Me.column訂單編號.Unique = true
Me.column付款方式.MaxLength = 10
Me.column取貨方式.MaxLength = 10
Me.column訂單日期.MaxLength = 10
Me.column會員編號.MaxLength = 10
Me.column購物車編號.MaxLength = 10
End Sub
_
Public Function New訂單Row() As 訂單Row
Return CType(Me.NewRow,訂單Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 訂單Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(訂單Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.訂單RowChangedEvent) Is Nothing) Then
RaiseEvent 訂單RowChanged(Me, New 訂單RowChangeEvent(CType(e.Row,訂單Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.訂單RowChangingEvent) Is Nothing) Then
RaiseEvent 訂單RowChanging(Me, New 訂單RowChangeEvent(CType(e.Row,訂單Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.訂單RowDeletedEvent) Is Nothing) Then
RaiseEvent 訂單RowDeleted(Me, New 訂單RowChangeEvent(CType(e.Row,訂單Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.訂單RowDeletingEvent) Is Nothing) Then
RaiseEvent 訂單RowDeleting(Me, New 訂單RowChangeEvent(CType(e.Row,訂單Row), e.Action))
End If
End Sub
_
Public Sub Remove訂單Row(ByVal row As 訂單Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "訂單DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 購物車DataTable
Inherits Global.System.Data.TypedTableBase(Of 購物車Row)
Private column會員編號 As Global.System.Data.DataColumn
Private column運費 As Global.System.Data.DataColumn
Private column總金額 As Global.System.Data.DataColumn
Private column購物車編號 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "購物車"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 會員編號Column() As Global.System.Data.DataColumn
Get
Return Me.column會員編號
End Get
End Property
_
Public ReadOnly Property 運費Column() As Global.System.Data.DataColumn
Get
Return Me.column運費
End Get
End Property
_
Public ReadOnly Property 總金額Column() As Global.System.Data.DataColumn
Get
Return Me.column總金額
End Get
End Property
_
Public ReadOnly Property 購物車編號Column() As Global.System.Data.DataColumn
Get
Return Me.column購物車編號
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 購物車Row
Get
Return CType(Me.Rows(index),購物車Row)
End Get
End Property
_
Public Event 購物車RowChanging As 購物車RowChangeEventHandler
_
Public Event 購物車RowChanged As 購物車RowChangeEventHandler
_
Public Event 購物車RowDeleting As 購物車RowChangeEventHandler
_
Public Event 購物車RowDeleted As 購物車RowChangeEventHandler
_
Public Overloads Sub Add購物車Row(ByVal row As 購物車Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add購物車Row(ByVal 會員編號 As String, ByVal 運費 As String, ByVal 總金額 As String, ByVal 購物車編號 As String) As 購物車Row
Dim row購物車Row As 購物車Row = CType(Me.NewRow,購物車Row)
Dim columnValuesArray() As Object = New Object() {會員編號, 運費, 總金額, 購物車編號}
row購物車Row.ItemArray = columnValuesArray
Me.Rows.Add(row購物車Row)
Return row購物車Row
End Function
_
Public Function FindBy會員編號(ByVal 會員編號 As String) As 購物車Row
Return CType(Me.Rows.Find(New Object() {會員編號}),購物車Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 購物車DataTable = CType(MyBase.Clone,購物車DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 購物車DataTable()
End Function
_
Friend Sub InitVars()
Me.column會員編號 = MyBase.Columns("會員編號")
Me.column運費 = MyBase.Columns("運費")
Me.column總金額 = MyBase.Columns("總金額")
Me.column購物車編號 = MyBase.Columns("購物車編號")
End Sub
_
Private Sub InitClass()
Me.column會員編號 = New Global.System.Data.DataColumn("會員編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column會員編號)
Me.column運費 = New Global.System.Data.DataColumn("運費", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column運費)
Me.column總金額 = New Global.System.Data.DataColumn("總金額", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column總金額)
Me.column購物車編號 = New Global.System.Data.DataColumn("購物車編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column購物車編號)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column會員編號}, true))
Me.column會員編號.AllowDBNull = false
Me.column會員編號.Unique = true
Me.column會員編號.MaxLength = 50
Me.column運費.MaxLength = 50
Me.column總金額.MaxLength = 50
Me.column購物車編號.MaxLength = 50
End Sub
_
Public Function New購物車Row() As 購物車Row
Return CType(Me.NewRow,購物車Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 購物車Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(購物車Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.購物車RowChangedEvent) Is Nothing) Then
RaiseEvent 購物車RowChanged(Me, New 購物車RowChangeEvent(CType(e.Row,購物車Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.購物車RowChangingEvent) Is Nothing) Then
RaiseEvent 購物車RowChanging(Me, New 購物車RowChangeEvent(CType(e.Row,購物車Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.購物車RowDeletedEvent) Is Nothing) Then
RaiseEvent 購物車RowDeleted(Me, New 購物車RowChangeEvent(CType(e.Row,購物車Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.購物車RowDeletingEvent) Is Nothing) Then
RaiseEvent 購物車RowDeleting(Me, New 購物車RowChangeEvent(CType(e.Row,購物車Row), e.Action))
End If
End Sub
_
Public Sub Remove購物車Row(ByVal row As 購物車Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "購物車DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 紀錄DataTable
Inherits Global.System.Data.TypedTableBase(Of 紀錄Row)
Private column訂單編號 As Global.System.Data.DataColumn
Private column商品編號 As Global.System.Data.DataColumn
Private column訂購數量 As Global.System.Data.DataColumn
Private column價錢 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "紀錄"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 訂單編號Column() As Global.System.Data.DataColumn
Get
Return Me.column訂單編號
End Get
End Property
_
Public ReadOnly Property 商品編號Column() As Global.System.Data.DataColumn
Get
Return Me.column商品編號
End Get
End Property
_
Public ReadOnly Property 訂購數量Column() As Global.System.Data.DataColumn
Get
Return Me.column訂購數量
End Get
End Property
_
Public ReadOnly Property 價錢Column() As Global.System.Data.DataColumn
Get
Return Me.column價錢
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 紀錄Row
Get
Return CType(Me.Rows(index),紀錄Row)
End Get
End Property
_
Public Event 紀錄RowChanging As 紀錄RowChangeEventHandler
_
Public Event 紀錄RowChanged As 紀錄RowChangeEventHandler
_
Public Event 紀錄RowDeleting As 紀錄RowChangeEventHandler
_
Public Event 紀錄RowDeleted As 紀錄RowChangeEventHandler
_
Public Overloads Sub Add紀錄Row(ByVal row As 紀錄Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add紀錄Row(ByVal 訂單編號 As String, ByVal 商品編號 As String, ByVal 訂購數量 As String, ByVal 價錢 As String) As 紀錄Row
Dim row紀錄Row As 紀錄Row = CType(Me.NewRow,紀錄Row)
Dim columnValuesArray() As Object = New Object() {訂單編號, 商品編號, 訂購數量, 價錢}
row紀錄Row.ItemArray = columnValuesArray
Me.Rows.Add(row紀錄Row)
Return row紀錄Row
End Function
_
Public Function FindBy訂單編號(ByVal 訂單編號 As String) As 紀錄Row
Return CType(Me.Rows.Find(New Object() {訂單編號}),紀錄Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 紀錄DataTable = CType(MyBase.Clone,紀錄DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 紀錄DataTable()
End Function
_
Friend Sub InitVars()
Me.column訂單編號 = MyBase.Columns("訂單編號")
Me.column商品編號 = MyBase.Columns("商品編號")
Me.column訂購數量 = MyBase.Columns("訂購數量")
Me.column價錢 = MyBase.Columns("價錢")
End Sub
_
Private Sub InitClass()
Me.column訂單編號 = New Global.System.Data.DataColumn("訂單編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column訂單編號)
Me.column商品編號 = New Global.System.Data.DataColumn("商品編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column商品編號)
Me.column訂購數量 = New Global.System.Data.DataColumn("訂購數量", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column訂購數量)
Me.column價錢 = New Global.System.Data.DataColumn("價錢", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column價錢)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column訂單編號}, true))
Me.column訂單編號.AllowDBNull = false
Me.column訂單編號.Unique = true
Me.column訂單編號.MaxLength = 50
Me.column商品編號.MaxLength = 50
Me.column訂購數量.MaxLength = 50
Me.column價錢.MaxLength = 50
End Sub
_
Public Function New紀錄Row() As 紀錄Row
Return CType(Me.NewRow,紀錄Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 紀錄Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(紀錄Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.紀錄RowChangedEvent) Is Nothing) Then
RaiseEvent 紀錄RowChanged(Me, New 紀錄RowChangeEvent(CType(e.Row,紀錄Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.紀錄RowChangingEvent) Is Nothing) Then
RaiseEvent 紀錄RowChanging(Me, New 紀錄RowChangeEvent(CType(e.Row,紀錄Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.紀錄RowDeletedEvent) Is Nothing) Then
RaiseEvent 紀錄RowDeleted(Me, New 紀錄RowChangeEvent(CType(e.Row,紀錄Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.紀錄RowDeletingEvent) Is Nothing) Then
RaiseEvent 紀錄RowDeleting(Me, New 紀錄RowChangeEvent(CType(e.Row,紀錄Row), e.Action))
End If
End Sub
_
Public Sub Remove紀錄Row(ByVal row As 紀錄Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "紀錄DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents the strongly named DataTable class.
'''
_
Partial Public Class 訂購DataTable
Inherits Global.System.Data.TypedTableBase(Of 訂購Row)
Private column會員編號 As Global.System.Data.DataColumn
Private column商品編號 As Global.System.Data.DataColumn
Private column訂購數量 As Global.System.Data.DataColumn
_
Public Sub New()
MyBase.New
Me.TableName = "訂購"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub
_
Friend Sub New(ByVal table As Global.System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub
_
Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub
_
Public ReadOnly Property 會員編號Column() As Global.System.Data.DataColumn
Get
Return Me.column會員編號
End Get
End Property
_
Public ReadOnly Property 商品編號Column() As Global.System.Data.DataColumn
Get
Return Me.column商品編號
End Get
End Property
_
Public ReadOnly Property 訂購數量Column() As Global.System.Data.DataColumn
Get
Return Me.column訂購數量
End Get
End Property
_
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property
_
Public Default ReadOnly Property Item(ByVal index As Integer) As 訂購Row
Get
Return CType(Me.Rows(index),訂購Row)
End Get
End Property
_
Public Event 訂購RowChanging As 訂購RowChangeEventHandler
_
Public Event 訂購RowChanged As 訂購RowChangeEventHandler
_
Public Event 訂購RowDeleting As 訂購RowChangeEventHandler
_
Public Event 訂購RowDeleted As 訂購RowChangeEventHandler
_
Public Overloads Sub Add訂購Row(ByVal row As 訂購Row)
Me.Rows.Add(row)
End Sub
_
Public Overloads Function Add訂購Row(ByVal 會員編號 As String, ByVal 商品編號 As String, ByVal 訂購數量 As String) As 訂購Row
Dim row訂購Row As 訂購Row = CType(Me.NewRow,訂購Row)
Dim columnValuesArray() As Object = New Object() {會員編號, 商品編號, 訂購數量}
row訂購Row.ItemArray = columnValuesArray
Me.Rows.Add(row訂購Row)
Return row訂購Row
End Function
_
Public Function FindBy會員編號(ByVal 會員編號 As String) As 訂購Row
Return CType(Me.Rows.Find(New Object() {會員編號}),訂購Row)
End Function
_
Public Overrides Function Clone() As Global.System.Data.DataTable
Dim cln As 訂購DataTable = CType(MyBase.Clone,訂購DataTable)
cln.InitVars
Return cln
End Function
_
Protected Overrides Function CreateInstance() As Global.System.Data.DataTable
Return New 訂購DataTable()
End Function
_
Friend Sub InitVars()
Me.column會員編號 = MyBase.Columns("會員編號")
Me.column商品編號 = MyBase.Columns("商品編號")
Me.column訂購數量 = MyBase.Columns("訂購數量")
End Sub
_
Private Sub InitClass()
Me.column會員編號 = New Global.System.Data.DataColumn("會員編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column會員編號)
Me.column商品編號 = New Global.System.Data.DataColumn("商品編號", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column商品編號)
Me.column訂購數量 = New Global.System.Data.DataColumn("訂購數量", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.column訂購數量)
Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.column會員編號}, true))
Me.column會員編號.AllowDBNull = false
Me.column會員編號.Unique = true
Me.column會員編號.MaxLength = 50
Me.column商品編號.MaxLength = 50
Me.column訂購數量.MaxLength = 50
End Sub
_
Public Function New訂購Row() As 訂購Row
Return CType(Me.NewRow,訂購Row)
End Function
_
Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow
Return New 訂購Row(builder)
End Function
_
Protected Overrides Function GetRowType() As Global.System.Type
Return GetType(訂購Row)
End Function
_
Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.訂購RowChangedEvent) Is Nothing) Then
RaiseEvent 訂購RowChanged(Me, New 訂購RowChangeEvent(CType(e.Row,訂購Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.訂購RowChangingEvent) Is Nothing) Then
RaiseEvent 訂購RowChanging(Me, New 訂購RowChangeEvent(CType(e.Row,訂購Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.訂購RowDeletedEvent) Is Nothing) Then
RaiseEvent 訂購RowDeleted(Me, New 訂購RowChangeEvent(CType(e.Row,訂購Row), e.Action))
End If
End Sub
_
Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.訂購RowDeletingEvent) Is Nothing) Then
RaiseEvent 訂購RowDeleting(Me, New 訂購RowChangeEvent(CType(e.Row,訂購Row), e.Action))
End If
End Sub
_
Public Sub Remove訂購Row(ByVal row As 訂購Row)
Me.Rows.Remove(row)
End Sub
_
Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType
Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType()
Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence()
Dim ds As 謎鹿DataSet = New 謎鹿DataSet()
Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny()
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute()
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "訂購DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable
If xs.Contains(dsSchema.TargetNamespace) Then
Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream()
Try
Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing
dsSchema.Write(s1)
Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator
Do While schemas.MoveNext
schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema)
s2.SetLength(0)
schema.Write(s2)
If (s1.Length = s2.Length) Then
s1.Position = 0
s2.Position = 0
Do While ((s1.Position <> s1.Length) _
AndAlso (s1.ReadByte = s2.ReadByte))
Loop
If (s1.Position = s1.Length) Then
Return type
End If
End If
Loop
Finally
If (Not (s1) Is Nothing) Then
s1.Close
End If
If (Not (s2) Is Nothing) Then
s2.Close
End If
End Try
End If
xs.Add(dsSchema)
Return type
End Function
End Class
'''
'''Represents strongly named DataRow class.
'''
Partial Public Class 商品Row
Inherits Global.System.Data.DataRow
Private table商品 As 商品DataTable
_
Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
MyBase.New(rb)
Me.table商品 = CType(Me.Table,商品DataTable)
End Sub
_
Public Property 商品編號() As String
Get
Return CType(Me(Me.table商品.商品編號Column),String)
End Get
Set
Me(Me.table商品.商品編號Column) = value
End Set
End Property
_
Public Property 商品名稱() As String
Get
Try
Return CType(Me(Me.table商品.商品名稱Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '商品' 中資料行 '商品名稱' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品.商品名稱Column) = value
End Set
End Property
_
Public Property 庫存數量() As String
Get
Try
Return CType(Me(Me.table商品.庫存數量Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '商品' 中資料行 '庫存數量' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品.庫存數量Column) = value
End Set
End Property
_
Public Property 定價() As String
Get
Try
Return CType(Me(Me.table商品.定價Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '商品' 中資料行 '定價' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品.定價Column) = value
End Set
End Property
_
Public Property 種類() As String
Get
Try
Return CType(Me(Me.table商品.種類Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '商品' 中資料行 '種類' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品.種類Column) = value
End Set
End Property
_
Public Property 管理者編號() As String
Get
Try
Return CType(Me(Me.table商品.管理者編號Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '商品' 中資料行 '管理者編號' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品.管理者編號Column) = value
End Set
End Property
_
Public Function Is商品名稱Null() As Boolean
Return Me.IsNull(Me.table商品.商品名稱Column)
End Function
_
Public Sub Set商品名稱Null()
Me(Me.table商品.商品名稱Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is庫存數量Null() As Boolean
Return Me.IsNull(Me.table商品.庫存數量Column)
End Function
_
Public Sub Set庫存數量Null()
Me(Me.table商品.庫存數量Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is定價Null() As Boolean
Return Me.IsNull(Me.table商品.定價Column)
End Function
_
Public Sub Set定價Null()
Me(Me.table商品.定價Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is種類Null() As Boolean
Return Me.IsNull(Me.table商品.種類Column)
End Function
_
Public Sub Set種類Null()
Me(Me.table商品.種類Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is管理者編號Null() As Boolean
Return Me.IsNull(Me.table商品.管理者編號Column)
End Function
_
Public Sub Set管理者編號Null()
Me(Me.table商品.管理者編號Column) = Global.System.Convert.DBNull
End Sub
End Class
'''
'''Represents strongly named DataRow class.
'''
Partial Public Class 會員Row
Inherits Global.System.Data.DataRow
Private table會員 As 會員DataTable
_
Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
MyBase.New(rb)
Me.table會員 = CType(Me.Table,會員DataTable)
End Sub
_
Public Property 會員編號() As String
Get
Return CType(Me(Me.table會員.會員編號Column),String)
End Get
Set
Me(Me.table會員.會員編號Column) = value
End Set
End Property
_
Public Property 帳號() As String
Get
Try
Return CType(Me(Me.table會員.帳號Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 '帳號' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.帳號Column) = value
End Set
End Property
_
Public Property 密碼() As String
Get
Try
Return CType(Me(Me.table會員.密碼Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 '密碼' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.密碼Column) = value
End Set
End Property
_
Public Property 姓名() As String
Get
Try
Return CType(Me(Me.table會員.姓名Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 '姓名' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.姓名Column) = value
End Set
End Property
_
Public Property 電話() As String
Get
Try
Return CType(Me(Me.table會員.電話Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 '電話' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.電話Column) = value
End Set
End Property
_
Public Property 住址() As String
Get
Try
Return CType(Me(Me.table會員.住址Column),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 '住址' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.住址Column) = value
End Set
End Property
_
Public Property email() As String
Get
Try
Return CType(Me(Me.table會員.emailColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("資料表 '會員' 中資料行 'email' 的值是 DBNull。", e)
End Try
End Get
Set
Me(Me.table會員.emailColumn) = value
End Set
End Property
_
Public Function Is帳號Null() As Boolean
Return Me.IsNull(Me.table會員.帳號Column)
End Function
_
Public Sub Set帳號Null()
Me(Me.table會員.帳號Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is密碼Null() As Boolean
Return Me.IsNull(Me.table會員.密碼Column)
End Function
_
Public Sub Set密碼Null()
Me(Me.table會員.密碼Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is姓名Null() As Boolean
Return Me.IsNull(Me.table會員.姓名Column)
End Function
_
Public Sub Set姓名Null()
Me(Me.table會員.姓名Column) = Global.System.Convert.DBNull
End Sub
_
Public Function Is電話Null() As Boolean
Return Me.IsNull(Me.table會員.電話Column)
End Function
_
Public Sub Set電話Null()
Me(Me.table會員.電話Column) = Global.System.Convert.DBNull
End Sub