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

📄 dsdl210.vb

📁 通用进销存-visual basic编写
💻 VB
📖 第 1 页 / 共 2 页
字号:
        
        Private Sub InitClass()
            Me.columnDeliveryID = New DataColumn("DeliveryID", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnDeliveryID)
            Me.columnProductID = New DataColumn("ProductID", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnProductID)
            Me.columnDeliveryDate = New DataColumn("DeliveryDate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnDeliveryDate)
            Me.columnProductName = New DataColumn("ProductName", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnProductName)
            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.columnDeliveryProperty = New DataColumn("DeliveryProperty", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnDeliveryProperty)
            Me.columnSalesQuantity = New DataColumn("SalesQuantity", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSalesQuantity)
            Me.columnSalesUnitPrice = New DataColumn("SalesUnitPrice", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSalesUnitPrice)
            Me.columnSalesAmount = New DataColumn("SalesAmount", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSalesAmount)
            Me.Constraints.Add(New UniqueConstraint("dsDL210Key1", New DataColumn() {Me.columnDeliveryID, Me.columnProductID}, false))
            Me.columnDeliveryID.AllowDBNull = false
            Me.columnProductID.AllowDBNull = false
        End Sub
        
        Public Function NewDL210Row() As DL210Row
            Return CType(Me.NewRow,DL210Row)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New DL210Row(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(DL210Row)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.DL210RowChangedEvent) Is Nothing) Then
                RaiseEvent DL210RowChanged(Me, New DL210RowChangeEvent(CType(e.Row,DL210Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.DL210RowChangingEvent) Is Nothing) Then
                RaiseEvent DL210RowChanging(Me, New DL210RowChangeEvent(CType(e.Row,DL210Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.DL210RowDeletedEvent) Is Nothing) Then
                RaiseEvent DL210RowDeleted(Me, New DL210RowChangeEvent(CType(e.Row,DL210Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.DL210RowDeletingEvent) Is Nothing) Then
                RaiseEvent DL210RowDeleting(Me, New DL210RowChangeEvent(CType(e.Row,DL210Row), e.Action))
            End If
        End Sub
        
        Public Sub RemoveDL210Row(ByVal row As DL210Row)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class DL210Row
        Inherits DataRow
        
        Private tableDL210 As DL210DataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableDL210 = CType(Me.Table,DL210DataTable)
        End Sub
        
        Public Property DeliveryID As String
            Get
                Return CType(Me(Me.tableDL210.DeliveryIDColumn),String)
            End Get
            Set
                Me(Me.tableDL210.DeliveryIDColumn) = value
            End Set
        End Property
        
        Public Property ProductID As String
            Get
                Return CType(Me(Me.tableDL210.ProductIDColumn),String)
            End Get
            Set
                Me(Me.tableDL210.ProductIDColumn) = value
            End Set
        End Property
        
        Public Property DeliveryDate As Date
            Get
                Try 
                    Return CType(Me(Me.tableDL210.DeliveryDateColumn),Date)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.DeliveryDateColumn) = value
            End Set
        End Property
        
        Public Property ProductName As String
            Get
                Try 
                    Return CType(Me(Me.tableDL210.ProductNameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.ProductNameColumn) = value
            End Set
        End Property
        
        Public Property CustomerID As String
            Get
                Try 
                    Return CType(Me(Me.tableDL210.CustomerIDColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.CustomerIDColumn) = value
            End Set
        End Property
        
        Public Property CustomerAttribName As String
            Get
                Try 
                    Return CType(Me(Me.tableDL210.CustomerAttribNameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.CustomerAttribNameColumn) = value
            End Set
        End Property
        
        Public Property DeliveryProperty As String
            Get
                Try 
                    Return CType(Me(Me.tableDL210.DeliveryPropertyColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.DeliveryPropertyColumn) = value
            End Set
        End Property
        
        Public Property SalesQuantity As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableDL210.SalesQuantityColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.SalesQuantityColumn) = value
            End Set
        End Property
        
        Public Property SalesUnitPrice As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableDL210.SalesUnitPriceColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.SalesUnitPriceColumn) = value
            End Set
        End Property
        
        Public Property SalesAmount As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableDL210.SalesAmountColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableDL210.SalesAmountColumn) = value
            End Set
        End Property
        
        Public Function IsDeliveryDateNull() As Boolean
            Return Me.IsNull(Me.tableDL210.DeliveryDateColumn)
        End Function
        
        Public Sub SetDeliveryDateNull()
            Me(Me.tableDL210.DeliveryDateColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsProductNameNull() As Boolean
            Return Me.IsNull(Me.tableDL210.ProductNameColumn)
        End Function
        
        Public Sub SetProductNameNull()
            Me(Me.tableDL210.ProductNameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsCustomerIDNull() As Boolean
            Return Me.IsNull(Me.tableDL210.CustomerIDColumn)
        End Function
        
        Public Sub SetCustomerIDNull()
            Me(Me.tableDL210.CustomerIDColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsCustomerAttribNameNull() As Boolean
            Return Me.IsNull(Me.tableDL210.CustomerAttribNameColumn)
        End Function
        
        Public Sub SetCustomerAttribNameNull()
            Me(Me.tableDL210.CustomerAttribNameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsDeliveryPropertyNull() As Boolean
            Return Me.IsNull(Me.tableDL210.DeliveryPropertyColumn)
        End Function
        
        Public Sub SetDeliveryPropertyNull()
            Me(Me.tableDL210.DeliveryPropertyColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsSalesQuantityNull() As Boolean
            Return Me.IsNull(Me.tableDL210.SalesQuantityColumn)
        End Function
        
        Public Sub SetSalesQuantityNull()
            Me(Me.tableDL210.SalesQuantityColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsSalesUnitPriceNull() As Boolean
            Return Me.IsNull(Me.tableDL210.SalesUnitPriceColumn)
        End Function
        
        Public Sub SetSalesUnitPriceNull()
            Me(Me.tableDL210.SalesUnitPriceColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsSalesAmountNull() As Boolean
            Return Me.IsNull(Me.tableDL210.SalesAmountColumn)
        End Function
        
        Public Sub SetSalesAmountNull()
            Me(Me.tableDL210.SalesAmountColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class DL210RowChangeEvent
        Inherits EventArgs
        
        Private eventRow As DL210Row
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As DL210Row, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As DL210Row
            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 + -