fix drag drop !!!!111einself11111!!!

This commit is contained in:
Jonathan Jenne
2020-06-05 16:21:16 +02:00
parent d3373e0368
commit b1542c7091
6 changed files with 1196 additions and 1243 deletions

View File

@@ -27,8 +27,8 @@ Public Class frmAdministration
XtraTabControl3.SelectedTabPageIndex = 0
_DragDrop = New ClassDragDrop()
'_DragDrop.AddGridView(GridViewGroupInProfile)
'_DragDrop.AddGridView(GridViewGroupNotInProfile)
_DragDrop.AddGridView(GridViewGroupInProfile)
_DragDrop.AddGridView(GridViewGroupNotInProfile)
_DragDrop.AddGridView(GridViewUserInProfile)
_DragDrop.AddGridView(GridViewUserNotInProfile)
@@ -215,7 +215,7 @@ Public Class frmAdministration
newUserRow.Email = ""
End Try
newUserRow.ID = row.Item("GUID")
newUserRow.GUID = row.Item("GUID")
MyDataset.TBWH_User.Rows.Add(newUserRow)
' chklbxUserForGroup.Items.Add(New MyListBoxItem() With {.Text = row.Item(1), .ExtraData = row.Item(0)})
Next
@@ -236,7 +236,7 @@ Public Class frmAdministration
Dim oNewRow As MyDataset.TBWH_GROUPRow
oNewRow = MyDataset.TBWH_GROUP.NewTBWH_GROUPRow
oNewRow.NAME = row.Item("NAME")
oNewRow.ID = row.Item("GUID")
oNewRow.GUID = row.Item("GUID")
MyDataset.TBWH_GROUP.Rows.Add(oNewRow)
Next
Catch ex As Exception
@@ -392,114 +392,6 @@ Public Class frmAdministration
Status_Changed("Fensterzuordnung gelöscht")
End Sub
Private Sub BarButtonItem11_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem11.ItemClick
Try
If PROFILE_IDTextBox.Text = String.Empty Then
Exit Sub
End If
Dim oSelectedRows = GridViewUserNotInProfile.GetSelectedRows()
For Each oRowHandle As Integer In oSelectedRows
Dim oRow As DataRow = GridViewUserNotInProfile.GetDataRow(oRowHandle)
Dim oGuid As Integer = oRow.Item("ID")
Dim insert = String.Format("INSERT INTO TBCW_USER_PROFILE (PROFILE_ID,USER_ID) VALUES ({0},{1})", PROFILE_IDTextBox.Text, oGuid)
If Database.ExecuteNonQuery(insert) = False Then
MsgBox("Error while adding user!", MsgBoxStyle.Exclamation)
End If
Next
Refresh_Free_Users(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
GridViewUserNotInProfile.ClearSelection()
Status_Changed($"{oSelectedRows.Count} Benutzer zugeordnet")
Catch ex As Exception
Logger.Error(ex)
MsgBox("Unexpected Error while adding user-rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub BarButtonItem12_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem12.ItemClick
Try
If PROFILE_IDTextBox.Text = String.Empty Then
Exit Sub
End If
Dim oSelectedRows = GridViewUserInProfile.GetSelectedRows()
For Each oRowHandle As Integer In oSelectedRows
Dim oRow As DataRow = GridViewUserInProfile.GetDataRow(oRowHandle)
Dim oGuid As Integer = oRow.Item("GUID")
Dim del = String.Format("DELETE FROM TBCW_USER_PROFILE WHERE GUID = {0}", oGuid)
If Database.ExecuteNonQuery(del) = False Then
MsgBox("Error while adding user!", MsgBoxStyle.Exclamation)
End If
Next
Refresh_Free_Users(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
GridViewUserInProfile.ClearSelection()
Status_Changed($"{oSelectedRows.Count} Benutzerzuordnungen gelöscht")
Catch ex As Exception
Logger.Error(ex)
MsgBox("Unexpected Error in deleting ProfileUserRelation: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub BarButtonItem13_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem13.ItemClick
Try
Dim oSelectedGroups = GridViewGroupNotInProfile.GetSelectedRows()
For Each oRowHandle In oSelectedGroups
Dim oRow As MyDataset.TBWH_GROUPRow = DirectCast(GridViewGroupNotInProfile.GetRow(oRowHandle), DataRowView).Row
Dim oGroupId As Integer = oRow.ID
Dim oSQL As String = $"INSERT INTO TBCW_GROUP_PROFILE (PROFILE_ID,GROUP_ID) VALUES ({PROFILE_IDTextBox.Text},{oGroupId})"
If Database.ExecuteNonQuery(oSQL) = False Then
MsgBox("Could not insert the Group-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
End If
Next
GridViewGroupNotInProfile.ClearSelection()
Refresh_Free_Groups(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
Status_Changed($"{oSelectedGroups.Count} Gruppen zugeordnet")
Catch ex As Exception
MsgBox("Unexpected Error while adding Group-Rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub BarButtonItem14_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem14.ItemClick
Try
Dim oSelectedGroups = GridViewGroupInProfile.GetSelectedRows()
For Each oRowHandle In oSelectedGroups
Dim oRow As MyDataset.VWCW_GROUP_PROFILERow = DirectCast(GridViewGroupInProfile.GetRow(oRowHandle), DataRowView).Row
Dim oGroupId As Integer = oRow.GUID
Dim oSQL As String = $"DELETE FROM TBCW_GROUP_PROFILE WHERE GUID = ({oGroupId})"
If Database.ExecuteNonQuery(oSQL) = False Then
MsgBox("Could not delete the Group-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
End If
Next
GridViewGroupInProfile.ClearSelection()
Refresh_Free_Groups(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
Status_Changed($"{oSelectedGroups.Count} Gruppenzuordnungen gelöscht")
Catch ex As Exception
MsgBox("Unexpected Error in deleting Group-Rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl1.SelectedPageChanged, XtraTabControl2.SelectedPageChanged
Dim oTabName As String = e.Page.Name
@@ -752,35 +644,6 @@ Public Class frmAdministration
End If
End Sub
Private Sub GridControlUserInProfile_DragDrop(sender As Object, e As DragEventArgs)
'Try
' If PROFILE_IDTextBox.Text = String.Empty Then
' Exit Sub
' End If
' Dim oSelectedRows = GridViewUserNotInProfile.GetSelectedRows()
' For Each oRowHandle As Integer In oSelectedRows
' Dim oRow As DataRow = GridViewUserNotInProfile.GetDataRow(oRowHandle)
' Dim oGuid As Integer = oRow.Item("ID")
' Dim insert = String.Format("INSERT INTO TBCW_USER_PROFILE (PROFILE_ID,USER_ID) VALUES ({0},{1})", PROFILE_IDTextBox.Text, oGuid)
' If Database.ExecuteNonQuery(insert) = False Then
' MsgBox("Error while adding user!", MsgBoxStyle.Exclamation)
' End If
' Next
' Refresh_Free_Users(PROFILE_IDTextBox.Text)
' Refresh_ProfileData()
' GridViewUserNotInProfile.ClearSelection()
' Status_Changed($"{oSelectedRows.Count} Benutzer zugeordnet")
'Catch ex As Exception
' Logger.Error(ex)
' MsgBox("Unexpected Error while adding user-rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
'End Try
End Sub
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
If txtRegexTestString.Text.Count = 0 Then
MsgBox("Bitte füllen Sie den Regular Expression Test aus!", MsgBoxStyle.Exclamation, Text)
@@ -803,7 +666,115 @@ Public Class frmAdministration
End Sub
Private Sub XtraTabControl3_Click(sender As Object, e As EventArgs) Handles XtraTabControl3.Click
Private Sub GridControlUserNotInProfile_DragDrop(sender As Object, e As DragEventArgs) Handles GridControlUserNotInProfile.DragDrop
Try
If PROFILE_IDTextBox.Text = String.Empty Then
Exit Sub
End If
Dim oSelectedRows = GridViewUserInProfile.GetSelectedRows()
For Each oRowHandle As Integer In oSelectedRows
Dim oRow As DataRow = GridViewUserInProfile.GetDataRow(oRowHandle)
Dim oGuid As Integer = oRow.Item("GUID")
Dim del = String.Format("DELETE FROM TBCW_USER_PROFILE WHERE GUID = {0}", oGuid)
If Database.ExecuteNonQuery(del) = False Then
MsgBox("Error while adding user!", MsgBoxStyle.Exclamation)
End If
Next
Refresh_Free_Users(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
GridViewUserInProfile.ClearSelection()
Status_Changed($"{oSelectedRows.Count} Benutzerzuordnungen gelöscht")
Catch ex As Exception
Logger.Error(ex)
MsgBox("Unexpected Error in deleting ProfileUserRelation: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub GridControlUserInProfile_DragDrop(sender As Object, e As DragEventArgs) Handles GridControlUserInProfile.DragDrop
Try
If PROFILE_IDTextBox.Text = String.Empty Then
Exit Sub
End If
Dim oSelectedRows = GridViewUserNotInProfile.GetSelectedRows()
For Each oRowHandle As Integer In oSelectedRows
Dim oRow As DataRow = GridViewUserNotInProfile.GetDataRow(oRowHandle)
Dim oGuid As Integer = oRow.Item("GUID")
Dim insert = String.Format("INSERT INTO TBCW_USER_PROFILE (PROFILE_ID,USER_ID) VALUES ({0},{1})", PROFILE_IDTextBox.Text, oGuid)
If Database.ExecuteNonQuery(insert) = False Then
MsgBox("Error while adding user!", MsgBoxStyle.Exclamation)
End If
Next
Refresh_Free_Users(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
GridViewUserNotInProfile.ClearSelection()
Status_Changed($"{oSelectedRows.Count} Benutzer zugeordnet")
Catch ex As Exception
Logger.Error(ex)
MsgBox("Unexpected Error while adding user-rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub XtraTabControl2_DragDrop(sender As Object, e As DragEventArgs) Handles XtraTabControl2.DragDrop
End Sub
Private Sub GridControlGroupNotInProfile_DragDrop(sender As Object, e As DragEventArgs) Handles GridControlGroupNotInProfile.DragDrop
Try
Dim oSelectedGroups = GridViewGroupInProfile.GetSelectedRows()
For Each oRowHandle In oSelectedGroups
Dim oRow As MyDataset.VWCW_GROUP_PROFILERow = DirectCast(GridViewGroupInProfile.GetRow(oRowHandle), DataRowView).Row
Dim oGroupId As Integer = oRow.GUID
Dim oSQL As String = $"DELETE FROM TBCW_GROUP_PROFILE WHERE GUID = ({oGroupId})"
If Database.ExecuteNonQuery(oSQL) = False Then
MsgBox("Could not delete the Group-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
End If
Next
GridViewGroupInProfile.ClearSelection()
Refresh_Free_Groups(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
Status_Changed($"{oSelectedGroups.Count} Gruppenzuordnungen gelöscht")
Catch ex As Exception
MsgBox("Unexpected Error in deleting Group-Rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub GridControlGroupInProfile_DragDrop(sender As Object, e As DragEventArgs) Handles GridControlGroupInProfile.DragDrop
Try
Dim oSelectedGroups = GridViewGroupNotInProfile.GetSelectedRows()
For Each oRowHandle In oSelectedGroups
Dim oRow As MyDataset.TBWH_GROUPRow = DirectCast(GridViewGroupNotInProfile.GetRow(oRowHandle), DataRowView).Row
Dim oGroupId As Integer = oRow.GUID
Dim oSQL As String = $"INSERT INTO TBCW_GROUP_PROFILE (PROFILE_ID,GROUP_ID) VALUES ({PROFILE_IDTextBox.Text},{oGroupId})"
If Database.ExecuteNonQuery(oSQL) = False Then
MsgBox("Could not insert the Group-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
End If
Next
GridViewGroupNotInProfile.ClearSelection()
Refresh_Free_Groups(PROFILE_IDTextBox.Text)
Refresh_ProfileData()
Status_Changed($"{oSelectedGroups.Count} Gruppen zugeordnet")
Catch ex As Exception
MsgBox("Unexpected Error while adding Group-Rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
End Class