📄 dsar280.vb
字号:
Public Overloads Function AddAR280Row(ByVal CustomerID As String, ByVal CustomerAttribName As String, ByVal CreditLine As Decimal, ByVal CreditBalance As Decimal, ByVal OverCredit As Decimal) As AR280Row
Dim rowAR280Row As AR280Row = CType(Me.NewRow,AR280Row)
rowAR280Row.ItemArray = New Object() {CustomerID, CustomerAttribName, CreditLine, CreditBalance, OverCredit}
Me.Rows.Add(rowAR280Row)
Return rowAR280Row
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 AR280DataTable = CType(MyBase.Clone,AR280DataTable)
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnCustomerID = Me.Columns("CustomerID")
Me.columnCustomerAttribName = Me.Columns("CustomerAttribName")
Me.columnCreditLine = Me.Columns("CreditLine")
Me.columnCreditBalance = Me.Columns("CreditBalance")
Me.columnOverCredit = Me.Columns("OverCredit")
End Sub
Private Sub InitClass()
Me.columnCustomerID = New DataColumn("CustomerID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCustomerID)
Me.columnCustomerAttribName = New DataColumn("CustomerAttribName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCustomerAttribName)
Me.columnCreditLine = New DataColumn("CreditLine", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCreditLine)
Me.columnCreditBalance = New DataColumn("CreditBalance", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCreditBalance)
Me.columnOverCredit = New DataColumn("OverCredit", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnOverCredit)
End Sub
Public Function NewAR280Row() As AR280Row
Return CType(Me.NewRow,AR280Row)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New AR280Row(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(AR280Row)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.AR280RowChangedEvent) Is Nothing) Then
RaiseEvent AR280RowChanged(Me, New AR280RowChangeEvent(CType(e.Row,AR280Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.AR280RowChangingEvent) Is Nothing) Then
RaiseEvent AR280RowChanging(Me, New AR280RowChangeEvent(CType(e.Row,AR280Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.AR280RowDeletedEvent) Is Nothing) Then
RaiseEvent AR280RowDeleted(Me, New AR280RowChangeEvent(CType(e.Row,AR280Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.AR280RowDeletingEvent) Is Nothing) Then
RaiseEvent AR280RowDeleting(Me, New AR280RowChangeEvent(CType(e.Row,AR280Row), e.Action))
End If
End Sub
Public Sub RemoveAR280Row(ByVal row As AR280Row)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class AR280Row
Inherits DataRow
Private tableAR280 As AR280DataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableAR280 = CType(Me.Table,AR280DataTable)
End Sub
Public Property CustomerID As String
Get
Try
Return CType(Me(Me.tableAR280.CustomerIDColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableAR280.CustomerIDColumn) = value
End Set
End Property
Public Property CustomerAttribName As String
Get
Try
Return CType(Me(Me.tableAR280.CustomerAttribNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableAR280.CustomerAttribNameColumn) = value
End Set
End Property
Public Property CreditLine As Decimal
Get
Try
Return CType(Me(Me.tableAR280.CreditLineColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableAR280.CreditLineColumn) = value
End Set
End Property
Public Property CreditBalance As Decimal
Get
Try
Return CType(Me(Me.tableAR280.CreditBalanceColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableAR280.CreditBalanceColumn) = value
End Set
End Property
Public Property OverCredit As Decimal
Get
Try
Return CType(Me(Me.tableAR280.OverCreditColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableAR280.OverCreditColumn) = value
End Set
End Property
Public Function IsCustomerIDNull() As Boolean
Return Me.IsNull(Me.tableAR280.CustomerIDColumn)
End Function
Public Sub SetCustomerIDNull()
Me(Me.tableAR280.CustomerIDColumn) = System.Convert.DBNull
End Sub
Public Function IsCustomerAttribNameNull() As Boolean
Return Me.IsNull(Me.tableAR280.CustomerAttribNameColumn)
End Function
Public Sub SetCustomerAttribNameNull()
Me(Me.tableAR280.CustomerAttribNameColumn) = System.Convert.DBNull
End Sub
Public Function IsCreditLineNull() As Boolean
Return Me.IsNull(Me.tableAR280.CreditLineColumn)
End Function
Public Sub SetCreditLineNull()
Me(Me.tableAR280.CreditLineColumn) = System.Convert.DBNull
End Sub
Public Function IsCreditBalanceNull() As Boolean
Return Me.IsNull(Me.tableAR280.CreditBalanceColumn)
End Function
Public Sub SetCreditBalanceNull()
Me(Me.tableAR280.CreditBalanceColumn) = System.Convert.DBNull
End Sub
Public Function IsOverCreditNull() As Boolean
Return Me.IsNull(Me.tableAR280.OverCreditColumn)
End Function
Public Sub SetOverCreditNull()
Me(Me.tableAR280.OverCreditColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class AR280RowChangeEvent
Inherits EventArgs
Private eventRow As AR280Row
Private eventAction As DataRowAction
Public Sub New(ByVal row As AR280Row, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As AR280Row
Get
Return Me.eventRow
End Get
End Property
Public ReadOnly Property Action As DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -