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

📄 titlesds.vb

📁 asp.net技术内幕的书配源码
💻 VB
📖 第 1 页 / 共 2 页
字号:
            Me.Columns.Add(Me.columntype)
            Me.columnpub_id = New DataColumn("pub_id", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnpub_id)
            Me.columnprice = New DataColumn("price", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnprice)
            Me.columnadvance = New DataColumn("advance", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnadvance)
            Me.columnroyalty = New DataColumn("royalty", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnroyalty)
            Me.columnytd_sales = New DataColumn("ytd_sales", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnytd_sales)
            Me.columnnotes = New DataColumn("notes", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnnotes)
            Me.columnpubdate = New DataColumn("pubdate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnpubdate)
        End Sub
        
        Public Function NewTitlesRow() As TitlesRow
            Return CType(Me.NewRow,TitlesRow)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New TitlesRow(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(TitlesRow)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.TitlesRowChangedEvent) Is Nothing) Then
                RaiseEvent TitlesRowChanged(Me, New TitlesRowChangeEvent(CType(e.Row,TitlesRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.TitlesRowChangingEvent) Is Nothing) Then
                RaiseEvent TitlesRowChanging(Me, New TitlesRowChangeEvent(CType(e.Row,TitlesRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.TitlesRowDeletedEvent) Is Nothing) Then
                RaiseEvent TitlesRowDeleted(Me, New TitlesRowChangeEvent(CType(e.Row,TitlesRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.TitlesRowDeletingEvent) Is Nothing) Then
                RaiseEvent TitlesRowDeleting(Me, New TitlesRowChangeEvent(CType(e.Row,TitlesRow), e.Action))
            End If
        End Sub
        
        Public Sub RemoveTitlesRow(ByVal row As TitlesRow)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class TitlesRow
        Inherits DataRow
        
        Private tableTitles As TitlesDataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableTitles = CType(Me.Table,TitlesDataTable)
        End Sub
        
        Public Property title_id As String
            Get
                Try 
                    Return CType(Me(Me.tableTitles.title_idColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.title_idColumn) = value
            End Set
        End Property
        
        Public Property title As String
            Get
                Try 
                    Return CType(Me(Me.tableTitles.titleColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.titleColumn) = value
            End Set
        End Property
        
        Public Property type As String
            Get
                Try 
                    Return CType(Me(Me.tableTitles.typeColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.typeColumn) = value
            End Set
        End Property
        
        Public Property pub_id As String
            Get
                Try 
                    Return CType(Me(Me.tableTitles.pub_idColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.pub_idColumn) = value
            End Set
        End Property
        
        Public Property price As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableTitles.priceColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.priceColumn) = value
            End Set
        End Property
        
        Public Property advance As Decimal
            Get
                Try 
                    Return CType(Me(Me.tableTitles.advanceColumn),Decimal)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.advanceColumn) = value
            End Set
        End Property
        
        Public Property royalty As Integer
            Get
                Try 
                    Return CType(Me(Me.tableTitles.royaltyColumn),Integer)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.royaltyColumn) = value
            End Set
        End Property
        
        Public Property ytd_sales As Integer
            Get
                Try 
                    Return CType(Me(Me.tableTitles.ytd_salesColumn),Integer)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.ytd_salesColumn) = value
            End Set
        End Property
        
        Public Property notes As String
            Get
                Try 
                    Return CType(Me(Me.tableTitles.notesColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.notesColumn) = value
            End Set
        End Property
        
        Public Property pubdate As Date
            Get
                Try 
                    Return CType(Me(Me.tableTitles.pubdateColumn),Date)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableTitles.pubdateColumn) = value
            End Set
        End Property
        
        Public Function Istitle_idNull() As Boolean
            Return Me.IsNull(Me.tableTitles.title_idColumn)
        End Function
        
        Public Sub Settitle_idNull()
            Me(Me.tableTitles.title_idColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IstitleNull() As Boolean
            Return Me.IsNull(Me.tableTitles.titleColumn)
        End Function
        
        Public Sub SettitleNull()
            Me(Me.tableTitles.titleColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IstypeNull() As Boolean
            Return Me.IsNull(Me.tableTitles.typeColumn)
        End Function
        
        Public Sub SettypeNull()
            Me(Me.tableTitles.typeColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Ispub_idNull() As Boolean
            Return Me.IsNull(Me.tableTitles.pub_idColumn)
        End Function
        
        Public Sub Setpub_idNull()
            Me(Me.tableTitles.pub_idColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IspriceNull() As Boolean
            Return Me.IsNull(Me.tableTitles.priceColumn)
        End Function
        
        Public Sub SetpriceNull()
            Me(Me.tableTitles.priceColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsadvanceNull() As Boolean
            Return Me.IsNull(Me.tableTitles.advanceColumn)
        End Function
        
        Public Sub SetadvanceNull()
            Me(Me.tableTitles.advanceColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsroyaltyNull() As Boolean
            Return Me.IsNull(Me.tableTitles.royaltyColumn)
        End Function
        
        Public Sub SetroyaltyNull()
            Me(Me.tableTitles.royaltyColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isytd_salesNull() As Boolean
            Return Me.IsNull(Me.tableTitles.ytd_salesColumn)
        End Function
        
        Public Sub Setytd_salesNull()
            Me(Me.tableTitles.ytd_salesColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsnotesNull() As Boolean
            Return Me.IsNull(Me.tableTitles.notesColumn)
        End Function
        
        Public Sub SetnotesNull()
            Me(Me.tableTitles.notesColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IspubdateNull() As Boolean
            Return Me.IsNull(Me.tableTitles.pubdateColumn)
        End Function
        
        Public Sub SetpubdateNull()
            Me(Me.tableTitles.pubdateColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class TitlesRowChangeEvent
        Inherits EventArgs
        
        Private eventRow As TitlesRow
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As TitlesRow, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As TitlesRow
            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 + -