📄 dssy120.vb
字号:
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.ProgramsRowDeletingEvent) Is Nothing) Then
RaiseEvent ProgramsRowDeleting(Me, New ProgramsRowChangeEvent(CType(e.Row,ProgramsRow), e.Action))
End If
End Sub
Public Sub RemoveProgramsRow(ByVal row As ProgramsRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class ProgramsRow
Inherits DataRow
Private tablePrograms As ProgramsDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tablePrograms = CType(Me.Table,ProgramsDataTable)
End Sub
Public Property ProgramID As String
Get
Return CType(Me(Me.tablePrograms.ProgramIDColumn),String)
End Get
Set
Me(Me.tablePrograms.ProgramIDColumn) = value
End Set
End Property
Public Property ProgramName As String
Get
Return CType(Me(Me.tablePrograms.ProgramNameColumn),String)
End Get
Set
Me(Me.tablePrograms.ProgramNameColumn) = value
End Set
End Property
Public Function GetUserAuthorityRows() As UserAuthorityRow()
Return CType(Me.GetChildRows(Me.Table.ChildRelations("ProgramsUserAuthority")),UserAuthorityRow())
End Function
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class ProgramsRowChangeEvent
Inherits EventArgs
Private eventRow As ProgramsRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As ProgramsRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As ProgramsRow
Get
Return Me.eventRow
End Get
End Property
Public ReadOnly Property Action As DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class UserAuthorityDataTable
Inherits DataTable
Implements System.Collections.IEnumerable
Private columnUserID As DataColumn
Private columnProgramID As DataColumn
Private columnRunning As DataColumn
Friend Sub New()
MyBase.New("UserAuthority")
Me.InitClass
End Sub
Friend Sub New(ByVal table As DataTable)
MyBase.New(table.TableName)
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
Me.DisplayExpression = table.DisplayExpression
End Sub
<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count As Integer
Get
Return Me.Rows.Count
End Get
End Property
Friend ReadOnly Property UserIDColumn As DataColumn
Get
Return Me.columnUserID
End Get
End Property
Friend ReadOnly Property ProgramIDColumn As DataColumn
Get
Return Me.columnProgramID
End Get
End Property
Friend ReadOnly Property RunningColumn As DataColumn
Get
Return Me.columnRunning
End Get
End Property
Public Default ReadOnly Property Item(ByVal index As Integer) As UserAuthorityRow
Get
Return CType(Me.Rows(index),UserAuthorityRow)
End Get
End Property
Public Event UserAuthorityRowChanged As UserAuthorityRowChangeEventHandler
Public Event UserAuthorityRowChanging As UserAuthorityRowChangeEventHandler
Public Event UserAuthorityRowDeleted As UserAuthorityRowChangeEventHandler
Public Event UserAuthorityRowDeleting As UserAuthorityRowChangeEventHandler
Public Overloads Sub AddUserAuthorityRow(ByVal row As UserAuthorityRow)
Me.Rows.Add(row)
End Sub
Public Overloads Function AddUserAuthorityRow(ByVal UserID As String, ByVal parentProgramsRowByProgramsUserAuthority As ProgramsRow, ByVal Running As Boolean) As UserAuthorityRow
Dim rowUserAuthorityRow As UserAuthorityRow = CType(Me.NewRow,UserAuthorityRow)
rowUserAuthorityRow.ItemArray = New Object() {UserID, parentProgramsRowByProgramsUserAuthority(0), Running}
Me.Rows.Add(rowUserAuthorityRow)
Return rowUserAuthorityRow
End Function
Public Function FindByUserIDProgramID(ByVal UserID As String, ByVal ProgramID As String) As UserAuthorityRow
Return CType(Me.Rows.Find(New Object() {UserID, ProgramID}),UserAuthorityRow)
End Function
Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function
Public Overrides Function Clone() As DataTable
Dim cln As UserAuthorityDataTable = CType(MyBase.Clone,UserAuthorityDataTable)
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnUserID = Me.Columns("UserID")
Me.columnProgramID = Me.Columns("ProgramID")
Me.columnRunning = Me.Columns("Running")
End Sub
Private Sub InitClass()
Me.columnUserID = New DataColumn("UserID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnUserID)
Me.columnProgramID = New DataColumn("ProgramID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnProgramID)
Me.columnRunning = New DataColumn("Running", GetType(System.Boolean), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnRunning)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnUserID, Me.columnProgramID}, true))
Me.columnUserID.AllowDBNull = false
Me.columnProgramID.AllowDBNull = false
Me.columnRunning.AllowDBNull = false
End Sub
Public Function NewUserAuthorityRow() As UserAuthorityRow
Return CType(Me.NewRow,UserAuthorityRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New UserAuthorityRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(UserAuthorityRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.UserAuthorityRowChangedEvent) Is Nothing) Then
RaiseEvent UserAuthorityRowChanged(Me, New UserAuthorityRowChangeEvent(CType(e.Row,UserAuthorityRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.UserAuthorityRowChangingEvent) Is Nothing) Then
RaiseEvent UserAuthorityRowChanging(Me, New UserAuthorityRowChangeEvent(CType(e.Row,UserAuthorityRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.UserAuthorityRowDeletedEvent) Is Nothing) Then
RaiseEvent UserAuthorityRowDeleted(Me, New UserAuthorityRowChangeEvent(CType(e.Row,UserAuthorityRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.UserAuthorityRowDeletingEvent) Is Nothing) Then
RaiseEvent UserAuthorityRowDeleting(Me, New UserAuthorityRowChangeEvent(CType(e.Row,UserAuthorityRow), e.Action))
End If
End Sub
Public Sub RemoveUserAuthorityRow(ByVal row As UserAuthorityRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class UserAuthorityRow
Inherits DataRow
Private tableUserAuthority As UserAuthorityDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableUserAuthority = CType(Me.Table,UserAuthorityDataTable)
End Sub
Public Property UserID As String
Get
Return CType(Me(Me.tableUserAuthority.UserIDColumn),String)
End Get
Set
Me(Me.tableUserAuthority.UserIDColumn) = value
End Set
End Property
Public Property ProgramID As String
Get
Return CType(Me(Me.tableUserAuthority.ProgramIDColumn),String)
End Get
Set
Me(Me.tableUserAuthority.ProgramIDColumn) = value
End Set
End Property
Public Property Running As Boolean
Get
Return CType(Me(Me.tableUserAuthority.RunningColumn),Boolean)
End Get
Set
Me(Me.tableUserAuthority.RunningColumn) = value
End Set
End Property
Public Property ProgramsRow As ProgramsRow
Get
Return CType(Me.GetParentRow(Me.Table.ParentRelations("ProgramsUserAuthority")),ProgramsRow)
End Get
Set
Me.SetParentRow(value, Me.Table.ParentRelations("ProgramsUserAuthority"))
End Set
End Property
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class UserAuthorityRowChangeEvent
Inherits EventArgs
Private eventRow As UserAuthorityRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As UserAuthorityRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As UserAuthorityRow
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 + -