📄 da.vb
字号:
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 String, ByVal 加分 As String, ByVal 备注 As String) 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, ByVal 学号 As String, 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("事务")
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.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.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column备注)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.column日期, Me.column学号, Me.column事务}, true))
Me.column日期.AllowDBNull = false
Me.column学号.AllowDBNull = false
Me.column事务.AllowDBNull = false
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
Return CType(Me(Me.table公益活动.学号Column),String)
End Get
Set
Me(Me.table公益活动.学号Column) = value
End Set
End Property
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 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 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
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
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 String, ByVal 经手人 As String, ByVal 备注 As String) 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, ByVal 事务 As String) As 费用支出Row
Return CType(Me.Rows.Find(New Object() {日期, 事务}),费用支出Row)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -