User Group Assignments
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
Public Class frmUserManager
|
||||
Private _Logger As Logger
|
||||
Private _CommonCommands As ClassCommonCommands
|
||||
|
||||
Public Sub New()
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
@@ -9,14 +10,42 @@ Public Class frmUserManager
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
_Logger = My.LogConfig.GetLogger()
|
||||
_CommonCommands = New ClassCommonCommands(My.LogConfig)
|
||||
End Sub
|
||||
|
||||
Private Async Sub frmUserManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Await InitUserToGroupData()
|
||||
|
||||
AddHandler UCUserToGroup.ChildRemoved, AddressOf HandleUserAssignedToGroup
|
||||
AddHandler UCUserToGroup.ChildAdded, AddressOf HandleUserDismissedFromGroup
|
||||
End Sub
|
||||
|
||||
Private Async Function InitUserToGroupData() As Task
|
||||
Dim oUserTable = Await GetAttributeListAsync("User")
|
||||
Dim oGroupTable = Await GetAttributeListAsync("Group")
|
||||
Dim oUserGroupTable = Await GetAttributeListAsync("User_Group")
|
||||
Dim oUserGroupTable = Await GetAttributeListAsync("User2Group")
|
||||
|
||||
UCUserToGroup.Init(oGroupTable, oUserTable, oUserGroupTable, "GROUP_ID", "USER_ID")
|
||||
End Function
|
||||
|
||||
Private Async Function UpdateUserToGroupData() As Task
|
||||
Dim oUserTable = Await GetAttributeListAsync("User")
|
||||
Dim oGroupTable = Await GetAttributeListAsync("Group")
|
||||
Dim oUserGroupTable = Await GetAttributeListAsync("User2Group")
|
||||
|
||||
UCUserToGroup.UpdateData(oGroupTable, oUserTable, oUserGroupTable)
|
||||
End Function
|
||||
|
||||
Private Async Sub HandleUserAssignedToGroup(GroupId As Integer, UserId As Integer, RelationRecordId As Integer)
|
||||
Dim oRecordId = Await _CommonCommands.FNICM_RADM_NEW_USER2GROUP(GroupId, UserId)
|
||||
|
||||
Await UpdateUserToGroupData()
|
||||
End Sub
|
||||
|
||||
Private Async Sub HandleUserDismissedFromGroup(GroupId As Integer, UserId As Integer, RelationRecordId As Integer)
|
||||
Dim oResult = Await _CommonCommands.FNICM_DELETE_RECORD_FINALLY(RelationRecordId)
|
||||
|
||||
Await UpdateUserToGroupData()
|
||||
End Sub
|
||||
|
||||
Private Async Function GetAttributeListAsync(AttributeName As String) As Task(Of DataTable)
|
||||
@@ -48,5 +77,7 @@ Public Class frmUserManager
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Async Sub BarButtonRefresh_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonRefresh.ItemClick
|
||||
Await UpdateUserToGroupData()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user