📄 dswgxg.vb
字号:
cln.InitVars
Return cln
End Function
Protected Overrides Function CreateInstance() As DataTable
Return New WgDataTable
End Function
Friend Sub InitVars()
Me.columnRq = Me.Columns("Rq")
Me.columnGh = Me.Columns("Gh")
Me.columnXm = Me.Columns("Xm")
Me.columnPf = Me.Columns("Pf")
Me.columnGx = Me.Columns("Gx")
Me.columnSl = Me.Columns("Sl")
Me.columnSl1 = Me.Columns("Sl1")
Me.columnSl2 = Me.Columns("Sl2")
Me.columnSl3 = Me.Columns("Sl3")
Me.columnBz = Me.Columns("Bz")
End Sub
Private Sub InitClass()
Me.columnRq = New DataColumn("Rq", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnRq)
Me.columnGh = New DataColumn("Gh", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnGh)
Me.columnXm = New DataColumn("Xm", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnXm)
Me.columnPf = New DataColumn("Pf", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPf)
Me.columnGx = New DataColumn("Gx", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnGx)
Me.columnSl = New DataColumn("Sl", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSl)
Me.columnSl1 = New DataColumn("Sl1", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSl1)
Me.columnSl2 = New DataColumn("Sl2", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSl2)
Me.columnSl3 = New DataColumn("Sl3", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSl3)
Me.columnBz = New DataColumn("Bz", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnBz)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnRq, Me.columnGh, Me.columnXm, Me.columnPf, Me.columnGx}, true))
Me.columnRq.AllowDBNull = false
Me.columnGh.AllowDBNull = false
Me.columnXm.AllowDBNull = false
Me.columnPf.AllowDBNull = false
Me.columnGx.AllowDBNull = false
End Sub
Public Function NewWgRow() As WgRow
Return CType(Me.NewRow,WgRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New WgRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(WgRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.WgRowChangedEvent) Is Nothing) Then
RaiseEvent WgRowChanged(Me, New WgRowChangeEvent(CType(e.Row,WgRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.WgRowChangingEvent) Is Nothing) Then
RaiseEvent WgRowChanging(Me, New WgRowChangeEvent(CType(e.Row,WgRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.WgRowDeletedEvent) Is Nothing) Then
RaiseEvent WgRowDeleted(Me, New WgRowChangeEvent(CType(e.Row,WgRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.WgRowDeletingEvent) Is Nothing) Then
RaiseEvent WgRowDeleting(Me, New WgRowChangeEvent(CType(e.Row,WgRow), e.Action))
End If
End Sub
Public Sub RemoveWgRow(ByVal row As WgRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class WgRow
Inherits DataRow
Private tableWg As WgDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableWg = CType(Me.Table,WgDataTable)
End Sub
Public Property Rq As String
Get
Return CType(Me(Me.tableWg.RqColumn),String)
End Get
Set
Me(Me.tableWg.RqColumn) = value
End Set
End Property
Public Property Gh As String
Get
Return CType(Me(Me.tableWg.GhColumn),String)
End Get
Set
Me(Me.tableWg.GhColumn) = value
End Set
End Property
Public Property Xm As String
Get
Return CType(Me(Me.tableWg.XmColumn),String)
End Get
Set
Me(Me.tableWg.XmColumn) = value
End Set
End Property
Public Property Pf As String
Get
Return CType(Me(Me.tableWg.PfColumn),String)
End Get
Set
Me(Me.tableWg.PfColumn) = value
End Set
End Property
Public Property Gx As String
Get
Return CType(Me(Me.tableWg.GxColumn),String)
End Get
Set
Me(Me.tableWg.GxColumn) = value
End Set
End Property
Public Property Sl As Integer
Get
Try
Return CType(Me(Me.tableWg.SlColumn),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableWg.SlColumn) = value
End Set
End Property
Public Property Sl1 As Integer
Get
Try
Return CType(Me(Me.tableWg.Sl1Column),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableWg.Sl1Column) = value
End Set
End Property
Public Property Sl2 As Integer
Get
Try
Return CType(Me(Me.tableWg.Sl2Column),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableWg.Sl2Column) = value
End Set
End Property
Public Property Sl3 As Integer
Get
Try
Return CType(Me(Me.tableWg.Sl3Column),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableWg.Sl3Column) = value
End Set
End Property
Public Property Bz As String
Get
Try
Return CType(Me(Me.tableWg.BzColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableWg.BzColumn) = value
End Set
End Property
Public Function IsSlNull() As Boolean
Return Me.IsNull(Me.tableWg.SlColumn)
End Function
Public Sub SetSlNull()
Me(Me.tableWg.SlColumn) = System.Convert.DBNull
End Sub
Public Function IsSl1Null() As Boolean
Return Me.IsNull(Me.tableWg.Sl1Column)
End Function
Public Sub SetSl1Null()
Me(Me.tableWg.Sl1Column) = System.Convert.DBNull
End Sub
Public Function IsSl2Null() As Boolean
Return Me.IsNull(Me.tableWg.Sl2Column)
End Function
Public Sub SetSl2Null()
Me(Me.tableWg.Sl2Column) = System.Convert.DBNull
End Sub
Public Function IsSl3Null() As Boolean
Return Me.IsNull(Me.tableWg.Sl3Column)
End Function
Public Sub SetSl3Null()
Me(Me.tableWg.Sl3Column) = System.Convert.DBNull
End Sub
Public Function IsBzNull() As Boolean
Return Me.IsNull(Me.tableWg.BzColumn)
End Function
Public Sub SetBzNull()
Me(Me.tableWg.BzColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class WgRowChangeEvent
Inherits EventArgs
Private eventRow As WgRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As WgRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As WgRow
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 + -