📄 dataset1.vb
字号:
Me.InitClass
End Sub
Friend Sub New(ByVal table As DataTable)
MyBase.New(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
Me.DisplayExpression = table.DisplayExpression
End Sub
<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count As Integer
Get
Return Me.Rows.Count
End Get
End Property
Friend ReadOnly Property 类型编号Column As DataColumn
Get
Return Me.column类型编号
End Get
End Property
Friend ReadOnly Property 类型名称Column As DataColumn
Get
Return Me.column类型名称
End Get
End Property
Friend ReadOnly Property 可借天数Column As DataColumn
Get
Return Me.column可借天数
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 图书类型RowChanged As 图书类型RowChangeEventHandler
Public Event 图书类型RowChanging As 图书类型RowChangeEventHandler
Public Event 图书类型RowDeleted As 图书类型RowChangeEventHandler
Public Event 图书类型RowDeleting 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 Integer) As 图书类型Row
Dim row图书类型Row As 图书类型Row = CType(Me.NewRow,图书类型Row)
row图书类型Row.ItemArray = New Object() {类型编号, 类型名称, 可借天数}
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 Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function
Public Overrides Function Clone() As DataTable
Dim cln As 图书类型DataTable = CType(MyBase.Clone,图书类型DataTable)
cln.InitVars
Return cln
End Function
Protected Overrides Function CreateInstance() As DataTable
Return New 图书类型DataTable
End Function
Friend Sub InitVars()
Me.column类型编号 = Me.Columns("类型编号")
Me.column类型名称 = Me.Columns("类型名称")
Me.column可借天数 = Me.Columns("可借天数")
End Sub
Private Sub InitClass()
Me.column类型编号 = New DataColumn("类型编号", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column类型编号)
Me.column类型名称 = New DataColumn("类型名称", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column类型名称)
Me.column可借天数 = New DataColumn("可借天数", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column可借天数)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.column类型编号}, true))
Me.column类型编号.AllowDBNull = false
Me.column类型编号.Unique = true
End Sub
Public Function New图书类型Row() As 图书类型Row
Return CType(Me.NewRow,图书类型Row)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New 图书类型Row(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(图书类型Row)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As 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 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 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 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
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class 图书类型Row
Inherits DataRow
Private table图书类型 As 图书类型DataTable
Friend Sub New(ByVal rb As 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 InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table图书类型.类型名称Column) = value
End Set
End Property
Public Property 可借天数 As Integer
Get
Try
Return CType(Me(Me.table图书类型.可借天数Column),Integer)
Catch e As InvalidCastException
Throw New 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) = 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) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class 图书类型RowChangeEvent
Inherits EventArgs
Private eventRow As 图书类型Row
Private eventAction As DataRowAction
Public Sub New(ByVal row As 图书类型Row, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As 图书类型Row
Get
Return Me.eventRow
End Get
End Property
Public ReadOnly Property Action As DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class 图书征订DataTable
Inherits DataTable
Implements System.Collections.IEnumerable
Private column征订编号 As DataColumn
Private column图书编号 As DataColumn
Private column订购者 As DataColumn
Private column订购数量 As DataColumn
Private column订购单价 As DataColumn
Private column订购日期 As DataColumn
Private column订购者联系方式 As DataColumn
Private column操作员 As DataColumn
Private column是否验收 As DataColumn
Private column验收日期 As DataColumn
Friend Sub New()
MyBase.New("图书征订")
Me.InitClass
End Sub
Friend Sub New(ByVal table As DataTable)
MyBase.New(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
Me.DisplayExpression = table.DisplayExpression
End Sub
<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count As Integer
Get
Return Me.Rows.Count
End Get
End Property
Friend ReadOnly Property 征订编号Column As DataColumn
Get
Return Me.column征订编号
End Get
End Property
Friend ReadOnly Property 图书编号Column As DataColumn
Get
Return Me.column图书编号
End Get
End Property
Friend ReadOnly Property 订购者Column As DataColumn
Get
Return Me.column订购者
End Get
End Property
Friend ReadOnly Property 订购数量Column As DataColumn
Get
Return Me.column订购数量
End Get
End Property
Friend ReadOnly Property 订购单价Column As DataColumn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -