📄 dsselectdelivery.vb
字号:
Get
Return CType(Me.Rows(index),DeliveryMasterRow)
End Get
End Property
Public Event DeliveryMasterRowChanged As DeliveryMasterRowChangeEventHandler
Public Event DeliveryMasterRowChanging As DeliveryMasterRowChangeEventHandler
Public Event DeliveryMasterRowDeleted As DeliveryMasterRowChangeEventHandler
Public Event DeliveryMasterRowDeleting As DeliveryMasterRowChangeEventHandler
Public Overloads Sub AddDeliveryMasterRow(ByVal row As DeliveryMasterRow)
Me.Rows.Add(row)
End Sub
Public Overloads Function AddDeliveryMasterRow(ByVal DeliveryID As String, ByVal DeliveryDate As Date, ByVal DeliveryProperty As String, ByVal AccountReceivable As Decimal, ByVal Received As Decimal, ByVal LimitDate As Date) As DeliveryMasterRow
Dim rowDeliveryMasterRow As DeliveryMasterRow = CType(Me.NewRow,DeliveryMasterRow)
rowDeliveryMasterRow.ItemArray = New Object() {DeliveryID, DeliveryDate, DeliveryProperty, AccountReceivable, Received, LimitDate}
Me.Rows.Add(rowDeliveryMasterRow)
Return rowDeliveryMasterRow
End Function
Public Function FindByDeliveryID(ByVal DeliveryID As String) As DeliveryMasterRow
Return CType(Me.Rows.Find(New Object() {DeliveryID}),DeliveryMasterRow)
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 DeliveryMasterDataTable = CType(MyBase.Clone,DeliveryMasterDataTable)
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnDeliveryID = Me.Columns("DeliveryID")
Me.columnDeliveryDate = Me.Columns("DeliveryDate")
Me.columnDeliveryProperty = Me.Columns("DeliveryProperty")
Me.columnAccountReceivable = Me.Columns("AccountReceivable")
Me.columnReceived = Me.Columns("Received")
Me.columnLimitDate = Me.Columns("LimitDate")
End Sub
Private Sub InitClass()
Me.columnDeliveryID = New DataColumn("DeliveryID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnDeliveryID)
Me.columnDeliveryDate = New DataColumn("DeliveryDate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnDeliveryDate)
Me.columnDeliveryProperty = New DataColumn("DeliveryProperty", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnDeliveryProperty)
Me.columnAccountReceivable = New DataColumn("AccountReceivable", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnAccountReceivable)
Me.columnReceived = New DataColumn("Received", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnReceived)
Me.columnLimitDate = New DataColumn("LimitDate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnLimitDate)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnDeliveryID}, true))
Me.columnDeliveryID.AllowDBNull = false
Me.columnDeliveryID.Unique = true
Me.columnDeliveryDate.AllowDBNull = false
Me.columnDeliveryProperty.AllowDBNull = false
Me.columnAccountReceivable.AllowDBNull = false
Me.columnReceived.AllowDBNull = false
End Sub
Public Function NewDeliveryMasterRow() As DeliveryMasterRow
Return CType(Me.NewRow,DeliveryMasterRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New DeliveryMasterRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(DeliveryMasterRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.DeliveryMasterRowChangedEvent) Is Nothing) Then
RaiseEvent DeliveryMasterRowChanged(Me, New DeliveryMasterRowChangeEvent(CType(e.Row,DeliveryMasterRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.DeliveryMasterRowChangingEvent) Is Nothing) Then
RaiseEvent DeliveryMasterRowChanging(Me, New DeliveryMasterRowChangeEvent(CType(e.Row,DeliveryMasterRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.DeliveryMasterRowDeletedEvent) Is Nothing) Then
RaiseEvent DeliveryMasterRowDeleted(Me, New DeliveryMasterRowChangeEvent(CType(e.Row,DeliveryMasterRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.DeliveryMasterRowDeletingEvent) Is Nothing) Then
RaiseEvent DeliveryMasterRowDeleting(Me, New DeliveryMasterRowChangeEvent(CType(e.Row,DeliveryMasterRow), e.Action))
End If
End Sub
Public Sub RemoveDeliveryMasterRow(ByVal row As DeliveryMasterRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class DeliveryMasterRow
Inherits DataRow
Private tableDeliveryMaster As DeliveryMasterDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableDeliveryMaster = CType(Me.Table,DeliveryMasterDataTable)
End Sub
Public Property DeliveryID As String
Get
Return CType(Me(Me.tableDeliveryMaster.DeliveryIDColumn),String)
End Get
Set
Me(Me.tableDeliveryMaster.DeliveryIDColumn) = value
End Set
End Property
Public Property DeliveryDate As Date
Get
Return CType(Me(Me.tableDeliveryMaster.DeliveryDateColumn),Date)
End Get
Set
Me(Me.tableDeliveryMaster.DeliveryDateColumn) = value
End Set
End Property
Public Property DeliveryProperty As String
Get
Return CType(Me(Me.tableDeliveryMaster.DeliveryPropertyColumn),String)
End Get
Set
Me(Me.tableDeliveryMaster.DeliveryPropertyColumn) = value
End Set
End Property
Public Property AccountReceivable As Decimal
Get
Return CType(Me(Me.tableDeliveryMaster.AccountReceivableColumn),Decimal)
End Get
Set
Me(Me.tableDeliveryMaster.AccountReceivableColumn) = value
End Set
End Property
Public Property Received As Decimal
Get
Return CType(Me(Me.tableDeliveryMaster.ReceivedColumn),Decimal)
End Get
Set
Me(Me.tableDeliveryMaster.ReceivedColumn) = value
End Set
End Property
Public Property LimitDate As Date
Get
Try
Return CType(Me(Me.tableDeliveryMaster.LimitDateColumn),Date)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableDeliveryMaster.LimitDateColumn) = value
End Set
End Property
Public Function IsLimitDateNull() As Boolean
Return Me.IsNull(Me.tableDeliveryMaster.LimitDateColumn)
End Function
Public Sub SetLimitDateNull()
Me(Me.tableDeliveryMaster.LimitDateColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class DeliveryMasterRowChangeEvent
Inherits EventArgs
Private eventRow As DeliveryMasterRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As DeliveryMasterRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As DeliveryMasterRow
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 + -