📄 goodmanage.vb
字号:
Return cln
End Function
Protected Overrides Function CreateInstance() As DataTable
Return New 商品信息DataTable
End Function
Friend Sub InitVars()
Me.columnid = Me.Columns("id")
Me.column名称 = Me.Columns("名称")
Me.column种类 = Me.Columns("种类")
Me.column规格 = Me.Columns("规格")
Me.column库存数量 = Me.Columns("库存数量")
Me.column价格 = Me.Columns("价格")
Me.column描述 = Me.Columns("描述")
Me.column备注 = Me.Columns("备注")
End Sub
Private Sub InitClass()
Me.columnid = New DataColumn("id", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnid)
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.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.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.columnid}, true))
Me.columnid.AllowDBNull = false
Me.columnid.Unique = true
Me.column名称.AllowDBNull = false
End Sub
Public Function New商品信息Row() As 商品信息Row
Return CType(Me.NewRow,商品信息Row)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New 商品信息Row(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(商品信息Row)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.商品信息RowChangedEvent) Is Nothing) Then
RaiseEvent 商品信息RowChanged(Me, New 商品信息RowChangeEvent(CType(e.Row,商品信息Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.商品信息RowChangingEvent) Is Nothing) Then
RaiseEvent 商品信息RowChanging(Me, New 商品信息RowChangeEvent(CType(e.Row,商品信息Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.商品信息RowDeletedEvent) Is Nothing) Then
RaiseEvent 商品信息RowDeleted(Me, New 商品信息RowChangeEvent(CType(e.Row,商品信息Row), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.商品信息RowDeletingEvent) Is Nothing) Then
RaiseEvent 商品信息RowDeleting(Me, New 商品信息RowChangeEvent(CType(e.Row,商品信息Row), e.Action))
End If
End Sub
Public Sub Remove商品信息Row(ByVal row As 商品信息Row)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class 商品信息Row
Inherits DataRow
Private table商品信息 As 商品信息DataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.table商品信息 = CType(Me.Table,商品信息DataTable)
End Sub
Public Property id As Integer
Get
Return CType(Me(Me.table商品信息.idColumn),Integer)
End Get
Set
Me(Me.table商品信息.idColumn) = value
End Set
End Property
Public Property 名称 As String
Get
Return CType(Me(Me.table商品信息.名称Column),String)
End Get
Set
Me(Me.table商品信息.名称Column) = value
End Set
End Property
Public Property 种类 As String
Get
Try
Return CType(Me(Me.table商品信息.种类Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.种类Column) = value
End Set
End Property
Public Property 规格 As String
Get
Try
Return CType(Me(Me.table商品信息.规格Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.规格Column) = value
End Set
End Property
Public Property 库存数量 As Integer
Get
Try
Return CType(Me(Me.table商品信息.库存数量Column),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.库存数量Column) = value
End Set
End Property
Public Property 价格 As Decimal
Get
Try
Return CType(Me(Me.table商品信息.价格Column),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.价格Column) = value
End Set
End Property
Public Property 描述 As String
Get
Try
Return CType(Me(Me.table商品信息.描述Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.描述Column) = value
End Set
End Property
Public Property 备注 As String
Get
Try
Return CType(Me(Me.table商品信息.备注Column),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.table商品信息.备注Column) = value
End Set
End Property
Public Function Is种类Null() As Boolean
Return Me.IsNull(Me.table商品信息.种类Column)
End Function
Public Sub Set种类Null()
Me(Me.table商品信息.种类Column) = System.Convert.DBNull
End Sub
Public Function Is规格Null() As Boolean
Return Me.IsNull(Me.table商品信息.规格Column)
End Function
Public Sub Set规格Null()
Me(Me.table商品信息.规格Column) = System.Convert.DBNull
End Sub
Public Function Is库存数量Null() As Boolean
Return Me.IsNull(Me.table商品信息.库存数量Column)
End Function
Public Sub Set库存数量Null()
Me(Me.table商品信息.库存数量Column) = System.Convert.DBNull
End Sub
Public Function Is价格Null() As Boolean
Return Me.IsNull(Me.table商品信息.价格Column)
End Function
Public Sub Set价格Null()
Me(Me.table商品信息.价格Column) = System.Convert.DBNull
End Sub
Public Function Is描述Null() As Boolean
Return Me.IsNull(Me.table商品信息.描述Column)
End Function
Public Sub Set描述Null()
Me(Me.table商品信息.描述Column) = System.Convert.DBNull
End Sub
Public Function Is备注Null() As Boolean
Return Me.IsNull(Me.table商品信息.备注Column)
End Function
Public Sub Set备注Null()
Me(Me.table商品信息.备注Column) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class 商品信息RowChangeEvent
Inherits EventArgs
Private eventRow As 商品信息Row
Private eventAction As DataRowAction
Public Sub New(ByVal row As 商品信息Row, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As 商品信息Row
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 + -