📄 dspr220.vb
字号:
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnSupplierID = Me.Columns("SupplierID")
Me.columnProductID = Me.Columns("ProductID")
Me.columnSupplierAttribName = Me.Columns("SupplierAttribName")
Me.columnProductName = Me.Columns("ProductName")
Me.columnPAQty = Me.Columns("PAQty")
Me.columnPAAmount = Me.Columns("PAAmount")
Me.columnPRQty = Me.Columns("PRQty")
Me.columnPRAmount = Me.Columns("PRAmount")
End Sub
Private Sub InitClass()
Me.columnSupplierID = New DataColumn("SupplierID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSupplierID)
Me.columnProductID = New DataColumn("ProductID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnProductID)
Me.columnSupplierAttribName = New DataColumn("SupplierAttribName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSupplierAttribName)
Me.columnProductName = New DataColumn("ProductName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnProductName)
Me.columnPAQty = New DataColumn("PAQty", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPAQty)
Me.columnPAAmount = New DataColumn("PAAmount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPAAmount)
Me.columnPRQty = New DataColumn("PRQty", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPRQty)
Me.columnPRAmount = New DataColumn("PRAmount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPRAmount)
Me.Constraints.Add(New UniqueConstraint("dsPR220Key1", New DataColumn() {Me.columnSupplierID, Me.columnProductID}, false))
Me.columnSupplierID.AllowDBNull = false
Me.columnProductID.AllowDBNull = false
End Sub
Public Function NewPR220Row() As PR220Row
Return CType(Me.NewRow,PR220Row)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New PR220Row(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(PR220Row)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.PR220RowChangedEvent) Is Nothing) Then
RaiseEvent PR220RowChanged(Me, New PR220RowChangeEvent(CType(e.Row,PR220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.PR220RowChangingEvent) Is Nothing) Then
RaiseEvent PR220RowChanging(Me, New PR220RowChangeEvent(CType(e.Row,PR220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.PR220RowDeletedEvent) Is Nothing) Then
RaiseEvent PR220RowDeleted(Me, New PR220RowChangeEvent(CType(e.Row,PR220Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.PR220RowDeletingEvent) Is Nothing) Then
RaiseEvent PR220RowDeleting(Me, New PR220RowChangeEvent(CType(e.Row,PR220Row), e.Action))
End If
End Sub
Public Sub RemovePR220Row(ByVal row As PR220Row)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class PR220Row
Inherits DataRow
Private tablePR220 As PR220DataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tablePR220 = CType(Me.Table,PR220DataTable)
End Sub
Public Property SupplierID As String
Get
Return CType(Me(Me.tablePR220.SupplierIDColumn),String)
End Get
Set
Me(Me.tablePR220.SupplierIDColumn) = value
End Set
End Property
Public Property ProductID As String
Get
Return CType(Me(Me.tablePR220.ProductIDColumn),String)
End Get
Set
Me(Me.tablePR220.ProductIDColumn) = value
End Set
End Property
Public Property SupplierAttribName As String
Get
Try
Return CType(Me(Me.tablePR220.SupplierAttribNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.SupplierAttribNameColumn) = value
End Set
End Property
Public Property ProductName As String
Get
Try
Return CType(Me(Me.tablePR220.ProductNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.ProductNameColumn) = value
End Set
End Property
Public Property PAQty As Decimal
Get
Try
Return CType(Me(Me.tablePR220.PAQtyColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.PAQtyColumn) = value
End Set
End Property
Public Property PAAmount As Decimal
Get
Try
Return CType(Me(Me.tablePR220.PAAmountColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.PAAmountColumn) = value
End Set
End Property
Public Property PRQty As Decimal
Get
Try
Return CType(Me(Me.tablePR220.PRQtyColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.PRQtyColumn) = value
End Set
End Property
Public Property PRAmount As Decimal
Get
Try
Return CType(Me(Me.tablePR220.PRAmountColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablePR220.PRAmountColumn) = value
End Set
End Property
Public Function IsSupplierAttribNameNull() As Boolean
Return Me.IsNull(Me.tablePR220.SupplierAttribNameColumn)
End Function
Public Sub SetSupplierAttribNameNull()
Me(Me.tablePR220.SupplierAttribNameColumn) = System.Convert.DBNull
End Sub
Public Function IsProductNameNull() As Boolean
Return Me.IsNull(Me.tablePR220.ProductNameColumn)
End Function
Public Sub SetProductNameNull()
Me(Me.tablePR220.ProductNameColumn) = System.Convert.DBNull
End Sub
Public Function IsPAQtyNull() As Boolean
Return Me.IsNull(Me.tablePR220.PAQtyColumn)
End Function
Public Sub SetPAQtyNull()
Me(Me.tablePR220.PAQtyColumn) = System.Convert.DBNull
End Sub
Public Function IsPAAmountNull() As Boolean
Return Me.IsNull(Me.tablePR220.PAAmountColumn)
End Function
Public Sub SetPAAmountNull()
Me(Me.tablePR220.PAAmountColumn) = System.Convert.DBNull
End Sub
Public Function IsPRQtyNull() As Boolean
Return Me.IsNull(Me.tablePR220.PRQtyColumn)
End Function
Public Sub SetPRQtyNull()
Me(Me.tablePR220.PRQtyColumn) = System.Convert.DBNull
End Sub
Public Function IsPRAmountNull() As Boolean
Return Me.IsNull(Me.tablePR220.PRAmountColumn)
End Function
Public Sub SetPRAmountNull()
Me(Me.tablePR220.PRAmountColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class PR220RowChangeEvent
Inherits EventArgs
Private eventRow As PR220Row
Private eventAction As DataRowAction
Public Sub New(ByVal row As PR220Row, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As PR220Row
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 + -