TreeView
This commit is contained in:
@@ -6,7 +6,7 @@ Imports DigitalData.GUIs.ZooFlow.ClassConstants
|
||||
Public Class frmTreeViewNavi
|
||||
Dim RightAddActive As Boolean = False
|
||||
Dim FormShown As Boolean = False
|
||||
Dim oSelectedNodeID As Integer = 0
|
||||
Dim SelectedNodeID As Integer = 0
|
||||
Private Sub frmTreeViewNavi_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
Dim oSQL = "select SN_ID ChildID,SN_PARENT_ID ParentID,TERM_VALUE as CAPTION from VWIDB_STRUCTURE_NODES_STRUCTURE"
|
||||
@@ -42,7 +42,7 @@ Public Class frmTreeViewNavi
|
||||
KeyValue = TreeList2.FocusedNode(TreeList2.KeyFieldName)
|
||||
Console.WriteLine($"keyfield: {KeyValue.ToString}")
|
||||
If IsNumeric(KeyValue) And RightAddActive Then
|
||||
oSelectedNodeID = KeyValue
|
||||
SelectedNodeID = KeyValue
|
||||
Refresh_Relations()
|
||||
If XtraTabControlRelationScope.SelectedTabPageIndex = 0 Then
|
||||
Refresh_FreeUsers()
|
||||
@@ -65,7 +65,7 @@ Public Class frmTreeViewNavi
|
||||
Private Sub Refresh_FreeUsers()
|
||||
Try
|
||||
Dim oSQL = $"SELECT GUID as USR_ID, EMAIL FROM DD_ECM.dbo.TBDD_USER USR WHERE GUID NOT IN (
|
||||
SELECT ScopeID FROM VWIDB_SN_RELATIONS WHERE SN_ID = {oSelectedNodeID}) AND USR.ACTIVE = 1 AND LEN(EMAIL) > 0"
|
||||
SELECT ScopeID FROM VWIDB_SN_RELATIONS WHERE SN_ID = {SelectedNodeID}) AND USR.ACTIVE = 1 AND LEN(EMAIL) > 0"
|
||||
Dim oDT As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
|
||||
If Not IsNothing(oDT) Then
|
||||
GridViewFreeUser.Columns.Clear()
|
||||
@@ -78,7 +78,7 @@ Public Class frmTreeViewNavi
|
||||
End Sub
|
||||
Private Sub Refresh_Relations()
|
||||
Try
|
||||
Dim oSQL = $"SELECT * FROM VWIDB_SN_RELATIONS WHERE SN_ID = {oSelectedNodeID}"
|
||||
Dim oSQL = $"SELECT * FROM VWIDB_SN_RELATIONS WHERE SN_ID = {SelectedNodeID}"
|
||||
Dim oDT As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
|
||||
If Not IsNothing(oDT) Then
|
||||
GridViewRelations.Columns.Clear()
|
||||
@@ -135,7 +135,12 @@ Public Class frmTreeViewNavi
|
||||
Dim oInsert = $"INSERT INTO [dbo].[TBIDB_STRUCTURE_NODES_RELATIONS]
|
||||
([SN_ID]
|
||||
,[USR_ID]
|
||||
,[ADDED_WHO]) VALUES ({BarButtonItem2.Tag},,,{My.Application.User.UserName})"
|
||||
,[ADDED_WHO]) VALUES ({SelectedNodeID}, {BarButtonItem2.Tag},'{My.Application.User.UserName}')"
|
||||
If My.DatabaseIDB.ExecuteNonQuery(oInsert) = True Then
|
||||
Refresh_Relations()
|
||||
Refresh_FreeUsers()
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user