📄 dsdl220.vb
字号:
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnCustomerID = Me.Columns("CustomerID")
Me.columnProductID = Me.Columns("ProductID")
Me.columnCustomerAttribName = Me.Columns("CustomerAttribName")
Me.columnProductName = Me.Columns("ProductName")
Me.columnSAQty = Me.Columns("SAQty")
Me.columnSAAmount = Me.Columns("SAAmount")
Me.columnSRQty = Me.Columns("SRQty")
Me.columnSRAmount = Me.Columns("SRAmount")
End Sub
Private Sub InitClass()
Me.columnCustomerID = New DataColumn("CustomerID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCustomerID)
Me.columnProductID = New DataColumn("ProductID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnProductID)
Me.columnCustomerAttribName = New DataColumn("CustomerAttribName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCustomerAttribName)
Me.columnProductName = New DataColumn("ProductName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnProductName)
Me.columnSAQty = New DataColumn("SAQty", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSAQty)
Me.columnSAAmount = New DataColumn("SAAmount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSAAmount)
Me.columnSRQty = New DataColumn("SRQty", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSRQty)
Me.columnSRAmount = New DataColumn("SRAmount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSRAmount)
Me.Constraints.Add(New UniqueConstraint("dsDL220Key1", New DataColumn() {Me.columnCustomerID, Me.columnProductID}, false))
Me.columnCustomerID.AllowDBNull = false
Me.columnProductID.AllowDBNull = false
End Sub
Public Function NewDL220Row() As DL220Row
Return CType(Me.NewRow,DL220Row)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New DL220Row(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(DL220Row)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.DL220RowChangedEvent) Is Nothing) Then
RaiseEvent DL220RowChanged(Me, New DL220RowChangeEvent(CType(e.Row,DL220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.DL220RowChangingEvent) Is Nothing) Then
RaiseEvent DL220RowChanging(Me, New DL220RowChangeEvent(CType(e.Row,DL220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.DL220RowDeletedEvent) Is Nothing) Then
RaiseEvent DL220RowDeleted(Me, New DL220RowChangeEvent(CType(e.Row,DL220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.DL220RowDeletingEvent) Is Nothing) Then
RaiseEvent DL220RowDeleting(Me, New DL220RowChangeEvent(CType(e.Row,DL220Row), e.Action))
End If
End Sub
Public Sub RemoveDL220Row(ByVal row As DL220Row)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class DL220Row
Inherits DataRow
Private tableDL220 As DL220DataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableDL220 = CType(Me.Table,DL220DataTable)
End Sub
Public Property CustomerID As String
Get
Return CType(Me(Me.tableDL220.CustomerIDColumn),String)
End Get
Set
Me(Me.tableDL220.CustomerIDColumn) = value
End Set
End Property
Public Property ProductID As String
Get
Return CType(Me(Me.tableDL220.ProductIDColumn),String)
End Get
Set
Me(Me.tableDL220.ProductIDColumn) = value
End Set
End Property
Public Property CustomerAttribName As String
Get
Try
Return CType(Me(Me.tableDL220.CustomerAttribNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.CustomerAttribNameColumn) = value
End Set
End Property
Public Property ProductName As String
Get
Try
Return CType(Me(Me.tableDL220.ProductNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.ProductNameColumn) = value
End Set
End Property
Public Property SAQty As Decimal
Get
Try
Return CType(Me(Me.tableDL220.SAQtyColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.SAQtyColumn) = value
End Set
End Property
Public Property SAAmount As Decimal
Get
Try
Return CType(Me(Me.tableDL220.SAAmountColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.SAAmountColumn) = value
End Set
End Property
Public Property SRQty As Decimal
Get
Try
Return CType(Me(Me.tableDL220.SRQtyColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.SRQtyColumn) = value
End Set
End Property
Public Property SRAmount As Decimal
Get
Try
Return CType(Me(Me.tableDL220.SRAmountColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDL220.SRAmountColumn) = value
End Set
End Property
Public Function IsCustomerAttribNameNull() As Boolean
Return Me.IsNull(Me.tableDL220.CustomerAttribNameColumn)
End Function
Public Sub SetCustomerAttribNameNull()
Me(Me.tableDL220.CustomerAttribNameColumn) = System.Convert.DBNull
End Sub
Public Function IsProductNameNull() As Boolean
Return Me.IsNull(Me.tableDL220.ProductNameColumn)
End Function
Public Sub SetProductNameNull()
Me(Me.tableDL220.ProductNameColumn) = System.Convert.DBNull
End Sub
Public Function IsSAQtyNull() As Boolean
Return Me.IsNull(Me.tableDL220.SAQtyColumn)
End Function
Public Sub SetSAQtyNull()
Me(Me.tableDL220.SAQtyColumn) = System.Convert.DBNull
End Sub
Public Function IsSAAmountNull() As Boolean
Return Me.IsNull(Me.tableDL220.SAAmountColumn)
End Function
Public Sub SetSAAmountNull()
Me(Me.tableDL220.SAAmountColumn) = System.Convert.DBNull
End Sub
Public Function IsSRQtyNull() As Boolean
Return Me.IsNull(Me.tableDL220.SRQtyColumn)
End Function
Public Sub SetSRQtyNull()
Me(Me.tableDL220.SRQtyColumn) = System.Convert.DBNull
End Sub
Public Function IsSRAmountNull() As Boolean
Return Me.IsNull(Me.tableDL220.SRAmountColumn)
End Function
Public Sub SetSRAmountNull()
Me(Me.tableDL220.SRAmountColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class DL220RowChangeEvent
Inherits EventArgs
Private eventRow As DL220Row
Private eventAction As DataRowAction
Public Sub New(ByVal row As DL220Row, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As DL220Row
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 + -