⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsap270.vb

📁 通用进销存-visual basic编写
💻 VB
📖 第 1 页 / 共 2 页
字号:
        End Property
        
        Public Event AP270RowChanged As AP270RowChangeEventHandler
        
        Public Event AP270RowChanging As AP270RowChangeEventHandler
        
        Public Event AP270RowDeleted As AP270RowChangeEventHandler
        
        Public Event AP270RowDeleting As AP270RowChangeEventHandler
        
        Public Overloads Sub AddAP270Row(ByVal row As AP270Row)
            Me.Rows.Add(row)
        End Sub
        
        Public Overloads Function AddAP270Row(ByVal SupplierID As String, ByVal IDDate As Date, ByVal IDType As String, ByVal ID As String, ByVal SupplierAttribName As String, ByVal Amount As Decimal) As AP270Row
            Dim rowAP270Row As AP270Row = CType(Me.NewRow,AP270Row)
            rowAP270Row.ItemArray = New Object() {SupplierID, IDDate, IDType, ID, SupplierAttribName, Amount}
            Me.Rows.Add(rowAP270Row)
            Return rowAP270Row
        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 AP270DataTable = CType(MyBase.Clone,AP270DataTable)
            cln.InitVars
            Return cln
        End Function
        
        Friend Sub InitVars()
            Me.columnSupplierID = Me.Columns("SupplierID")
            Me.columnIDDate = Me.Columns("IDDate")
            Me.columnIDType = Me.Columns("IDType")
            Me.columnID = Me.Columns("ID")
            Me.columnSupplierAttribName = Me.Columns("SupplierAttribName")
            Me.columnAmount = Me.Columns("Amount")
        End Sub
        
        Private Sub InitClass()
            Me.columnSupplierID = New DataColumn("SupplierID", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSupplierID)
            Me.columnIDDate = New DataColumn("IDDate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnIDDate)
            Me.columnIDType = New DataColumn("IDType", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnIDType)
            Me.columnID = New DataColumn("ID", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnID)
            Me.columnSupplierAttribName = New DataColumn("SupplierAttribName", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSupplierAttribName)
            Me.columnAmount = New DataColumn("Amount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnAmount)
            Me.Constraints.Add(New UniqueConstraint("dsAP270Key1", New DataColumn() {Me.columnSupplierID, Me.columnIDDate, Me.columnIDType, Me.columnID}, false))
            Me.columnSupplierID.AllowDBNull = false
            Me.columnIDDate.AllowDBNull = false
            Me.columnIDType.AllowDBNull = false
            Me.columnID.AllowDBNull = false
        End Sub
        
        Public Function NewAP270Row() As AP270Row
            Return CType(Me.NewRow,AP270Row)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New AP270Row(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(AP270Row)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.AP270RowChangedEvent) Is Nothing) Then
                RaiseEvent AP270RowChanged(Me, New AP270RowChangeEvent(CType(e.Row,AP270Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.AP270RowChangingEvent) Is Nothing) Then
                RaiseEvent AP270RowChanging(Me, New AP270RowChangeEvent(CType(e.Row,AP270Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.AP270RowDeletedEvent) Is Nothing) Then
                RaiseEvent AP270RowDeleted(Me, New AP270RowChangeEvent(CType(e.Row,AP270Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.AP270RowDeletingEvent) Is Nothing) Then
                RaiseEvent AP270RowDeleting(Me, New AP270RowChangeEvent(CType(e.Row,AP270Row), e.Action))
            End If
        End Sub
        
        Public Sub RemoveAP270Row(ByVal row As AP270Row)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class AP270Row
        Inherits DataRow
        
        Private tableAP270 As AP270DataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableAP270 = CType(Me.Table,AP270DataTable)
        End Sub
        
        Public Property SupplierID As String
            Get
                Return CType(Me(Me.tableAP270.SupplierIDColumn),String)
            End Get
            Set
                Me(Me.tableAP270.SupplierIDColumn) = value
            End Set
        End Property
        
        Public Property IDDate As Date
            Get
                Return CType(Me(Me.tableAP270.IDDateColumn),Date)
            End Get
            Set
                Me(Me.tableAP270.IDDateColumn) = value
            End Set
        End Property
        
        Public Property IDType As String
            Get
                Return CType(Me(Me.tableAP270.IDTypeColumn),String)
            End Get
            Set
                Me(Me.tableAP270.IDTypeColumn) = value
            End Set
        End Property
        
        Public Property ID As String
            Get
                Return CType(Me(Me.tableAP270.IDColumn),String)
            End Get
            Set
                Me(Me.tableAP270.IDColumn) = value
            End Set
        End Property
        
        Public Property SupplierAttribName As String
            Get
                Try 
                    Return CType(Me(Me.tableAP270.SupplierAttribNameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableAP270.SupplierAttribNameColumn) = value
            End Set
        End Property
        
        Public Property Amount As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableAP270.AmountColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableAP270.AmountColumn) = value
            End Set
        End Property
        
        Public Function IsSupplierAttribNameNull() As Boolean
            Return Me.IsNull(Me.tableAP270.SupplierAttribNameColumn)
        End Function
        
        Public Sub SetSupplierAttribNameNull()
            Me(Me.tableAP270.SupplierAttribNameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsAmountNull() As Boolean
            Return Me.IsNull(Me.tableAP270.AmountColumn)
        End Function
        
        Public Sub SetAmountNull()
            Me(Me.tableAP270.AmountColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class AP270RowChangeEvent
        Inherits EventArgs
        
        Private eventRow As AP270Row
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As AP270Row, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As AP270Row
            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 + -