Release für ewa
This commit is contained in:
@@ -424,6 +424,21 @@
|
||||
End If
|
||||
End If
|
||||
Me.bsitmSave.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
If TYPE_NODENumericUpDown.Value = 1000 Then
|
||||
GridControl_Right_AddmanNode_User.Enabled = True
|
||||
GridControlFreeUsers.Enabled = True
|
||||
btnAddUser.Enabled = True
|
||||
btndeleteUser.Enabled = True
|
||||
|
||||
Load_Users_Right_Man_Add()
|
||||
Else
|
||||
GridControl_Right_AddmanNode_User.Enabled = False
|
||||
GridControlFreeUsers.Enabled = False
|
||||
btnAddUser.Enabled = False
|
||||
btndeleteUser.Enabled = False
|
||||
DD_ECMAdmin.TBAD_Users.Clear()
|
||||
DD_ECMAdmin.TBWH_Users1.Clear()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in TreeView.AfterSelect:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
@@ -435,7 +450,8 @@
|
||||
|
||||
Private Sub LoadData()
|
||||
If cmbEntity.SelectedIndex <> -1 Then
|
||||
Load_Nodes_entity
|
||||
Load_nodes_Entity()
|
||||
|
||||
If DD_DMSDataSet.TBPMO_STRUCTURE_NODES_CONFIGURATION.Rows.Count > 0 Then
|
||||
Load_TreeView()
|
||||
Else
|
||||
@@ -505,8 +521,166 @@
|
||||
Private Sub TYPE_NODENumericUpDown_ValueChanged(sender As Object, e As EventArgs) Handles TYPE_NODENumericUpDown.ValueChanged
|
||||
If TYPE_NODENumericUpDown.Value = 1000 Then
|
||||
CheckEdit1.Checked = True
|
||||
|
||||
Else
|
||||
CheckEdit1.Checked = False
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Load_Users_Right_Man_Add()
|
||||
If GUIDTextBox.Text = "" Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim oSql = String.Format("SELECT T.* FROM TBDD_USER T WITH (NOLOCK) INNER JOIN TBDD_USER_MODULES T1 WITH (NOLOCK) ON T.GUID = T1.USER_ID
|
||||
INNER JOIN TBDD_MODULES T2 WITH (NOLOCK) ON T1.MODULE_ID = T2.GUID
|
||||
WHERE T2.SHORT_NAME = 'ADDI' AND T.GUID IN (SELECT FK_TBDDUSER_ID FROM TBOF_MAP_RIGHT_NODE_ADD_USER WHERE FK_TBPMO_SN_CONFIG_ID = {0} )
|
||||
ORDER BY T.USERNAME", GUIDTextBox.Text)
|
||||
Dim DT_USERS_CONFIGURED As DataTable = MYDB_ECM.GetDatatable(oSql)
|
||||
|
||||
oSql = String.Format("SELECT * FROM TBDD_USER WITH (NOLOCK) WHERE GUID NOT IN (SELECT FK_TBDDUSER_ID FROM TBOF_MAP_RIGHT_NODE_ADD_USER WITH (NOLOCK) WHERE FK_TBPMO_SN_CONFIG_ID = {0} )
|
||||
ORDER BY USERNAME", GUIDTextBox.Text)
|
||||
Dim DT_FREE_USER As DataTable = MYDB_ECM.GetDatatable(oSql)
|
||||
Try
|
||||
DD_ECMAdmin.TBAD_Users.Clear()
|
||||
|
||||
For Each row As DataRow In DT_FREE_USER.Rows
|
||||
Dim newUserRow As DD_ECMAdmin.TBAD_UsersRow
|
||||
newUserRow = DD_ECMAdmin.TBAD_Users.NewTBAD_UsersRow
|
||||
newUserRow.Username = row.Item("USERNAME")
|
||||
newUserRow.Surname = If(IsDBNull(row("NAME")), "", row("NAME").ToString())
|
||||
newUserRow.Prename = If(IsDBNull(row("PRENAME")), "", row("PRENAME").ToString())
|
||||
Try
|
||||
newUserRow.Email = row.Item("EMAIL")
|
||||
Catch ex As Exception
|
||||
newUserRow.Email = ""
|
||||
End Try
|
||||
|
||||
newUserRow.ID = row.Item("GUID")
|
||||
DD_ECMAdmin.TBAD_Users.Rows.Add(newUserRow)
|
||||
Next
|
||||
|
||||
Try
|
||||
DD_ECMAdmin.TBWH_Users1.Clear()
|
||||
|
||||
For Each row As DataRow In DT_USERS_CONFIGURED.Rows
|
||||
Dim newUserRow As DD_ECMAdmin.TBWH_Users1Row
|
||||
newUserRow = DD_ECMAdmin.TBWH_Users1.NewTBWH_Users1Row
|
||||
newUserRow.Surname = If(IsDBNull(row("NAME")), "", row("NAME").ToString())
|
||||
newUserRow.Prename = If(IsDBNull(row("PRENAME")), "", row("PRENAME").ToString())
|
||||
newUserRow.Username = row.Item("USERNAME")
|
||||
Try
|
||||
newUserRow.Email = row.Item("EMAIL")
|
||||
Catch ex As Exception
|
||||
newUserRow.Email = ""
|
||||
End Try
|
||||
|
||||
newUserRow.ID = row.Item("GUID")
|
||||
DD_ECMAdmin.TBWH_Users1.Rows.Add(newUserRow)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
MsgBox("Error loading Users for Global Search:" & vbNewLine & ex.Message)
|
||||
End Try
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Load_Users_GS:" & vbNewLine & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btnAddUser2ConstructorREL_Click(sender As Object, e As EventArgs) Handles btnAddUser.Click
|
||||
If GUIDTextBox.Text = "" Then
|
||||
MsgBox("Please choose a node by clicking in the treeview!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
' Zuerst alle ausgewählten User-IDs sammeln
|
||||
Dim selectedUserIDs As New List(Of Object)
|
||||
For Each row As DataRow In DD_ECMAdmin.TBAD_Users.Rows
|
||||
If row.Item(0) = CBool(True) Then
|
||||
selectedUserIDs.Add(row.Item(5))
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
' Dann die INSERTs ausführen
|
||||
For Each userID In selectedUserIDs
|
||||
Dim insert As String = String.Format(
|
||||
"INSERT INTO TBOF_MAP_RIGHT_NODE_ADD_USER (FK_TBPMO_SN_CONFIG_ID, FK_TBDDUSER_ID, ADDED_WHO) VALUES ({0}, {1}, '{2}')",
|
||||
GUIDTextBox.Text, userID, USER_USERNAME)
|
||||
If MYDB_ECM.ExecuteNonQuery(insert) = False Then
|
||||
MsgBox("Could not insert the User-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each row As DataRow In DD_ECMAdmin.TBAD_Users.Rows
|
||||
row.Item(0) = CBool(False)
|
||||
Next
|
||||
Load_Users_Right_Man_Add()
|
||||
Catch ex As Exception
|
||||
MsgBox("Error while adding user: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btndeleteUserConstructorRel_Click(sender As Object, e As EventArgs) Handles btndeleteUser.Click
|
||||
If GUIDTextBox.Text = "" Then
|
||||
MsgBox("Please choose a node by clicking in the treeview!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
Dim refresh As Boolean = False
|
||||
For Each row As DataRow In DD_ECMAdmin.TBWH_Users1.Rows
|
||||
If row.Item(0) = CBool(True) Then
|
||||
Dim oUserID = row.Item(5)
|
||||
Dim delete = String.Format("DELETE FROM [TBOF_MAP_RIGHT_NODE_ADD_USER] WHERE [FK_TBDDUSER_ID] = {0} And [FK_TBPMO_SN_CONFIG_ID] = {1}", oUserID, GUIDTextBox.Text)
|
||||
If MYDB_ECM.ExecuteNonQuery(delete) Then
|
||||
refresh = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If refresh = True Then Load_Users_Right_Man_Add()
|
||||
Catch ex As Exception
|
||||
MsgBox("Error while deleting user: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub AlleUserAuswählenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AlleUserAuswählenToolStripMenuItem.Click
|
||||
' Dynamisch ermitteln, welches GridControl das Menü geöffnet hat
|
||||
Dim sourceControl = TryCast(ContextMenuStrip1.SourceControl, DevExpress.XtraGrid.GridControl)
|
||||
If sourceControl Is Nothing Then Exit Sub
|
||||
|
||||
If sourceControl Is GridControlFreeUsers Then
|
||||
' Select-Spalte (Index 0) in TBAD_Users setzen
|
||||
For Each row As DataRow In DD_ECMAdmin.TBAD_Users.Rows
|
||||
row.Item(0) = CBool(True)
|
||||
Next
|
||||
GridViewFreeUsers.SelectAll()
|
||||
|
||||
ElseIf sourceControl Is GridControl_Right_AddmanNode_User Then
|
||||
' Select-Spalte (Index 0) in TBWH_Users1 setzen
|
||||
For Each row As DataRow In DD_ECMAdmin.TBWH_Users1.Rows
|
||||
row.Item(0) = CBool(True)
|
||||
Next
|
||||
GridViewRight_AddmanNode_User.SelectAll()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub KeineAuswahlToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles KeineAuswahlToolStripMenuItem.Click
|
||||
' Dynamisch ermitteln, welches GridControl das Menü geöffnet hat
|
||||
Dim sourceControl = TryCast(ContextMenuStrip1.SourceControl, DevExpress.XtraGrid.GridControl)
|
||||
If sourceControl Is Nothing Then Exit Sub
|
||||
|
||||
If sourceControl Is GridControlFreeUsers Then
|
||||
' Select-Spalte (Index 0) in TBAD_Users setzen
|
||||
For Each row As DataRow In DD_ECMAdmin.TBAD_Users.Rows
|
||||
row.Item(0) = CBool(False)
|
||||
Next
|
||||
GridViewFreeUsers.ClearSelection()
|
||||
ElseIf sourceControl Is GridControl_Right_AddmanNode_User Then
|
||||
' Select-Spalte (Index 0) in TBWH_Users1 setzen
|
||||
For Each row As DataRow In DD_ECMAdmin.TBWH_Users1.Rows
|
||||
row.Item(0) = CBool(False)
|
||||
Next
|
||||
GridViewRight_AddmanNode_User.ClearSelection()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user