Add Group To Group Assignment
This commit is contained in:
@@ -159,7 +159,7 @@ Public Class UserControlAssignment
|
||||
For Each oChildId In oChildIds
|
||||
Dim oRelationRecordId = GetAssignmentRecord(_ParentRecordId, oChildId)
|
||||
|
||||
RaiseEvent ChildAdded(_ParentRecordId, oChildId, oRelationRecordId)
|
||||
RaiseEvent ChildRemoved(_ParentRecordId, oChildId, oRelationRecordId)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -170,7 +170,7 @@ Public Class UserControlAssignment
|
||||
For Each oChildId In oChildIds
|
||||
Dim oRelationRecordId = GetAssignmentRecord(_ParentRecordId, oChildId)
|
||||
|
||||
RaiseEvent ChildRemoved(_ParentRecordId, oChildId, oRelationRecordId)
|
||||
RaiseEvent ChildAdded(_ParentRecordId, oChildId, oRelationRecordId)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -186,7 +186,7 @@ Public Class UserControlAssignment
|
||||
Where oAssignedChildIds.Contains(oRow.Item(ClassConstants.ATTRIBUTE_ID_COLUMN))
|
||||
|
||||
Dim oNotAssignedChildren As EnumerableRowCollection(Of DataRow) = From oRow In _ChildList.AsEnumerable()
|
||||
Where Not oAssignedChildIds.Contains(oRow.Item(ClassConstants.ATTRIBUTE_ID_COLUMN))
|
||||
Where Not oAssignedChildIds.Contains(oRow.Item(ClassConstants.ATTRIBUTE_ID_COLUMN)) And oRow.Item(ClassConstants.ATTRIBUTE_ID_COLUMN) <> _ParentRecordId
|
||||
|
||||
GridAssignedToParent.DataSource = MaybeCopyToDataTable(oAssignedChildren)
|
||||
GridNotAssignedToParent.DataSource = MaybeCopyToDataTable(oNotAssignedChildren)
|
||||
|
||||
@@ -14,10 +14,13 @@ Public Class frmUserManager
|
||||
End Sub
|
||||
|
||||
Private Async Sub frmUserManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Await InitUserToGroupData()
|
||||
Await InitData()
|
||||
|
||||
AddHandler UCUserToGroup.ChildRemoved, AddressOf HandleUserAssignedToGroup
|
||||
AddHandler UCUserToGroup.ChildAdded, AddressOf HandleUserDismissedFromGroup
|
||||
AddHandler UCUserToGroup.ChildAdded, AddressOf HandleUserAddedToGroup
|
||||
AddHandler UCUserToGroup.ChildRemoved, AddressOf HandleUserRemovedFromGroup
|
||||
|
||||
AddHandler UCGroupToGroup.ChildAdded, AddressOf HandleGroupAddedToGroup
|
||||
AddHandler UCGroupToGroup.ChildRemoved, AddressOf HandleGroupRemovedFromGroup
|
||||
|
||||
RibbonControl.SelectPage(RibbonPageUserManager)
|
||||
End Sub
|
||||
@@ -28,32 +31,48 @@ Public Class frmUserManager
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Async Function InitUserToGroupData() As Task
|
||||
Private Async Function InitData() As Task
|
||||
Dim oUserTable = Await GetAttributeListAsync("User")
|
||||
Dim oGroupTable = Await GetAttributeListAsync("Group")
|
||||
Dim oUserGroupTable = Await GetAttributeListAsync("User2Group")
|
||||
Dim oGroupGroupTable = Await GetAttributeListAsync("Group2Group")
|
||||
|
||||
UCUserToGroup.Init(oGroupTable, oUserTable, oUserGroupTable, "GROUP_ID", "USER_ID")
|
||||
UCGroupToGroup.Init(oGroupTable, oGroupTable, oGroupGroupTable, "GROUP2_ID", "GROUP1_ID")
|
||||
End Function
|
||||
|
||||
Private Async Function UpdateUserToGroupData() As Task
|
||||
Private Async Function UpdateData() As Task
|
||||
Dim oUserTable = Await GetAttributeListAsync("User")
|
||||
Dim oGroupTable = Await GetAttributeListAsync("Group")
|
||||
Dim oUserGroupTable = Await GetAttributeListAsync("User2Group")
|
||||
Dim oGroupGroupTable = Await GetAttributeListAsync("Group2Group")
|
||||
|
||||
UCUserToGroup.UpdateData(oGroupTable, oUserTable, oUserGroupTable)
|
||||
UCGroupToGroup.UpdateData(oGroupTable, oGroupTable, oGroupGroupTable)
|
||||
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)
|
||||
Private Async Sub HandleUserAddedToGroup(GroupId As Integer, UserId As Integer, RelationRecordId As Integer)
|
||||
Dim oRecordId = Await _CommonCommands.FNICM_RADM_NEW_USER2GROUP(UserId, GroupId)
|
||||
|
||||
Await UpdateUserToGroupData()
|
||||
Await UpdateData()
|
||||
End Sub
|
||||
|
||||
Private Async Sub HandleUserDismissedFromGroup(GroupId As Integer, UserId As Integer, RelationRecordId As Integer)
|
||||
Private Async Sub HandleUserRemovedFromGroup(GroupId As Integer, UserId As Integer, RelationRecordId As Integer)
|
||||
Dim oResult = Await _CommonCommands.FNICM_DELETE_RECORD_FINALLY(RelationRecordId)
|
||||
|
||||
Await UpdateUserToGroupData()
|
||||
Await UpdateData()
|
||||
End Sub
|
||||
|
||||
Private Async Sub HandleGroupAddedToGroup(ParentGroupId As Integer, GroupId As Integer, RelationRecordId As Integer)
|
||||
Dim oRecordId = Await _CommonCommands.FNICM_RADM_NEW_GROUP2GROUP(GroupId, ParentGroupId)
|
||||
|
||||
Await UpdateData()
|
||||
End Sub
|
||||
|
||||
Private Async Sub HandleGroupRemovedFromGroup(ParentGroupId As Integer, GroupId As Integer, RelationRecordId As Integer)
|
||||
Dim oResult = Await _CommonCommands.FNICM_DELETE_RECORD_FINALLY(RelationRecordId)
|
||||
|
||||
Await UpdateData()
|
||||
End Sub
|
||||
|
||||
Private Async Function GetAttributeListAsync(AttributeName As String) As Task(Of DataTable)
|
||||
@@ -85,7 +104,7 @@ Public Class frmUserManager
|
||||
End Sub
|
||||
|
||||
Private Async Sub BarButtonRefresh_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonRefresh.ItemClick
|
||||
Await UpdateUserToGroupData()
|
||||
Await UpdateData()
|
||||
End Sub
|
||||
|
||||
Private Sub OfficeNavigationBar1_SelectedItemChanged(sender As Object, e As DevExpress.XtraBars.Navigation.NavigationBarItemEventArgs) Handles OfficeNavigationBar1.SelectedItemChanged
|
||||
|
||||
Reference in New Issue
Block a user