📄 dssearchbook.vb
字号:
Me.column图书名称 = New DataColumn("图书名称", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column图书名称)
Me.column图书作者 = New DataColumn("图书作者", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column图书作者)
Me.column出版社 = New DataColumn("出版社", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column出版社)
Me.columnISBN号 = New DataColumn("ISBN号", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnISBN号)
Me.column出版日期 = New DataColumn("出版日期", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column出版日期)
Me.column图书页数 = New DataColumn("图书页数", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column图书页数)
Me.column图书价格 = New DataColumn("图书价格", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column图书价格)
Me.column入馆日期 = New DataColumn("入馆日期", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column入馆日期)
Me.column存放位置 = New DataColumn("存放位置", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column存放位置)
Me.column图书分类 = New DataColumn("图书分类", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.column图书分类)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.column条形码}, true))
Me.column条形码.AllowDBNull = false
Me.column条形码.Unique = true
Me.column图书名称.AllowDBNull = false
End Sub
Public Function NewsearchBookRow() As searchBookRow
Return CType(Me.NewRow,searchBookRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New searchBookRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(searchBookRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.searchBookRowChangedEvent) Is Nothing) Then
RaiseEvent searchBookRowChanged(Me, New searchBookRowChangeEvent(CType(e.Row,searchBookRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.searchBookRowChangingEvent) Is Nothing) Then
RaiseEvent searchBookRowChanging(Me, New searchBookRowChangeEvent(CType(e.Row,searchBookRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.searchBookRowDeletedEvent) Is Nothing) Then
RaiseEvent searchBookRowDeleted(Me, New searchBookRowChangeEvent(CType(e.Row,searchBookRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.searchBookRowDeletingEvent) Is Nothing) Then
RaiseEvent searchBookRowDeleting(Me, New searchBookRowChangeEvent(CType(e.Row,searchBookRow), e.Action))
End If
End Sub
Public Sub RemovesearchBookRow(ByVal row As searchBookRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class searchBookRow
Inherits DataRow
Private tablesearchBook As searchBookDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tablesearchBook = CType(Me.Table,searchBookDataTable)
End Sub
Public Property 条形码 As String
Get
Return CType(Me(Me.tablesearchBook.条形码Column),String)
End Get
Set
Me(Me.tablesearchBook.条形码Column) = value
End Set
End Property
Public Property 图书名称 As String
Get
Return CType(Me(Me.tablesearchBook.图书名称Column),String)
End Get
Set
Me(Me.tablesearchBook.图书名称Column) = value
End Set
End Property
Public Property 图书作者 As String
Get
Try
Return CType(Me(Me.tablesearchBook.图书作者Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.图书作者Column) = value
End Set
End Property
Public Property 出版社 As String
Get
Try
Return CType(Me(Me.tablesearchBook.出版社Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.出版社Column) = value
End Set
End Property
Public Property ISBN号 As String
Get
Try
Return CType(Me(Me.tablesearchBook.ISBN号Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.ISBN号Column) = value
End Set
End Property
Public Property 出版日期 As Date
Get
Try
Return CType(Me(Me.tablesearchBook.出版日期Column),Date)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.出版日期Column) = value
End Set
End Property
Public Property 图书页数 As Integer
Get
Try
Return CType(Me(Me.tablesearchBook.图书页数Column),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.图书页数Column) = value
End Set
End Property
Public Property 图书价格 As Decimal
Get
Try
Return CType(Me(Me.tablesearchBook.图书价格Column),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.图书价格Column) = value
End Set
End Property
Public Property 入馆日期 As Date
Get
Try
Return CType(Me(Me.tablesearchBook.入馆日期Column),Date)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.入馆日期Column) = value
End Set
End Property
Public Property 存放位置 As String
Get
Try
Return CType(Me(Me.tablesearchBook.存放位置Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.存放位置Column) = value
End Set
End Property
Public Property 图书分类 As String
Get
Try
Return CType(Me(Me.tablesearchBook.图书分类Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tablesearchBook.图书分类Column) = value
End Set
End Property
Public Function Is图书作者Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.图书作者Column)
End Function
Public Sub Set图书作者Null()
Me(Me.tablesearchBook.图书作者Column) = System.Convert.DBNull
End Sub
Public Function Is出版社Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.出版社Column)
End Function
Public Sub Set出版社Null()
Me(Me.tablesearchBook.出版社Column) = System.Convert.DBNull
End Sub
Public Function IsISBN号Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.ISBN号Column)
End Function
Public Sub SetISBN号Null()
Me(Me.tablesearchBook.ISBN号Column) = System.Convert.DBNull
End Sub
Public Function Is出版日期Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.出版日期Column)
End Function
Public Sub Set出版日期Null()
Me(Me.tablesearchBook.出版日期Column) = System.Convert.DBNull
End Sub
Public Function Is图书页数Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.图书页数Column)
End Function
Public Sub Set图书页数Null()
Me(Me.tablesearchBook.图书页数Column) = System.Convert.DBNull
End Sub
Public Function Is图书价格Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.图书价格Column)
End Function
Public Sub Set图书价格Null()
Me(Me.tablesearchBook.图书价格Column) = System.Convert.DBNull
End Sub
Public Function Is入馆日期Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.入馆日期Column)
End Function
Public Sub Set入馆日期Null()
Me(Me.tablesearchBook.入馆日期Column) = System.Convert.DBNull
End Sub
Public Function Is存放位置Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.存放位置Column)
End Function
Public Sub Set存放位置Null()
Me(Me.tablesearchBook.存放位置Column) = System.Convert.DBNull
End Sub
Public Function Is图书分类Null() As Boolean
Return Me.IsNull(Me.tablesearchBook.图书分类Column)
End Function
Public Sub Set图书分类Null()
Me(Me.tablesearchBook.图书分类Column) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class searchBookRowChangeEvent
Inherits EventArgs
Private eventRow As searchBookRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As searchBookRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As searchBookRow
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 + -