From 767b8ad431b50e620e270a5deae69245c8c0f231 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 3 May 2018 16:40:35 +0200 Subject: [PATCH] jj: Assign users to clients, tweak ui --- .../DDUserManager/DDUserManager.vbproj | 3 + .../DDUserManager/UserDataSet.Designer.vb | 373 ++++----- DDUserManager/DDUserManager/UserDataSet.vb | 10 + DDUserManager/DDUserManager/UserDataSet.xsd | 141 ++-- DDUserManager/DDUserManager/UserDataSet.xss | 54 +- .../DDUserManager/frmMain.Designer.vb | 728 +++++++++++++----- DDUserManager/DDUserManager/frmMain.resx | 10 +- DDUserManager/DDUserManager/frmMain.vb | 276 +++++-- 8 files changed, 1058 insertions(+), 537 deletions(-) create mode 100644 DDUserManager/DDUserManager/UserDataSet.vb diff --git a/DDUserManager/DDUserManager/DDUserManager.vbproj b/DDUserManager/DDUserManager/DDUserManager.vbproj index 7cc4df9..28d1ff9 100644 --- a/DDUserManager/DDUserManager/DDUserManager.vbproj +++ b/DDUserManager/DDUserManager/DDUserManager.vbproj @@ -110,6 +110,9 @@ True UserDataSet.xsd + + UserDataSet.xsd + diff --git a/DDUserManager/DDUserManager/UserDataSet.Designer.vb b/DDUserManager/DDUserManager/UserDataSet.Designer.vb index cb28c81..f285ca5 100644 --- a/DDUserManager/DDUserManager/UserDataSet.Designer.vb +++ b/DDUserManager/DDUserManager/UserDataSet.Designer.vb @@ -6170,42 +6170,22 @@ Namespace UserDataSetTableAdapters Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection - Me._adapter.DeleteCommand.CommandText = "DELETE FROM [TBDD_GROUPS_USER] WHERE (([GUID] = @Original_GUID) AND ([USER_ID] = "& _ - "@Original_USER_ID) AND ([GROUP_ID] = @Original_GROUP_ID) AND ((@IsNull_COMMENT ="& _ - " 1 AND [COMMENT] IS NULL) OR ([COMMENT] = @Original_COMMENT)) AND ([ADDED_WHO] ="& _ - " @Original_ADDED_WHO) AND ((@IsNull_ADDED_WHEN = 1 AND [ADDED_WHEN] IS NULL) OR "& _ - "([ADDED_WHEN] = @Original_ADDED_WHEN)) AND ((@IsNull_CHANGED_WHO = 1 AND [CHANGE"& _ - "D_WHO] IS NULL) OR ([CHANGED_WHO] = @Original_CHANGED_WHO)) AND ((@IsNull_CHANGE"& _ - "D_WHEN = 1 AND [CHANGED_WHEN] IS NULL) OR ([CHANGED_WHEN] = @Original_CHANGED_WH"& _ - "EN)))" + Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBDD_GROUPS_USER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (USER_ID = @USER_ID) AND (GROUP_ID = @"& _ + "GROUP_ID)" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_USER_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GROUP_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_COMMENT", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_COMMENT", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ADDED_WHEN", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_CHANGED_WHO", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_CHANGED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_CHANGED_WHEN", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection - Me._adapter.InsertCommand.CommandText = "INSERT INTO [TBDD_GROUPS_USER] ([USER_ID], [GROUP_ID], [COMMENT], [ADDED_WHO], [A"& _ - "DDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (@USER_ID, @GROUP_ID, @COMMENT"& _ - ", @ADDED_WHO, @ADDED_WHEN, @CHANGED_WHO, @CHANGED_WHEN);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT GUID, USER_ID, "& _ - "GROUP_ID, COMMENT, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN FROM TBDD_GR"& _ - "OUPS_USER WHERE (GUID = SCOPE_IDENTITY())" + Me._adapter.InsertCommand.CommandText = "INSERT INTO TBDD_GROUPS_USER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (USER_ID, GROUP_ID, COMMEN"& _ + "T, ADDED_WHO)"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"VALUES (@USER_ID,@GROUP_ID,@COMMENT,@ADDED_WHO); "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT "& _ + "GUID, USER_ID, GROUP_ID, COMMENT, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WH"& _ + "EN FROM TBDD_GROUPS_USER WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COMMENT", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CHANGED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CHANGED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COMMENT", Global.System.Data.SqlDbType.VarChar, 200, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [TBDD_GROUPS_USER] SET [USER_ID] = @USER_ID, [GROUP_ID] = @GROUP_ID, [COMM"& _ @@ -6349,43 +6329,9 @@ Namespace UserDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ - Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer, ByVal Original_USER_ID As Integer, ByVal Original_GROUP_ID As Integer, ByVal Original_COMMENT As String, ByVal Original_ADDED_WHO As String, ByVal Original_ADDED_WHEN As Global.System.Nullable(Of Date), ByVal Original_CHANGED_WHO As String, ByVal Original_CHANGED_WHEN As Global.System.Nullable(Of Date)) As Integer - Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) - Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_USER_ID,Integer) - Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_GROUP_ID,Integer) - If (Original_COMMENT Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_COMMENT,String) - End If - If (Original_ADDED_WHO Is Nothing) Then - Throw New Global.System.ArgumentNullException("Original_ADDED_WHO") - Else - Me.Adapter.DeleteCommand.Parameters(5).Value = CType(Original_ADDED_WHO,String) - End If - If (Original_ADDED_WHEN.HasValue = true) Then - Me.Adapter.DeleteCommand.Parameters(6).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(7).Value = CType(Original_ADDED_WHEN.Value,Date) - Else - Me.Adapter.DeleteCommand.Parameters(6).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(7).Value = Global.System.DBNull.Value - End If - If (Original_CHANGED_WHO Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(8).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(9).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(8).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(9).Value = CType(Original_CHANGED_WHO,String) - End If - If (Original_CHANGED_WHEN.HasValue = true) Then - Me.Adapter.DeleteCommand.Parameters(10).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(11).Value = CType(Original_CHANGED_WHEN.Value,Date) - Else - Me.Adapter.DeleteCommand.Parameters(10).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(11).Value = Global.System.DBNull.Value - End If + Public Overloads Overridable Function Delete(ByVal USER_ID As Integer, ByVal GROUP_ID As Integer) As Integer + Me.Adapter.DeleteCommand.Parameters(0).Value = CType(USER_ID,Integer) + Me.Adapter.DeleteCommand.Parameters(1).Value = CType(GROUP_ID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -6405,7 +6351,7 @@ Namespace UserDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ - Public Overloads Overridable Function Insert(ByVal USER_ID As Integer, ByVal GROUP_ID As Integer, ByVal COMMENT As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Global.System.Nullable(Of Date), ByVal CHANGED_WHO As String, ByVal CHANGED_WHEN As Global.System.Nullable(Of Date)) As Integer + Public Overloads Overridable Function Insert(ByVal USER_ID As Integer, ByVal GROUP_ID As Integer, ByVal COMMENT As String, ByVal ADDED_WHO As String) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(USER_ID,Integer) Me.Adapter.InsertCommand.Parameters(1).Value = CType(GROUP_ID,Integer) If (COMMENT Is Nothing) Then @@ -6418,21 +6364,6 @@ Namespace UserDataSetTableAdapters Else Me.Adapter.InsertCommand.Parameters(3).Value = CType(ADDED_WHO,String) End If - If (ADDED_WHEN.HasValue = true) Then - Me.Adapter.InsertCommand.Parameters(4).Value = CType(ADDED_WHEN.Value,Date) - Else - Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value - End If - If (CHANGED_WHO Is Nothing) Then - Me.Adapter.InsertCommand.Parameters(5).Value = Global.System.DBNull.Value - Else - Me.Adapter.InsertCommand.Parameters(5).Value = CType(CHANGED_WHO,String) - End If - If (CHANGED_WHEN.HasValue = true) Then - Me.Adapter.InsertCommand.Parameters(6).Value = CType(CHANGED_WHEN.Value,Date) - Else - Me.Adapter.InsertCommand.Parameters(6).Value = Global.System.DBNull.Value - End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -8723,34 +8654,22 @@ Namespace UserDataSetTableAdapters Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.DeleteCommand.Connection = Me.Connection - Me._adapter.DeleteCommand.CommandText = "DELETE FROM [TBDD_CLIENT_USER] WHERE (([GUID] = @Original_GUID) AND ([USER_ID] = "& _ - "@Original_USER_ID) AND ([CLIENT_ID] = @Original_CLIENT_ID) AND ((@IsNull_COMMENT"& _ - " = 1 AND [COMMENT] IS NULL) OR ([COMMENT] = @Original_COMMENT)) AND ((@IsNull_AD"& _ - "DED_WHO = 1 AND [ADDED_WHO] IS NULL) OR ([ADDED_WHO] = @Original_ADDED_WHO)) AND"& _ - " ((@IsNull_ADDED_WHEN = 1 AND [ADDED_WHEN] IS NULL) OR ([ADDED_WHEN] = @Original"& _ - "_ADDED_WHEN)))" + Me._adapter.DeleteCommand.CommandText = "DELETE FROM TBDD_CLIENT_USER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (USER_ID = @USER_ID) AND (CLIENT_ID = "& _ + "@CLIENT_ID)" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_GUID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "GUID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_USER_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_CLIENT_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CLIENT_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_COMMENT", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_COMMENT", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ADDED_WHO", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ADDED_WHEN", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) - Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CLIENT_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CLIENT_ID", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.InsertCommand.Connection = Me.Connection - Me._adapter.InsertCommand.CommandText = "INSERT INTO [TBDD_CLIENT_USER] ([USER_ID], [CLIENT_ID], [COMMENT], [ADDED_WHO], ["& _ - "ADDED_WHEN]) VALUES (@USER_ID, @CLIENT_ID, @COMMENT, @ADDED_WHO, @ADDED_WHEN);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)& _ - "SELECT GUID, USER_ID, CLIENT_ID, COMMENT, ADDED_WHO, ADDED_WHEN FROM TBDD_CLIENT"& _ - "_USER WHERE (GUID = SCOPE_IDENTITY())" + Me._adapter.InsertCommand.CommandText = "INSERT INTO TBDD_CLIENT_USER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (USER_ID, CLIENT_ID, COMME"& _ + "NT, ADDED_WHO)"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"VALUES (@USER_ID,@CLIENT_ID,@COMMENT,@ADDED_WHO); "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELEC"& _ + "T GUID, USER_ID, CLIENT_ID, COMMENT, ADDED_WHO, ADDED_WHEN FROM TBDD_CLIENT_USER"& _ + " WHERE (GUID = SCOPE_IDENTITY())" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CLIENT_ID", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "CLIENT_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COMMENT", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) - Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHEN", Global.System.Data.SqlDbType.DateTime, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHEN", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USER_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "USER_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CLIENT_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CLIENT_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@COMMENT", Global.System.Data.SqlDbType.VarChar, 200, Global.System.Data.ParameterDirection.Input, 0, 0, "COMMENT", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ADDED_WHO", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "ADDED_WHO", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [TBDD_CLIENT_USER] SET [USER_ID] = @USER_ID, [CLIENT_ID] = @CLIENT_ID, [CO"& _ @@ -8853,31 +8772,9 @@ Namespace UserDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ - Public Overloads Overridable Function Delete(ByVal Original_GUID As Integer, ByVal Original_USER_ID As Integer, ByVal Original_CLIENT_ID As Integer, ByVal Original_COMMENT As String, ByVal Original_ADDED_WHO As String, ByVal Original_ADDED_WHEN As Global.System.Nullable(Of Date)) As Integer - Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_GUID,Integer) - Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_USER_ID,Integer) - Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_CLIENT_ID,Integer) - If (Original_COMMENT Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_COMMENT,String) - End If - If (Original_ADDED_WHO Is Nothing) Then - Me.Adapter.DeleteCommand.Parameters(5).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value - Else - Me.Adapter.DeleteCommand.Parameters(5).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(6).Value = CType(Original_ADDED_WHO,String) - End If - If (Original_ADDED_WHEN.HasValue = true) Then - Me.Adapter.DeleteCommand.Parameters(7).Value = CType(0,Object) - Me.Adapter.DeleteCommand.Parameters(8).Value = CType(Original_ADDED_WHEN.Value,Date) - Else - Me.Adapter.DeleteCommand.Parameters(7).Value = CType(1,Object) - Me.Adapter.DeleteCommand.Parameters(8).Value = Global.System.DBNull.Value - End If + Public Overloads Overridable Function Delete(ByVal USER_ID As Integer, ByVal CLIENT_ID As Integer) As Integer + Me.Adapter.DeleteCommand.Parameters(0).Value = CType(USER_ID,Integer) + Me.Adapter.DeleteCommand.Parameters(1).Value = CType(CLIENT_ID,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -8897,7 +8794,7 @@ Namespace UserDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ - Public Overloads Overridable Function Insert(ByVal USER_ID As Integer, ByVal CLIENT_ID As Integer, ByVal COMMENT As String, ByVal ADDED_WHO As String, ByVal ADDED_WHEN As Global.System.Nullable(Of Date)) As Integer + Public Overloads Overridable Function Insert(ByVal USER_ID As Integer, ByVal CLIENT_ID As Integer, ByVal COMMENT As String, ByVal ADDED_WHO As String) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(USER_ID,Integer) Me.Adapter.InsertCommand.Parameters(1).Value = CType(CLIENT_ID,Integer) If (COMMENT Is Nothing) Then @@ -8910,11 +8807,6 @@ Namespace UserDataSetTableAdapters Else Me.Adapter.InsertCommand.Parameters(3).Value = CType(ADDED_WHO,String) End If - If (ADDED_WHEN.HasValue = true) Then - Me.Adapter.InsertCommand.Parameters(4).Value = CType(ADDED_WHEN.Value,Date) - Else - Me.Adapter.InsertCommand.Parameters(4).Value = Global.System.DBNull.Value - End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -9337,81 +9229,190 @@ Namespace UserDataSetTableAdapters _ Private Sub InitCommandCollection() - Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(1) {} + Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(4) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(0).Connection = Me.Connection - Me._commandCollection(0).CommandText = "SELECT TBDD_USER.*" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM TBDD_USER" + Me._commandCollection(0).CommandText = "SELECT TBDD_USER.*"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBDD_USER" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(1) = New Global.System.Data.SqlClient.SqlCommand() Me._commandCollection(1).Connection = Me.Connection - Me._commandCollection(1).CommandText = "SELECT T1.GUID, T1.PRENAME, T1.NAME, T1.USERNAME, T1.SHORTNAME, T1.EMAIL, " & - "T1.LANGUAGE, T1.GENERAL_VIEWER, T1.COMMENT, T1.WAN_ENVIRONMENT, T1.LOGGED_IN, T1" & - ".LOGGED_WHERE, T1.LOG_IN_WHEN, " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " T1.LOG_OUT_WHEN, T1.PM" & - "_RIGHT_FILE_DELETE, T1.USERID_FK_INT_ECM, T1.DATE_FORMAT, T1.ADDED_WHO, T1.ADDED" & - "_WHEN, T1.CHANGED_WHO, T1.CHANGED_WHEN" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM TBDD_USER AS T1 INNER JO" & - "IN" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " TBDD_GROUPS_USER AS T2 ON T1.GUID = T2.USER_ID" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "WHE" & - "RE (T2.GROUP_ID = @GROUP_ID)" + Me._commandCollection(1).CommandText = "SELECT T1.GUID, T1.PRENAME, T1.NAME, T1.USERNAME, T1.SHORTNAME, T1.EMAIL, "& _ + "T1.LANGUAGE, T1.GENERAL_VIEWER, T1.COMMENT, T1.WAN_ENVIRONMENT, T1.LOGGED_IN, T1"& _ + ".LOGGED_WHERE, T1.LOG_IN_WHEN, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" T1.LOG_OUT_WHEN, T1.PM"& _ + "_RIGHT_FILE_DELETE, T1.USERID_FK_INT_ECM, T1.DATE_FORMAT, T1.ADDED_WHO, T1.ADDED"& _ + "_WHEN, T1.CHANGED_WHO, T1.CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBDD_USER AS T1 INNER JO"& _ + "IN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" TBDD_CLIENT_USER AS T2 ON T1.GUID = T2.USER_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHE"& _ + "RE (T2.CLIENT_ID = @CLIENT_ID)" Me._commandCollection(1).CommandType = Global.System.Data.CommandType.Text - Me._commandCollection(1).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Current, False, Nothing, "", "", "")) + Me._commandCollection(1).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CLIENT_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "CLIENT_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(2) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(2).Connection = Me.Connection + Me._commandCollection(2).CommandText = "SELECT GUID, PRENAME, NAME, USERNAME, SHORTNAME, EMAIL, LANGUAGE, GENERAL_"& _ + "VIEWER, COMMENT, WAN_ENVIRONMENT, LOGGED_IN, LOGGED_WHERE, LOG_IN_WHEN, LOG_OUT_"& _ + "WHEN, PM_RIGHT_FILE_DELETE, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" USERID_FK_INT_ECM, DATE_F"& _ + "ORMAT, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBDD_US"& _ + "ER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE (GUID NOT IN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (SELECT DISTINCT T.G"& _ + "UID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" FROM TBDD_USER AS T INNER JOIN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" "& _ + " TBDD_CLIENT_USER AS T1 O"& _ + "N T.GUID = T1.USER_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" WHERE (T1.CLIENT_ID"& _ + " = @CLIENT_ID)))" + Me._commandCollection(2).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(2).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@CLIENT_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(3) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(3).Connection = Me.Connection + Me._commandCollection(3).CommandText = "SELECT T1.GUID, T1.PRENAME, T1.NAME, T1.USERNAME, T1.SHORTNAME, T1.EMAIL, "& _ + "T1.LANGUAGE, T1.GENERAL_VIEWER, T1.COMMENT, T1.WAN_ENVIRONMENT, T1.LOGGED_IN, T1"& _ + ".LOGGED_WHERE, T1.LOG_IN_WHEN, "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" T1.LOG_OUT_WHEN, T1.PM"& _ + "_RIGHT_FILE_DELETE, T1.USERID_FK_INT_ECM, T1.DATE_FORMAT, T1.ADDED_WHO, T1.ADDED"& _ + "_WHEN, T1.CHANGED_WHO, T1.CHANGED_WHEN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM TBDD_USER AS T1 INNER JO"& _ + "IN"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" TBDD_GROUPS_USER AS T2 ON T1.GUID = T2.USER_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHE"& _ + "RE (T2.GROUP_ID = @GROUP_ID)" + Me._commandCollection(3).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(3).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "GROUP_ID", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) + Me._commandCollection(4) = New Global.System.Data.SqlClient.SqlCommand() + Me._commandCollection(4).Connection = Me.Connection + Me._commandCollection(4).CommandText = "SELECT * FROM TBDD_USER where GUID NOT IN "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"(SELECT DISTINCT"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(9)&"T.GUID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"FROM"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(9)&"TBD"& _ + "D_USER"&Global.Microsoft.VisualBasic.ChrW(9)&Global.Microsoft.VisualBasic.ChrW(9)&Global.Microsoft.VisualBasic.ChrW(9)&"T"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(9)&"INNER JOIN TBDD_GROUPS_USER"&Global.Microsoft.VisualBasic.ChrW(9)&"T1 ON T.GUID = T1.USER_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(9)&"GROU"& _ + "P_ID = @GROUP_ID)" + Me._commandCollection(4).CommandType = Global.System.Data.CommandType.Text + Me._commandCollection(4).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@GROUP_ID", Global.System.Data.SqlDbType.Int, 4, Global.System.Data.ParameterDirection.Input, 0, 0, "", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) End Sub - - - Public Overridable Overloads Function Fill(ByVal dataTable As UserDataSet.TBDD_USERDataTable) As Integer + + _ + Public Overloads Overridable Function Fill(ByVal dataTable As UserDataSet.TBDD_USERDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) - If (Me.ClearBeforeFill = True) Then - dataTable.Clear() + If (Me.ClearBeforeFill = true) Then + dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function - - - Public Overridable Overloads Function GetData() As UserDataSet.TBDD_USERDataTable + + _ + Public Overloads Overridable Function GetData() As UserDataSet.TBDD_USERDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As UserDataSet.TBDD_USERDataTable = New UserDataSet.TBDD_USERDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function - - - Public Overridable Overloads Function FillByGroupId(ByVal dataTable As UserDataSet.TBDD_USERDataTable, ByVal GROUP_ID As Integer) As Integer + + _ + Public Overloads Overridable Function FillByClientId(ByVal dataTable As UserDataSet.TBDD_USERDataTable, ByVal CLIENT_ID As Integer) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(1) - Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID, Integer) - If (Me.ClearBeforeFill = True) Then - dataTable.Clear() + Me.Adapter.SelectCommand.Parameters(0).Value = CType(CLIENT_ID,Integer) + If (Me.ClearBeforeFill = true) Then + dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function - - - Public Overridable Overloads Function GetDataByGroupId(ByVal GROUP_ID As Integer) As UserDataSet.TBDD_USERDataTable + + _ + Public Overloads Overridable Function GetDataByClientId(ByVal CLIENT_ID As Integer) As UserDataSet.TBDD_USERDataTable Me.Adapter.SelectCommand = Me.CommandCollection(1) - Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID, Integer) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(CLIENT_ID,Integer) Dim dataTable As UserDataSet.TBDD_USERDataTable = New UserDataSet.TBDD_USERDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function - - - Public Overridable Overloads Function Update(ByVal dataTable As UserDataSet.TBDD_USERDataTable) As Integer + + _ + Public Overloads Overridable Function FillByClientId_NotInClient(ByVal dataTable As UserDataSet.TBDD_USERDataTable, ByVal CLIENT_ID As Integer) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(2) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(CLIENT_ID,Integer) + If (Me.ClearBeforeFill = true) Then + dataTable.Clear + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + _ + Public Overloads Overridable Function GetDataByClientId_NotInClient(ByVal CLIENT_ID As Integer) As UserDataSet.TBDD_USERDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(2) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(CLIENT_ID,Integer) + Dim dataTable As UserDataSet.TBDD_USERDataTable = New UserDataSet.TBDD_USERDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + + _ + Public Overloads Overridable Function FillByGroupId(ByVal dataTable As UserDataSet.TBDD_USERDataTable, ByVal GROUP_ID As Integer) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(3) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID,Integer) + If (Me.ClearBeforeFill = true) Then + dataTable.Clear + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + _ + Public Overloads Overridable Function GetDataByGroupId(ByVal GROUP_ID As Integer) As UserDataSet.TBDD_USERDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(3) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID,Integer) + Dim dataTable As UserDataSet.TBDD_USERDataTable = New UserDataSet.TBDD_USERDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + + _ + Public Overloads Overridable Function FillByGroupId_NotInGroup(ByVal dataTable As UserDataSet.TBDD_USERDataTable, ByVal GROUP_ID As Integer) As Integer + Me.Adapter.SelectCommand = Me.CommandCollection(4) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID,Integer) + If (Me.ClearBeforeFill = true) Then + dataTable.Clear + End If + Dim returnValue As Integer = Me.Adapter.Fill(dataTable) + Return returnValue + End Function + + _ + Public Overloads Overridable Function GetDataByGroupId_NotInGroup(ByVal GROUP_ID As Integer) As UserDataSet.TBDD_USERDataTable + Me.Adapter.SelectCommand = Me.CommandCollection(4) + Me.Adapter.SelectCommand.Parameters(0).Value = CType(GROUP_ID,Integer) + Dim dataTable As UserDataSet.TBDD_USERDataTable = New UserDataSet.TBDD_USERDataTable() + Me.Adapter.Fill(dataTable) + Return dataTable + End Function + + _ + Public Overloads Overridable Function Update(ByVal dataTable As UserDataSet.TBDD_USERDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function - + _ diff --git a/DDUserManager/DDUserManager/UserDataSet.vb b/DDUserManager/DDUserManager/UserDataSet.vb new file mode 100644 index 0000000..b4124ca --- /dev/null +++ b/DDUserManager/DDUserManager/UserDataSet.vb @@ -0,0 +1,10 @@ +Partial Class UserDataSet +End Class + +Namespace UserDataSetTableAdapters + Partial Public Class TBDD_USERTableAdapter + End Class + + Partial Public Class TBDD_GROUPS_USERTableAdapter + End Class +End Namespace diff --git a/DDUserManager/DDUserManager/UserDataSet.xsd b/DDUserManager/DDUserManager/UserDataSet.xsd index e0d2fa7..a4d45cc 100644 --- a/DDUserManager/DDUserManager/UserDataSet.xsd +++ b/DDUserManager/DDUserManager/UserDataSet.xsd @@ -111,36 +111,26 @@ WHERE (T3.USERNAME = @USERNAME) - - DELETE FROM [TBDD_GROUPS_USER] WHERE (([GUID] = @Original_GUID) AND ([USER_ID] = @Original_USER_ID) AND ([GROUP_ID] = @Original_GROUP_ID) AND ((@IsNull_COMMENT = 1 AND [COMMENT] IS NULL) OR ([COMMENT] = @Original_COMMENT)) AND ([ADDED_WHO] = @Original_ADDED_WHO) AND ((@IsNull_ADDED_WHEN = 1 AND [ADDED_WHEN] IS NULL) OR ([ADDED_WHEN] = @Original_ADDED_WHEN)) AND ((@IsNull_CHANGED_WHO = 1 AND [CHANGED_WHO] IS NULL) OR ([CHANGED_WHO] = @Original_CHANGED_WHO)) AND ((@IsNull_CHANGED_WHEN = 1 AND [CHANGED_WHEN] IS NULL) OR ([CHANGED_WHEN] = @Original_CHANGED_WHEN))) + + DELETE FROM TBDD_GROUPS_USER +WHERE (USER_ID = @USER_ID) AND (GROUP_ID = @GROUP_ID) - - - - - - - - - - - - + + - - INSERT INTO [TBDD_GROUPS_USER] ([USER_ID], [GROUP_ID], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (@USER_ID, @GROUP_ID, @COMMENT, @ADDED_WHO, @ADDED_WHEN, @CHANGED_WHO, @CHANGED_WHEN); + + INSERT INTO TBDD_GROUPS_USER + (USER_ID, GROUP_ID, COMMENT, ADDED_WHO) +VALUES (@USER_ID,@GROUP_ID,@COMMENT,@ADDED_WHO); SELECT GUID, USER_ID, GROUP_ID, COMMENT, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN FROM TBDD_GROUPS_USER WHERE (GUID = SCOPE_IDENTITY()) - - - - - - - + + + + @@ -562,31 +552,26 @@ WHERE (T3.USERNAME = @USERNAME) - - DELETE FROM [TBDD_CLIENT_USER] WHERE (([GUID] = @Original_GUID) AND ([USER_ID] = @Original_USER_ID) AND ([CLIENT_ID] = @Original_CLIENT_ID) AND ((@IsNull_COMMENT = 1 AND [COMMENT] IS NULL) OR ([COMMENT] = @Original_COMMENT)) AND ((@IsNull_ADDED_WHO = 1 AND [ADDED_WHO] IS NULL) OR ([ADDED_WHO] = @Original_ADDED_WHO)) AND ((@IsNull_ADDED_WHEN = 1 AND [ADDED_WHEN] IS NULL) OR ([ADDED_WHEN] = @Original_ADDED_WHEN))) + + DELETE FROM TBDD_CLIENT_USER +WHERE (USER_ID = @USER_ID) AND (CLIENT_ID = @CLIENT_ID) - - - - - - - - - + + - - INSERT INTO [TBDD_CLIENT_USER] ([USER_ID], [CLIENT_ID], [COMMENT], [ADDED_WHO], [ADDED_WHEN]) VALUES (@USER_ID, @CLIENT_ID, @COMMENT, @ADDED_WHO, @ADDED_WHEN); + + INSERT INTO TBDD_CLIENT_USER + (USER_ID, CLIENT_ID, COMMENT, ADDED_WHO) +VALUES (@USER_ID,@CLIENT_ID,@COMMENT,@ADDED_WHO); SELECT GUID, USER_ID, CLIENT_ID, COMMENT, ADDED_WHO, ADDED_WHEN FROM TBDD_CLIENT_USER WHERE (GUID = SCOPE_IDENTITY()) - - - - - + + + + @@ -796,6 +781,37 @@ SELECT GUID, PRENAME, NAME, USERNAME, SHORTNAME, EMAIL, LANGUAGE, GENERAL_VIEWER + + + + SELECT T1.GUID, T1.PRENAME, T1.NAME, T1.USERNAME, T1.SHORTNAME, T1.EMAIL, T1.LANGUAGE, T1.GENERAL_VIEWER, T1.COMMENT, T1.WAN_ENVIRONMENT, T1.LOGGED_IN, T1.LOGGED_WHERE, T1.LOG_IN_WHEN, + T1.LOG_OUT_WHEN, T1.PM_RIGHT_FILE_DELETE, T1.USERID_FK_INT_ECM, T1.DATE_FORMAT, T1.ADDED_WHO, T1.ADDED_WHEN, T1.CHANGED_WHO, T1.CHANGED_WHEN +FROM TBDD_USER AS T1 INNER JOIN + TBDD_CLIENT_USER AS T2 ON T1.GUID = T2.USER_ID +WHERE (T2.CLIENT_ID = @CLIENT_ID) + + + + + + + + + + SELECT GUID, PRENAME, NAME, USERNAME, SHORTNAME, EMAIL, LANGUAGE, GENERAL_VIEWER, COMMENT, WAN_ENVIRONMENT, LOGGED_IN, LOGGED_WHERE, LOG_IN_WHEN, LOG_OUT_WHEN, PM_RIGHT_FILE_DELETE, + USERID_FK_INT_ECM, DATE_FORMAT, ADDED_WHO, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN +FROM TBDD_USER +WHERE (GUID NOT IN + (SELECT DISTINCT T.GUID + FROM TBDD_USER AS T INNER JOIN + TBDD_CLIENT_USER AS T1 ON T.GUID = T1.USER_ID + WHERE (T1.CLIENT_ID = @CLIENT_ID))) + + + + + + @@ -810,6 +826,23 @@ WHERE (T2.GROUP_ID = @GROUP_ID) + + + + SELECT * FROM TBDD_USER where GUID NOT IN +(SELECT DISTINCT + T.GUID +FROM + TBDD_USER T + INNER JOIN TBDD_GROUPS_USER T1 ON T.GUID = T1.USER_ID +WHERE + GROUP_ID = @GROUP_ID) + + + + + + @@ -820,7 +853,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -857,7 +890,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -889,7 +922,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -993,7 +1026,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -1018,7 +1051,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -1083,7 +1116,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -1107,7 +1140,7 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - + @@ -1239,12 +1272,12 @@ WHERE (T2.GROUP_ID = @GROUP_ID) - - - - - - + + + + + + \ No newline at end of file diff --git a/DDUserManager/DDUserManager/UserDataSet.xss b/DDUserManager/DDUserManager/UserDataSet.xss index 413e5d4..f1cd4cc 100644 --- a/DDUserManager/DDUserManager/UserDataSet.xss +++ b/DDUserManager/DDUserManager/UserDataSet.xss @@ -4,15 +4,15 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - + + + - - - + + + @@ -30,16 +30,16 @@ - 1227 - 342 + 1209 + 320 - 1227 + 1209 427 - + 505 @@ -55,46 +55,46 @@ - + - 782 - 397 + 755 + 362 - 782 - 405 + 755 + 462 361 - 405 + 462 - + - 961 - 397 + 934 + 362 - 961 - 444 + 934 + 462 1001 - 444 + 462 - + - 799 - 397 + 772 + 362 - 799 + 772 479 diff --git a/DDUserManager/DDUserManager/frmMain.Designer.vb b/DDUserManager/DDUserManager/frmMain.Designer.vb index 9083526..844cc40 100644 --- a/DDUserManager/DDUserManager/frmMain.Designer.vb +++ b/DDUserManager/DDUserManager/frmMain.Designer.vb @@ -91,28 +91,52 @@ Partial Class frmMain Me.TBDD_USER_GROUPSBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.XtraTabControl2 = New DevExpress.XtraTab.XtraTabControl() Me.tabGroupAssign = New DevExpress.XtraTab.XtraTabPage() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() + Me.SplitContainerUserGroups1 = New System.Windows.Forms.SplitContainer() + Me.SplitContainerUserGroups2 = New System.Windows.Forms.SplitContainer() Me.Label3 = New System.Windows.Forms.Label() - Me.gridAllGroups = New DevExpress.XtraGrid.GridControl() - Me.gvAllGroups = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.gridGroups_AllGroups = New DevExpress.XtraGrid.GridControl() + Me.gvGroups_AllGroups = New DevExpress.XtraGrid.Views.Grid.GridView() Me.colNAME2 = New DevExpress.XtraGrid.Columns.GridColumn() Me.colCOMMENT2 = New DevExpress.XtraGrid.Columns.GridColumn() - Me.gridUsersAssigned = New DevExpress.XtraGrid.GridControl() - Me.gvUsersAssigned = New DevExpress.XtraGrid.Views.Grid.GridView() - Me.GridColumn1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.Label4 = New System.Windows.Forms.Label() + Me.gridGroups_AvailableUsers = New DevExpress.XtraGrid.GridControl() + Me.gvGroups_AvailableUsers = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colUSERNAME1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colPRENAME1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colNAME1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colEmail3 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.Label5 = New System.Windows.Forms.Label() + Me.gridGroups_AssignedUsers = New DevExpress.XtraGrid.GridControl() + Me.gvGroups_AssignedUsers = New DevExpress.XtraGrid.Views.Grid.GridView() Me.GridColumn2 = New DevExpress.XtraGrid.Columns.GridColumn() Me.GridColumn3 = New DevExpress.XtraGrid.Columns.GridColumn() Me.GridColumn4 = New DevExpress.XtraGrid.Columns.GridColumn() Me.GridColumn5 = New DevExpress.XtraGrid.Columns.GridColumn() Me.GridView3 = New DevExpress.XtraGrid.Views.Grid.GridView() - Me.gridAllUsers = New DevExpress.XtraGrid.GridControl() - Me.gvAllUsers = New DevExpress.XtraGrid.Views.Grid.GridView() - Me.colUSERNAME1 = New DevExpress.XtraGrid.Columns.GridColumn() - Me.colPRENAME1 = New DevExpress.XtraGrid.Columns.GridColumn() - Me.colNAME1 = New DevExpress.XtraGrid.Columns.GridColumn() - Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() Me.tabClientAssign = New DevExpress.XtraTab.XtraTabPage() + Me.SplitContainer4 = New System.Windows.Forms.SplitContainer() + Me.Label6 = New System.Windows.Forms.Label() + Me.gridClients_AllClients = New DevExpress.XtraGrid.GridControl() + Me.gvClients_AllClients = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colCLIENT_NAME = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colSHORTNAME = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colCOMMENT = New DevExpress.XtraGrid.Columns.GridColumn() + Me.SplitContainer5 = New System.Windows.Forms.SplitContainer() + Me.Label7 = New System.Windows.Forms.Label() + Me.gridClients_AvailableUsers = New DevExpress.XtraGrid.GridControl() + Me.gvClients_AvailableUsers = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colPRENAME2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colNAME3 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colUSERNAME2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colEMAIL1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.Label8 = New System.Windows.Forms.Label() + Me.gridClients_AssignedUsers = New DevExpress.XtraGrid.GridControl() + Me.gvClients_AssignedUsers = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colPRENAME3 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colNAME4 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colUSERNAME3 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colEMAIL2 = New DevExpress.XtraGrid.Columns.GridColumn() Me.TBDD_USERBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) Me.BindingNavigatorAddNewItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorCountItem = New System.Windows.Forms.ToolStripLabel() @@ -182,8 +206,6 @@ Partial Class frmMain Me.TBDD_USER_MODULESBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TBDD_USER_MODULESTableAdapter = New DDUserManager.UserDataSetTableAdapters.TBDD_USER_MODULESTableAdapter() Me.TBDD_CLIENTTableAdapter = New DDUserManager.UserDataSetTableAdapters.TBDD_CLIENTTableAdapter() - Me.SplitContainer2 = New System.Windows.Forms.SplitContainer() - Me.SplitContainer3 = New System.Windows.Forms.SplitContainer() GUIDLabel = New System.Windows.Forms.Label() PRENAMELabel = New System.Windows.Forms.Label() NAMELabel = New System.Windows.Forms.Label() @@ -232,14 +254,37 @@ Partial Class frmMain CType(Me.XtraTabControl2, System.ComponentModel.ISupportInitialize).BeginInit() Me.XtraTabControl2.SuspendLayout() Me.tabGroupAssign.SuspendLayout() - CType(Me.gridAllGroups, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.gvAllGroups, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.gridUsersAssigned, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.gvUsersAssigned, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GridView3, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.gridAllUsers, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.gvAllUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerUserGroups1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerUserGroups1.Panel1.SuspendLayout() + Me.SplitContainerUserGroups1.Panel2.SuspendLayout() + Me.SplitContainerUserGroups1.SuspendLayout() + CType(Me.SplitContainerUserGroups2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerUserGroups2.Panel1.SuspendLayout() + Me.SplitContainerUserGroups2.Panel2.SuspendLayout() + Me.SplitContainerUserGroups2.SuspendLayout() + CType(Me.gridGroups_AllGroups, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvGroups_AllGroups, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridGroups_AvailableUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvGroups_AvailableUsers, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridGroups_AssignedUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvGroups_AssignedUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView3, System.ComponentModel.ISupportInitialize).BeginInit() + Me.tabClientAssign.SuspendLayout() + CType(Me.SplitContainer4, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainer4.Panel1.SuspendLayout() + Me.SplitContainer4.Panel2.SuspendLayout() + Me.SplitContainer4.SuspendLayout() + CType(Me.gridClients_AllClients, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvClients_AllClients, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainer5, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainer5.Panel1.SuspendLayout() + Me.SplitContainer5.Panel2.SuspendLayout() + Me.SplitContainer5.SuspendLayout() + CType(Me.gridClients_AvailableUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvClients_AvailableUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridClients_AssignedUsers, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gvClients_AssignedUsers, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBDD_USERBindingNavigator, System.ComponentModel.ISupportInitialize).BeginInit() Me.TBDD_USERBindingNavigator.SuspendLayout() Me.tabPageGroups.SuspendLayout() @@ -255,14 +300,6 @@ Partial Class frmMain CType(Me.TBDD_GROUPS_USERBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBDD_CLIENT_USERBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TBDD_USER_MODULESBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainer2.Panel1.SuspendLayout() - Me.SplitContainer2.Panel2.SuspendLayout() - Me.SplitContainer2.SuspendLayout() - CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SplitContainer3.Panel1.SuspendLayout() - Me.SplitContainer3.Panel2.SuspendLayout() - Me.SplitContainer3.SuspendLayout() Me.SuspendLayout() ' 'GUIDLabel @@ -719,6 +756,7 @@ Partial Class frmMain Me.gvUsers.Name = "gvUsers" Me.gvUsers.OptionsBehavior.Editable = False Me.gvUsers.OptionsBehavior.ReadOnly = True + Me.gvUsers.OptionsDetail.EnableMasterViewMode = False ' 'colGUID ' @@ -843,6 +881,7 @@ Partial Class frmMain Me.listClients.FormattingEnabled = True Me.listClients.Location = New System.Drawing.Point(466, 190) Me.listClients.Name = "listClients" + Me.listClients.SelectionMode = System.Windows.Forms.SelectionMode.None Me.listClients.Size = New System.Drawing.Size(272, 121) Me.listClients.TabIndex = 60 ' @@ -858,6 +897,7 @@ Partial Class frmMain Me.listGroups.FormattingEnabled = True Me.listGroups.Location = New System.Drawing.Point(466, 33) Me.listGroups.Name = "listGroups" + Me.listGroups.SelectionMode = System.Windows.Forms.SelectionMode.None Me.listGroups.Size = New System.Drawing.Size(272, 121) Me.listGroups.TabIndex = 59 ' @@ -878,58 +918,82 @@ Partial Class frmMain ' 'tabGroupAssign ' - Me.tabGroupAssign.Controls.Add(Me.SplitContainer2) + Me.tabGroupAssign.Controls.Add(Me.SplitContainerUserGroups1) Me.tabGroupAssign.Image = Global.DDUserManager.My.Resources.Resources.group Me.tabGroupAssign.Name = "tabGroupAssign" Me.tabGroupAssign.Size = New System.Drawing.Size(1187, 345) Me.tabGroupAssign.Text = "Gruppen Zuordnung" ' - 'Label5 + 'SplitContainerUserGroups1 ' - Me.Label5.AutoSize = True - Me.Label5.Dock = System.Windows.Forms.DockStyle.Bottom - Me.Label5.Location = New System.Drawing.Point(0, 6) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(119, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Zugeordnete Benutzer:" + Me.SplitContainerUserGroups1.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerUserGroups1.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerUserGroups1.Name = "SplitContainerUserGroups1" ' - 'Label4 + 'SplitContainerUserGroups1.Panel1 ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(3, 5) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(111, 13) - Me.Label4.TabIndex = 7 - Me.Label4.Text = "Verfügbare Benutzer:" + Me.SplitContainerUserGroups1.Panel1.Controls.Add(Me.SplitContainerUserGroups2) ' - 'Label3 + 'SplitContainerUserGroups1.Panel2 ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(3, 5) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(109, 13) - Me.Label3.TabIndex = 7 - Me.Label3.Text = "Verfügbare Gruppen:" + Me.SplitContainerUserGroups1.Panel2.Controls.Add(Me.Label5) + Me.SplitContainerUserGroups1.Panel2.Controls.Add(Me.gridGroups_AssignedUsers) + Me.SplitContainerUserGroups1.Size = New System.Drawing.Size(1187, 345) + Me.SplitContainerUserGroups1.SplitterDistance = 740 + Me.SplitContainerUserGroups1.TabIndex = 8 + ' + 'SplitContainerUserGroups2 + ' + Me.SplitContainerUserGroups2.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerUserGroups2.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerUserGroups2.Name = "SplitContainerUserGroups2" ' - 'gridAllGroups + 'SplitContainerUserGroups2.Panel1 ' - Me.gridAllGroups.DataSource = Me.TBDD_USER_GROUPSBindingSource - Me.gridAllGroups.Location = New System.Drawing.Point(0, 19) - Me.gridAllGroups.MainView = Me.gvAllGroups - Me.gridAllGroups.Name = "gridAllGroups" - Me.gridAllGroups.Size = New System.Drawing.Size(372, 326) - Me.gridAllGroups.TabIndex = 6 - Me.gridAllGroups.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvAllGroups}) + Me.SplitContainerUserGroups2.Panel1.Controls.Add(Me.Label3) + Me.SplitContainerUserGroups2.Panel1.Controls.Add(Me.gridGroups_AllGroups) ' - 'gvAllGroups + 'SplitContainerUserGroups2.Panel2 + ' + Me.SplitContainerUserGroups2.Panel2.Controls.Add(Me.Label4) + Me.SplitContainerUserGroups2.Panel2.Controls.Add(Me.gridGroups_AvailableUsers) + Me.SplitContainerUserGroups2.Panel2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.SplitContainerUserGroups2.Size = New System.Drawing.Size(740, 345) + Me.SplitContainerUserGroups2.SplitterDistance = 372 + Me.SplitContainerUserGroups2.TabIndex = 0 + ' + 'Label3 ' - Me.gvAllGroups.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colNAME2, Me.colCOMMENT2}) - Me.gvAllGroups.GridControl = Me.gridAllGroups - Me.gvAllGroups.Name = "gvAllGroups" - Me.gvAllGroups.OptionsBehavior.Editable = False - Me.gvAllGroups.OptionsBehavior.ReadOnly = True - Me.gvAllGroups.OptionsDetail.EnableMasterViewMode = False + Me.Label3.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label3.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label3.Location = New System.Drawing.Point(0, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(372, 29) + Me.Label3.TabIndex = 7 + Me.Label3.Text = "Verfügbare Gruppen:" + Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'gridGroups_AllGroups + ' + Me.gridGroups_AllGroups.DataSource = Me.TBDD_USER_GROUPSBindingSource + Me.gridGroups_AllGroups.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridGroups_AllGroups.Location = New System.Drawing.Point(0, 29) + Me.gridGroups_AllGroups.MainView = Me.gvGroups_AllGroups + Me.gridGroups_AllGroups.Name = "gridGroups_AllGroups" + Me.gridGroups_AllGroups.Size = New System.Drawing.Size(372, 316) + Me.gridGroups_AllGroups.TabIndex = 6 + Me.gridGroups_AllGroups.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvGroups_AllGroups}) + ' + 'gvGroups_AllGroups + ' + Me.gvGroups_AllGroups.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colNAME2, Me.colCOMMENT2}) + Me.gvGroups_AllGroups.GridControl = Me.gridGroups_AllGroups + Me.gvGroups_AllGroups.Name = "gvGroups_AllGroups" + Me.gvGroups_AllGroups.OptionsBehavior.Editable = False + Me.gvGroups_AllGroups.OptionsBehavior.ReadOnly = True + Me.gvGroups_AllGroups.OptionsDetail.EnableMasterViewMode = False + Me.gvGroups_AllGroups.OptionsView.ShowAutoFilterRow = True + Me.gvGroups_AllGroups.OptionsView.ShowGroupPanel = False ' 'colNAME2 ' @@ -947,126 +1011,367 @@ Partial Class frmMain Me.colCOMMENT2.Visible = True Me.colCOMMENT2.VisibleIndex = 1 ' - 'gridUsersAssigned - ' - Me.gridUsersAssigned.AllowDrop = True - Me.gridUsersAssigned.DataSource = Me.TBDD_USERBindingSource - Me.gridUsersAssigned.Dock = System.Windows.Forms.DockStyle.Bottom - Me.gridUsersAssigned.Location = New System.Drawing.Point(0, 19) - Me.gridUsersAssigned.MainView = Me.gvUsersAssigned - Me.gridUsersAssigned.Name = "gridUsersAssigned" - Me.gridUsersAssigned.Size = New System.Drawing.Size(443, 326) - Me.gridUsersAssigned.TabIndex = 5 - Me.gridUsersAssigned.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvUsersAssigned, Me.GridView3}) - ' - 'gvUsersAssigned - ' - Me.gvUsersAssigned.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn1, Me.GridColumn2, Me.GridColumn3, Me.GridColumn4, Me.GridColumn5}) - Me.gvUsersAssigned.GridControl = Me.gridUsersAssigned - Me.gvUsersAssigned.Name = "gvUsersAssigned" - Me.gvUsersAssigned.OptionsBehavior.Editable = False - Me.gvUsersAssigned.OptionsBehavior.ReadOnly = True - Me.gvUsersAssigned.OptionsDetail.EnableMasterViewMode = False - Me.gvUsersAssigned.OptionsSelection.MultiSelect = True - Me.gvUsersAssigned.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect - Me.gvUsersAssigned.OptionsView.ShowAutoFilterRow = True - ' - 'GridColumn1 - ' - Me.GridColumn1.FieldName = "GUID" - Me.GridColumn1.Name = "GridColumn1" - Me.GridColumn1.Visible = True - Me.GridColumn1.VisibleIndex = 1 + 'Label4 + ' + Me.Label4.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label4.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label4.Location = New System.Drawing.Point(0, 0) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(364, 29) + Me.Label4.TabIndex = 7 + Me.Label4.Text = "Verfügbare Benutzer (nach Rechts ziehen, um zuzuordnen):" + Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'gridGroups_AvailableUsers + ' + Me.gridGroups_AvailableUsers.AllowDrop = True + Me.gridGroups_AvailableUsers.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridGroups_AvailableUsers.Location = New System.Drawing.Point(0, 29) + Me.gridGroups_AvailableUsers.MainView = Me.gvGroups_AvailableUsers + Me.gridGroups_AvailableUsers.Name = "gridGroups_AvailableUsers" + Me.gridGroups_AvailableUsers.Size = New System.Drawing.Size(364, 316) + Me.gridGroups_AvailableUsers.TabIndex = 5 + Me.gridGroups_AvailableUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvGroups_AvailableUsers, Me.GridView1}) + ' + 'gvGroups_AvailableUsers + ' + Me.gvGroups_AvailableUsers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colUSERNAME1, Me.colPRENAME1, Me.colNAME1, Me.colEmail3}) + Me.gvGroups_AvailableUsers.GridControl = Me.gridGroups_AvailableUsers + Me.gvGroups_AvailableUsers.Name = "gvGroups_AvailableUsers" + Me.gvGroups_AvailableUsers.OptionsBehavior.Editable = False + Me.gvGroups_AvailableUsers.OptionsBehavior.ReadOnly = True + Me.gvGroups_AvailableUsers.OptionsDetail.EnableMasterViewMode = False + Me.gvGroups_AvailableUsers.OptionsSelection.MultiSelect = True + Me.gvGroups_AvailableUsers.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect + Me.gvGroups_AvailableUsers.OptionsView.ShowAutoFilterRow = True + Me.gvGroups_AvailableUsers.OptionsView.ShowGroupPanel = False + ' + 'colUSERNAME1 + ' + Me.colUSERNAME1.FieldName = "USERNAME" + Me.colUSERNAME1.Name = "colUSERNAME1" + Me.colUSERNAME1.Visible = True + Me.colUSERNAME1.VisibleIndex = 4 + ' + 'colPRENAME1 + ' + Me.colPRENAME1.FieldName = "PRENAME" + Me.colPRENAME1.Name = "colPRENAME1" + Me.colPRENAME1.Visible = True + Me.colPRENAME1.VisibleIndex = 1 + ' + 'colNAME1 + ' + Me.colNAME1.FieldName = "NAME" + Me.colNAME1.Name = "colNAME1" + Me.colNAME1.Visible = True + Me.colNAME1.VisibleIndex = 2 + ' + 'colEmail3 + ' + Me.colEmail3.Caption = "colEmail3" + Me.colEmail3.FieldName = "EMAIL" + Me.colEmail3.Name = "colEmail3" + Me.colEmail3.Visible = True + Me.colEmail3.VisibleIndex = 3 + ' + 'GridView1 + ' + Me.GridView1.GridControl = Me.gridGroups_AvailableUsers + Me.GridView1.Name = "GridView1" + ' + 'Label5 + ' + Me.Label5.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label5.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label5.Location = New System.Drawing.Point(0, 0) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(443, 29) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Zugeordnete Benutzer (nach Links ziehen, um Zuordnung zu entfernen):" + Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'gridGroups_AssignedUsers + ' + Me.gridGroups_AssignedUsers.AllowDrop = True + Me.gridGroups_AssignedUsers.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridGroups_AssignedUsers.Location = New System.Drawing.Point(0, 29) + Me.gridGroups_AssignedUsers.MainView = Me.gvGroups_AssignedUsers + Me.gridGroups_AssignedUsers.Name = "gridGroups_AssignedUsers" + Me.gridGroups_AssignedUsers.Size = New System.Drawing.Size(443, 316) + Me.gridGroups_AssignedUsers.TabIndex = 5 + Me.gridGroups_AssignedUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvGroups_AssignedUsers, Me.GridView3}) + ' + 'gvGroups_AssignedUsers + ' + Me.gvGroups_AssignedUsers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn2, Me.GridColumn3, Me.GridColumn4, Me.GridColumn5}) + Me.gvGroups_AssignedUsers.GridControl = Me.gridGroups_AssignedUsers + Me.gvGroups_AssignedUsers.Name = "gvGroups_AssignedUsers" + Me.gvGroups_AssignedUsers.OptionsBehavior.Editable = False + Me.gvGroups_AssignedUsers.OptionsBehavior.ReadOnly = True + Me.gvGroups_AssignedUsers.OptionsDetail.EnableMasterViewMode = False + Me.gvGroups_AssignedUsers.OptionsSelection.MultiSelect = True + Me.gvGroups_AssignedUsers.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect + Me.gvGroups_AssignedUsers.OptionsView.ShowAutoFilterRow = True + Me.gvGroups_AssignedUsers.OptionsView.ShowGroupPanel = False ' 'GridColumn2 ' Me.GridColumn2.FieldName = "PRENAME" Me.GridColumn2.Name = "GridColumn2" Me.GridColumn2.Visible = True - Me.GridColumn2.VisibleIndex = 2 + Me.GridColumn2.VisibleIndex = 1 ' 'GridColumn3 ' Me.GridColumn3.FieldName = "NAME" Me.GridColumn3.Name = "GridColumn3" Me.GridColumn3.Visible = True - Me.GridColumn3.VisibleIndex = 3 + Me.GridColumn3.VisibleIndex = 2 ' 'GridColumn4 ' Me.GridColumn4.FieldName = "USERNAME" Me.GridColumn4.Name = "GridColumn4" Me.GridColumn4.Visible = True - Me.GridColumn4.VisibleIndex = 4 + Me.GridColumn4.VisibleIndex = 3 ' 'GridColumn5 ' Me.GridColumn5.FieldName = "EMAIL" Me.GridColumn5.Name = "GridColumn5" Me.GridColumn5.Visible = True - Me.GridColumn5.VisibleIndex = 5 + Me.GridColumn5.VisibleIndex = 4 ' 'GridView3 ' - Me.GridView3.GridControl = Me.gridUsersAssigned + Me.GridView3.GridControl = Me.gridGroups_AssignedUsers Me.GridView3.Name = "GridView3" ' - 'gridAllUsers - ' - Me.gridAllUsers.AllowDrop = True - Me.gridAllUsers.DataSource = Me.TBDD_USERBindingSource - Me.gridAllUsers.Dock = System.Windows.Forms.DockStyle.Bottom - Me.gridAllUsers.Location = New System.Drawing.Point(0, 19) - Me.gridAllUsers.MainView = Me.gvAllUsers - Me.gridAllUsers.Name = "gridAllUsers" - Me.gridAllUsers.Size = New System.Drawing.Size(364, 326) - Me.gridAllUsers.TabIndex = 5 - Me.gridAllUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvAllUsers, Me.GridView1}) - ' - 'gvAllUsers - ' - Me.gvAllUsers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colUSERNAME1, Me.colPRENAME1, Me.colNAME1}) - Me.gvAllUsers.GridControl = Me.gridAllUsers - Me.gvAllUsers.Name = "gvAllUsers" - Me.gvAllUsers.OptionsBehavior.Editable = False - Me.gvAllUsers.OptionsBehavior.ReadOnly = True - Me.gvAllUsers.OptionsDetail.EnableMasterViewMode = False - Me.gvAllUsers.OptionsSelection.MultiSelect = True - Me.gvAllUsers.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect - Me.gvAllUsers.OptionsView.ShowAutoFilterRow = True + 'tabClientAssign ' - 'colUSERNAME1 + Me.tabClientAssign.Controls.Add(Me.SplitContainer4) + Me.tabClientAssign.Image = Global.DDUserManager.My.Resources.Resources.book + Me.tabClientAssign.Name = "tabClientAssign" + Me.tabClientAssign.Size = New System.Drawing.Size(1187, 345) + Me.tabClientAssign.Text = "Mandanten Zuordnung" ' - Me.colUSERNAME1.FieldName = "USERNAME" - Me.colUSERNAME1.Name = "colUSERNAME1" - Me.colUSERNAME1.Visible = True - Me.colUSERNAME1.VisibleIndex = 3 + 'SplitContainer4 ' - 'colPRENAME1 + Me.SplitContainer4.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainer4.Location = New System.Drawing.Point(0, 0) + Me.SplitContainer4.Name = "SplitContainer4" ' - Me.colPRENAME1.FieldName = "PRENAME" - Me.colPRENAME1.Name = "colPRENAME1" - Me.colPRENAME1.Visible = True - Me.colPRENAME1.VisibleIndex = 1 + 'SplitContainer4.Panel1 ' - 'colNAME1 + Me.SplitContainer4.Panel1.Controls.Add(Me.Label6) + Me.SplitContainer4.Panel1.Controls.Add(Me.gridClients_AllClients) ' - Me.colNAME1.FieldName = "NAME" - Me.colNAME1.Name = "colNAME1" - Me.colNAME1.Visible = True - Me.colNAME1.VisibleIndex = 2 + 'SplitContainer4.Panel2 ' - 'GridView1 + Me.SplitContainer4.Panel2.Controls.Add(Me.SplitContainer5) + Me.SplitContainer4.Size = New System.Drawing.Size(1187, 345) + Me.SplitContainer4.SplitterDistance = 395 + Me.SplitContainer4.TabIndex = 0 ' - Me.GridView1.GridControl = Me.gridAllUsers - Me.GridView1.Name = "GridView1" + 'Label6 ' - 'tabClientAssign + Me.Label6.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label6.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label6.Location = New System.Drawing.Point(0, 0) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(395, 31) + Me.Label6.TabIndex = 1 + Me.Label6.Text = "Verfügbare Mandanten:" + Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' - Me.tabClientAssign.Image = Global.DDUserManager.My.Resources.Resources.book - Me.tabClientAssign.Name = "tabClientAssign" - Me.tabClientAssign.Size = New System.Drawing.Size(1187, 345) - Me.tabClientAssign.Text = "Mandanten Zuordnung" + 'gridClients_AllClients + ' + Me.gridClients_AllClients.DataSource = Me.TBDD_CLIENTBindingSource + Me.gridClients_AllClients.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridClients_AllClients.Location = New System.Drawing.Point(0, 31) + Me.gridClients_AllClients.MainView = Me.gvClients_AllClients + Me.gridClients_AllClients.Name = "gridClients_AllClients" + Me.gridClients_AllClients.Size = New System.Drawing.Size(395, 314) + Me.gridClients_AllClients.TabIndex = 0 + Me.gridClients_AllClients.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvClients_AllClients}) + ' + 'gvClients_AllClients + ' + Me.gvClients_AllClients.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colCLIENT_NAME, Me.colSHORTNAME, Me.colCOMMENT}) + Me.gvClients_AllClients.GridControl = Me.gridClients_AllClients + Me.gvClients_AllClients.Name = "gvClients_AllClients" + Me.gvClients_AllClients.OptionsBehavior.Editable = False + Me.gvClients_AllClients.OptionsBehavior.ReadOnly = True + Me.gvClients_AllClients.OptionsDetail.EnableMasterViewMode = False + Me.gvClients_AllClients.OptionsView.ShowAutoFilterRow = True + Me.gvClients_AllClients.OptionsView.ShowGroupPanel = False + ' + 'colCLIENT_NAME + ' + Me.colCLIENT_NAME.FieldName = "CLIENT_NAME" + Me.colCLIENT_NAME.Name = "colCLIENT_NAME" + Me.colCLIENT_NAME.Visible = True + Me.colCLIENT_NAME.VisibleIndex = 0 + ' + 'colSHORTNAME + ' + Me.colSHORTNAME.FieldName = "SHORTNAME" + Me.colSHORTNAME.Name = "colSHORTNAME" + Me.colSHORTNAME.Visible = True + Me.colSHORTNAME.VisibleIndex = 1 + ' + 'colCOMMENT + ' + Me.colCOMMENT.FieldName = "COMMENT" + Me.colCOMMENT.Name = "colCOMMENT" + Me.colCOMMENT.Visible = True + Me.colCOMMENT.VisibleIndex = 2 + ' + 'SplitContainer5 + ' + Me.SplitContainer5.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainer5.Location = New System.Drawing.Point(0, 0) + Me.SplitContainer5.Name = "SplitContainer5" + ' + 'SplitContainer5.Panel1 + ' + Me.SplitContainer5.Panel1.Controls.Add(Me.Label7) + Me.SplitContainer5.Panel1.Controls.Add(Me.gridClients_AvailableUsers) + ' + 'SplitContainer5.Panel2 + ' + Me.SplitContainer5.Panel2.Controls.Add(Me.Label8) + Me.SplitContainer5.Panel2.Controls.Add(Me.gridClients_AssignedUsers) + Me.SplitContainer5.Size = New System.Drawing.Size(788, 345) + Me.SplitContainer5.SplitterDistance = 372 + Me.SplitContainer5.TabIndex = 0 + ' + 'Label7 + ' + Me.Label7.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label7.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label7.Location = New System.Drawing.Point(0, 0) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(372, 31) + Me.Label7.TabIndex = 2 + Me.Label7.Text = "Verfügbare Benutzer (nach Rechts ziehen, um zuzuordnen):" + Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'gridClients_AvailableUsers + ' + Me.gridClients_AvailableUsers.AllowDrop = True + Me.gridClients_AvailableUsers.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridClients_AvailableUsers.Location = New System.Drawing.Point(0, 31) + Me.gridClients_AvailableUsers.MainView = Me.gvClients_AvailableUsers + Me.gridClients_AvailableUsers.Name = "gridClients_AvailableUsers" + Me.gridClients_AvailableUsers.Size = New System.Drawing.Size(372, 314) + Me.gridClients_AvailableUsers.TabIndex = 0 + Me.gridClients_AvailableUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvClients_AvailableUsers}) + ' + 'gvClients_AvailableUsers + ' + Me.gvClients_AvailableUsers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPRENAME2, Me.colNAME3, Me.colUSERNAME2, Me.colEMAIL1}) + Me.gvClients_AvailableUsers.GridControl = Me.gridClients_AvailableUsers + Me.gvClients_AvailableUsers.Name = "gvClients_AvailableUsers" + Me.gvClients_AvailableUsers.OptionsBehavior.Editable = False + Me.gvClients_AvailableUsers.OptionsBehavior.ReadOnly = True + Me.gvClients_AvailableUsers.OptionsDetail.EnableMasterViewMode = False + Me.gvClients_AvailableUsers.OptionsSelection.MultiSelect = True + Me.gvClients_AvailableUsers.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect + Me.gvClients_AvailableUsers.OptionsView.ShowAutoFilterRow = True + Me.gvClients_AvailableUsers.OptionsView.ShowGroupPanel = False + ' + 'colPRENAME2 + ' + Me.colPRENAME2.FieldName = "PRENAME" + Me.colPRENAME2.Name = "colPRENAME2" + Me.colPRENAME2.Visible = True + Me.colPRENAME2.VisibleIndex = 1 + ' + 'colNAME3 + ' + Me.colNAME3.FieldName = "NAME" + Me.colNAME3.Name = "colNAME3" + Me.colNAME3.Visible = True + Me.colNAME3.VisibleIndex = 2 + ' + 'colUSERNAME2 + ' + Me.colUSERNAME2.FieldName = "USERNAME" + Me.colUSERNAME2.Name = "colUSERNAME2" + Me.colUSERNAME2.Visible = True + Me.colUSERNAME2.VisibleIndex = 3 + ' + 'colEMAIL1 + ' + Me.colEMAIL1.FieldName = "EMAIL" + Me.colEMAIL1.Name = "colEMAIL1" + Me.colEMAIL1.Visible = True + Me.colEMAIL1.VisibleIndex = 4 + ' + 'Label8 + ' + Me.Label8.Dock = System.Windows.Forms.DockStyle.Fill + Me.Label8.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label8.Location = New System.Drawing.Point(0, 0) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(412, 31) + Me.Label8.TabIndex = 2 + Me.Label8.Text = "Zugeordnete Benutzer (nach Links ziehen, um Zuordnung zu entfernen):" + Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'gridClients_AssignedUsers + ' + Me.gridClients_AssignedUsers.AllowDrop = True + Me.gridClients_AssignedUsers.Dock = System.Windows.Forms.DockStyle.Bottom + Me.gridClients_AssignedUsers.Location = New System.Drawing.Point(0, 31) + Me.gridClients_AssignedUsers.MainView = Me.gvClients_AssignedUsers + Me.gridClients_AssignedUsers.Name = "gridClients_AssignedUsers" + Me.gridClients_AssignedUsers.Size = New System.Drawing.Size(412, 314) + Me.gridClients_AssignedUsers.TabIndex = 0 + Me.gridClients_AssignedUsers.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gvClients_AssignedUsers}) + ' + 'gvClients_AssignedUsers + ' + Me.gvClients_AssignedUsers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPRENAME3, Me.colNAME4, Me.colUSERNAME3, Me.colEMAIL2}) + Me.gvClients_AssignedUsers.GridControl = Me.gridClients_AssignedUsers + Me.gvClients_AssignedUsers.Name = "gvClients_AssignedUsers" + Me.gvClients_AssignedUsers.OptionsBehavior.Editable = False + Me.gvClients_AssignedUsers.OptionsBehavior.ReadOnly = True + Me.gvClients_AssignedUsers.OptionsDetail.EnableMasterViewMode = False + Me.gvClients_AssignedUsers.OptionsSelection.MultiSelect = True + Me.gvClients_AssignedUsers.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect + Me.gvClients_AssignedUsers.OptionsView.ShowAutoFilterRow = True + Me.gvClients_AssignedUsers.OptionsView.ShowGroupPanel = False + ' + 'colPRENAME3 + ' + Me.colPRENAME3.FieldName = "PRENAME" + Me.colPRENAME3.Name = "colPRENAME3" + Me.colPRENAME3.Visible = True + Me.colPRENAME3.VisibleIndex = 1 + ' + 'colNAME4 + ' + Me.colNAME4.FieldName = "NAME" + Me.colNAME4.Name = "colNAME4" + Me.colNAME4.Visible = True + Me.colNAME4.VisibleIndex = 2 + ' + 'colUSERNAME3 + ' + Me.colUSERNAME3.FieldName = "USERNAME" + Me.colUSERNAME3.Name = "colUSERNAME3" + Me.colUSERNAME3.Visible = True + Me.colUSERNAME3.VisibleIndex = 3 + ' + 'colEMAIL2 + ' + Me.colEMAIL2.FieldName = "EMAIL" + Me.colEMAIL2.Name = "colEMAIL2" + Me.colEMAIL2.Visible = True + Me.colEMAIL2.VisibleIndex = 4 ' 'TBDD_USERBindingNavigator ' @@ -1654,43 +1959,6 @@ Partial Class frmMain ' Me.TBDD_CLIENTTableAdapter.ClearBeforeFill = True ' - 'SplitContainer2 - ' - Me.SplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainer2.Location = New System.Drawing.Point(0, 0) - Me.SplitContainer2.Name = "SplitContainer2" - ' - 'SplitContainer2.Panel1 - ' - Me.SplitContainer2.Panel1.Controls.Add(Me.SplitContainer3) - ' - 'SplitContainer2.Panel2 - ' - Me.SplitContainer2.Panel2.Controls.Add(Me.Label5) - Me.SplitContainer2.Panel2.Controls.Add(Me.gridUsersAssigned) - Me.SplitContainer2.Size = New System.Drawing.Size(1187, 345) - Me.SplitContainer2.SplitterDistance = 740 - Me.SplitContainer2.TabIndex = 8 - ' - 'SplitContainer3 - ' - Me.SplitContainer3.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainer3.Location = New System.Drawing.Point(0, 0) - Me.SplitContainer3.Name = "SplitContainer3" - ' - 'SplitContainer3.Panel1 - ' - Me.SplitContainer3.Panel1.Controls.Add(Me.Label3) - Me.SplitContainer3.Panel1.Controls.Add(Me.gridAllGroups) - ' - 'SplitContainer3.Panel2 - ' - Me.SplitContainer3.Panel2.Controls.Add(Me.Label4) - Me.SplitContainer3.Panel2.Controls.Add(Me.gridAllUsers) - Me.SplitContainer3.Size = New System.Drawing.Size(740, 345) - Me.SplitContainer3.SplitterDistance = 372 - Me.SplitContainer3.TabIndex = 0 - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -1721,14 +1989,37 @@ Partial Class frmMain CType(Me.XtraTabControl2, System.ComponentModel.ISupportInitialize).EndInit() Me.XtraTabControl2.ResumeLayout(False) Me.tabGroupAssign.ResumeLayout(False) - CType(Me.gridAllGroups, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.gvAllGroups, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.gridUsersAssigned, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.gvUsersAssigned, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GridView3, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.gridAllUsers, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.gvAllUsers, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerUserGroups1.Panel1.ResumeLayout(False) + Me.SplitContainerUserGroups1.Panel2.ResumeLayout(False) + CType(Me.SplitContainerUserGroups1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerUserGroups1.ResumeLayout(False) + Me.SplitContainerUserGroups2.Panel1.ResumeLayout(False) + Me.SplitContainerUserGroups2.Panel2.ResumeLayout(False) + CType(Me.SplitContainerUserGroups2, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerUserGroups2.ResumeLayout(False) + CType(Me.gridGroups_AllGroups, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvGroups_AllGroups, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridGroups_AvailableUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvGroups_AvailableUsers, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridGroups_AssignedUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvGroups_AssignedUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView3, System.ComponentModel.ISupportInitialize).EndInit() + Me.tabClientAssign.ResumeLayout(False) + Me.SplitContainer4.Panel1.ResumeLayout(False) + Me.SplitContainer4.Panel2.ResumeLayout(False) + CType(Me.SplitContainer4, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer4.ResumeLayout(False) + CType(Me.gridClients_AllClients, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvClients_AllClients, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer5.Panel1.ResumeLayout(False) + Me.SplitContainer5.Panel2.ResumeLayout(False) + CType(Me.SplitContainer5, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer5.ResumeLayout(False) + CType(Me.gridClients_AvailableUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvClients_AvailableUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridClients_AssignedUsers, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gvClients_AssignedUsers, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TBDD_USERBindingNavigator, System.ComponentModel.ISupportInitialize).EndInit() Me.TBDD_USERBindingNavigator.ResumeLayout(False) Me.TBDD_USERBindingNavigator.PerformLayout() @@ -1753,17 +2044,6 @@ Partial Class frmMain CType(Me.TBDD_GROUPS_USERBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TBDD_CLIENT_USERBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TBDD_USER_MODULESBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainer2.Panel1.ResumeLayout(False) - Me.SplitContainer2.Panel2.ResumeLayout(False) - Me.SplitContainer2.Panel2.PerformLayout() - CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainer2.ResumeLayout(False) - Me.SplitContainer3.Panel1.ResumeLayout(False) - Me.SplitContainer3.Panel1.PerformLayout() - Me.SplitContainer3.Panel2.ResumeLayout(False) - Me.SplitContainer3.Panel2.PerformLayout() - CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).EndInit() - Me.SplitContainer3.ResumeLayout(False) Me.ResumeLayout(False) End Sub @@ -1875,27 +2155,49 @@ Partial Class frmMain Friend WithEvents XtraTabControl2 As DevExpress.XtraTab.XtraTabControl Friend WithEvents tabClientAssign As DevExpress.XtraTab.XtraTabPage Friend WithEvents tabGroupAssign As DevExpress.XtraTab.XtraTabPage - Friend WithEvents gridAllUsers As DevExpress.XtraGrid.GridControl - Friend WithEvents gvAllUsers As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents gridGroups_AvailableUsers As DevExpress.XtraGrid.GridControl + Friend WithEvents gvGroups_AvailableUsers As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents colPRENAME1 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colNAME1 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colUSERNAME1 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView - Friend WithEvents gridAllGroups As DevExpress.XtraGrid.GridControl - Friend WithEvents gvAllGroups As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents gridGroups_AllGroups As DevExpress.XtraGrid.GridControl + Friend WithEvents gvGroups_AllGroups As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents colNAME2 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents Label5 As Label Friend WithEvents Label4 As Label Friend WithEvents Label3 As Label - Friend WithEvents gridUsersAssigned As DevExpress.XtraGrid.GridControl - Friend WithEvents gvUsersAssigned As DevExpress.XtraGrid.Views.Grid.GridView - Friend WithEvents GridColumn1 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents gridGroups_AssignedUsers As DevExpress.XtraGrid.GridControl + Friend WithEvents gvGroups_AssignedUsers As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents GridColumn2 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents GridColumn3 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents GridColumn4 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents GridColumn5 As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents GridView3 As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents colCOMMENT2 As DevExpress.XtraGrid.Columns.GridColumn - Friend WithEvents SplitContainer2 As SplitContainer - Friend WithEvents SplitContainer3 As SplitContainer + Friend WithEvents SplitContainerUserGroups1 As SplitContainer + Friend WithEvents SplitContainerUserGroups2 As SplitContainer + Friend WithEvents SplitContainer4 As SplitContainer + Friend WithEvents SplitContainer5 As SplitContainer + Friend WithEvents gridClients_AllClients As DevExpress.XtraGrid.GridControl + Friend WithEvents gvClients_AllClients As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents gridClients_AvailableUsers As DevExpress.XtraGrid.GridControl + Friend WithEvents gvClients_AvailableUsers As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents gridClients_AssignedUsers As DevExpress.XtraGrid.GridControl + Friend WithEvents gvClients_AssignedUsers As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents Label6 As Label + Friend WithEvents Label7 As Label + Friend WithEvents Label8 As Label + Friend WithEvents colCLIENT_NAME As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colSHORTNAME As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colCOMMENT As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colPRENAME2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colNAME3 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colUSERNAME2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colEMAIL1 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colPRENAME3 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colNAME4 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colUSERNAME3 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colEMAIL2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colEmail3 As DevExpress.XtraGrid.Columns.GridColumn End Class diff --git a/DDUserManager/DDUserManager/frmMain.resx b/DDUserManager/DDUserManager/frmMain.resx index 0d52b2c..ecec2bc 100644 --- a/DDUserManager/DDUserManager/frmMain.resx +++ b/DDUserManager/DDUserManager/frmMain.resx @@ -219,8 +219,8 @@ 489, 56 - - 489, 56 + + 268, 95 693, 17 @@ -324,8 +324,8 @@ 17, 17 - - 268, 95 + + 489, 56 672, 95 @@ -492,6 +492,6 @@ 473, 95 - 230 + 201 \ No newline at end of file diff --git a/DDUserManager/DDUserManager/frmMain.vb b/DDUserManager/DDUserManager/frmMain.vb index 6caa6b4..fcc0249 100644 --- a/DDUserManager/DDUserManager/frmMain.vb +++ b/DDUserManager/DDUserManager/frmMain.vb @@ -6,12 +6,9 @@ Imports DevExpress.XtraGrid.Views.Grid.ViewInfo ''' ''' Anmerkungen: ''' - DateTimePicker sollten Binding auf die Text Eigenschaft erhalten, nicht auf die Value Eigenschaft: -''' https://stackoverflow.com/questions/21270697/argumentoutofrangeexception-with-data-binding-when-debugger-is-running-vs2010#28550637 -''' +''' https://stackoverflow.com/questions/21270697/argumentoutofrangeexception-with-data-binding-when-debugger-is-running-vs2010#28550637 ''' Public Class frmMain - Public downHitInfo As GridHitInfo - Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try TBDD_CLIENTTableAdapter.Fill(UserDataSet.TBDD_CLIENT) @@ -23,6 +20,33 @@ Public Class frmMain Catch ex As Exception MessageBox.Show($"Error in frmMain_Load: {ex.Message}") End Try + + gvUsers.BestFitColumns() + + gvClients_AllClients.BestFitColumns() + gvGroups_AllGroups.BestFitColumns() + End Sub + + Private Sub grvwAllGroups_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles gvGroups_AllGroups.FocusedRowChanged + If e.FocusedRowHandle = -1 Then + Exit Sub + End If + + Dim groupId As Integer = GetSelectedGroupId() + + gridGroups_AssignedUsers.DataSource = GetAssignedUsersByGroupId(groupId) + gridGroups_AvailableUsers.DataSource = GetAvailableUsersByGroupId(groupId) + End Sub + + Private Sub gvClients_AllClients_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles gvClients_AllClients.FocusedRowChanged + If e.FocusedRowHandle = -1 Then + Exit Sub + End If + + Dim clientId As Integer = GetSelectedClientId() + + gridClients_AssignedUsers.DataSource = GetAssignedUsersByClientId(clientId) + gridClients_AvailableUsers.DataSource = GetAvailableUsersByClientId(clientId) End Sub #Region "User Details" @@ -61,25 +85,104 @@ Public Class frmMain End If End Sub #End Region +#Region "Database Helpers" + Private Function GetAvailableUsersByGroupId(groupId As Integer) As TBDD_USERDataTable + Dim dt As New TBDD_USERDataTable() + TBDD_USERTableAdapter.FillByGroupId_NotInGroup(dt, groupId) -#Region "Group Stuff" + Return dt + End Function - Private Sub grvwAllGroups_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles gvAllGroups.FocusedRowChanged - If e.FocusedRowHandle = -1 Then - Exit Sub - End If + Private Function GetAssignedUsersByGroupId(groupId As Integer) As TBDD_USERDataTable + Dim dt As New TBDD_USERDataTable() + TBDD_USERTableAdapter.FillByGroupId(dt, groupId) - Dim view As GridView = sender - Dim row As TBDD_USER_GROUPSRow = view.GetDataRow(e.FocusedRowHandle) - Dim groupId As String = row.GUID + Return dt + End Function + Private Function GetAvailableUsersByClientId(clientId As Integer) As TBDD_USERDataTable Dim dt As New TBDD_USERDataTable() - TBDD_USERTableAdapter.FillByGroupId(dt, groupId) + TBDD_USERTableAdapter.FillByClientId_NotInClient(dt, clientId) - gridUsersAssigned.DataSource = dt - End Sub + Return dt + End Function + + Private Function GetAssignedUsersByClientId(clientId As Integer) As TBDD_USERDataTable + Dim dt As New TBDD_USERDataTable() + TBDD_USERTableAdapter.FillByClientId(dt, clientId) + + Return dt + End Function +#End Region +#Region "Grid Helpers" + Private Function GetSelectedGroup() As TBDD_USER_GROUPSRow + Dim groupRowIndex = gvGroups_AllGroups.GetSelectedRows().First() + Dim selectedGroupView As DataRowView = gvGroups_AllGroups.GetRow(groupRowIndex) + Dim selectedGroup As TBDD_USER_GROUPSRow = selectedGroupView.Row + + Return selectedGroup + End Function + + Private Function GetSelectedGroupId() As Integer + Dim selectedGroup As TBDD_USER_GROUPSRow = GetSelectedGroup() + Dim groupId As Integer = selectedGroup.GUID + + Return groupId + End Function + + Private Function GetSelectedClient() As TBDD_CLIENTRow + Dim clientRowIndex = gvClients_AllClients.GetSelectedRows().First() + Dim selectedClientView As DataRowView = gvClients_AllClients.GetRow(clientRowIndex) + Dim selectedClient As TBDD_CLIENTRow = selectedClientView.Row + + Return selectedClient + End Function + + Private Function GetSelectedClientId() As Integer + Dim selectedClient As TBDD_CLIENTRow = GetSelectedClient() + Dim clientId As Integer = selectedClient.GUID - Private Sub gvAllUsers_MouseDown(sender As Object, e As MouseEventArgs) Handles gvAllUsers.MouseDown + Return clientId + End Function + + Private Function GetModifiedRowsFromDragDropData(grid As GridControl, data As IDataObject) + Dim table As DataTable = grid.DataSource + Dim selectedGroup As TBDD_USER_GROUPSRow = GetSelectedGroup() + Dim modifiedRows As New List(Of TBDD_USERRow) + + If data.GetDataPresent(GetType(GridView)) Then + Dim view As GridView = data.GetData(GetType(GridView)) + Dim selectedRows() As Integer = view.GetSelectedRows() + + If selectedRows.Length = 0 Then + Return modifiedRows + End If + + ' Die ausgewählten Rows auslesen und gridUsersAssigned hinzufügen + For Each rowIndex As Integer In view.GetSelectedRows() + Dim rowView As DataRowView = view.GetRow(rowIndex) + Dim row As TBDD_USERRow = rowView.Row + + If Not table.Rows.Contains(row.GUID) Then + modifiedRows.Add(row) + End If + Next + + ElseIf data.GetDataPresent(GetType(TBDD_USERRow)) Then + Dim row As TBDD_USERRow = data.GetData(GetType(TBDD_USERRow)) + + If Not table.Rows.Contains(row.GUID) Then + modifiedRows.Add(row) + End If + End If + + Return modifiedRows + End Function +#End Region +#Region "DragDrop Events for Groups & Clients" + Private downHitInfo As GridHitInfo + + Private Sub gvUsers_MouseDown(sender As Object, e As MouseEventArgs) Handles gvGroups_AvailableUsers.MouseDown, gvGroups_AssignedUsers.MouseDown, gvClients_AssignedUsers.MouseDown, gvClients_AvailableUsers.MouseDown Dim view As GridView = sender downHitInfo = Nothing Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y)) @@ -93,69 +196,138 @@ Public Class frmMain End If End Sub - Private Sub gvAllUsers_MouseMove(sender As Object, e As MouseEventArgs) Handles gvAllUsers.MouseMove + Private Sub gvUsers_MouseMove(sender As Object, e As MouseEventArgs) Handles gvGroups_AvailableUsers.MouseMove, gvGroups_AssignedUsers.MouseMove, gvClients_AssignedUsers.MouseMove, gvClients_AvailableUsers.MouseMove Dim view As GridView = sender + Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y)) If e.Button = MouseButtons.Left And Not IsNothing(downHitInfo) Then Dim dragSize As Size = SystemInformation.DragSize Dim dragRect As New Rectangle(New Point(downHitInfo.HitPoint.X - dragSize.Width / 2, downHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize) - If dragRect.Contains(New Point(e.X, e.Y)) Then - Dim row As TBDD_USERRow = view.GetDataRow(downHitInfo.RowHandle) - view.GridControl.DoDragDrop(row, DragDropEffects.Move) + ' DragRect ist ein kleines Rechteck, dessen Mitte der Punkt ist, wo die Maus geklickt wurde. + ' Es soll verhindern, dass durch schnelles Klicken unbeabsichtigt Drag'n'Drop Operationen initiiert werden + ' Siehe: https://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.dragsize(v=vs.110).aspx + If Not dragRect.Contains(New Point(e.X, e.Y)) Then + ' dragDropData enhält eine einzelne Row oder den kompletten View, + ' jenachdem, wie die Drag'n'Drop Operation gestartet wurde. + Dim dragDropData As Object + + ' Wenn keine Zeile markiert ist + If downHitInfo.RowHandle < 0 Then + Exit Sub + End If + + ' Wenn zwar eine Zeile markiert ist, aber keine über die Checkbox angehakt wurde, + ' wird die markierte Zeile übergeben. + ' Wenn 1 oder n Zeilen über die Checkbox angehakt wurde, werden diese übergeben + If view.GetSelectedRows().Length = 0 Then + Dim row As TBDD_USERRow = view.GetDataRow(downHitInfo.RowHandle) + dragDropData = row + Else + dragDropData = view + End If + + view.GridControl.DoDragDrop(dragDropData, DragDropEffects.Move) downHitInfo = Nothing - Console.WriteLine("DoDragDrop") - DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = True End If End If End Sub - 'Private Sub gridAllUsers_DragOver(sender As Object, e As DragEventArgs) Handles gridAllUsers.DragOver - ' Console.WriteLine("gridAllUsers_DragOver") + Private Sub gridUsers_DragOver(sender As Object, e As DragEventArgs) Handles gridGroups_AssignedUsers.DragOver, gridGroups_AvailableUsers.DragOver, gridClients_AssignedUsers.DragOver, gridClients_AvailableUsers.DragOver + Dim selectedUsersDropped As Boolean = e.Data.GetDataPresent(GetType(GridView)) + Dim singleUserDropped As Boolean = e.Data.GetDataPresent(GetType(TBDD_USERRow)) - ' If e.Data.GetDataPresent(GetType(TBDD_USERRow)) Then - ' e.Effect = DragDropEffects.Move - ' Else - ' e.Effect = DragDropEffects.None - ' End If - 'End Sub + Console.WriteLine($"selectedUsersDropped: {selectedUsersDropped}") + Console.WriteLine($"singleUserDropped: {singleUserDropped}") - 'Private Sub gridAllUsers_DragDrop(sender As Object, e As DragEventArgs) Handles gridAllUsers.DragDrop - ' Console.WriteLine("gridAllUsers_DragDrop") + If selectedUsersDropped Or singleUserDropped Then + e.Effect = DragDropEffects.Move + Else + e.Effect = DragDropEffects.None + End If + End Sub +#End Region +#Region "DragDrop Events for Groups" + Private Sub gridUsersAvailable_DragDrop(sender As Object, e As DragEventArgs) Handles gridGroups_AvailableUsers.DragDrop + Dim grid As GridControl = sender + Dim table As DataTable = grid.DataSource + Dim userRowsToBeDeleted = GetModifiedRowsFromDragDropData(grid, e.Data) + Dim selectedGroup As TBDD_USER_GROUPSRow = GetSelectedGroup() - ' Dim grid As GridControl = sender - ' Dim table As DataTable = grid.DataSource - ' Dim row As TBDD_USERRow = e.Data.GetData(GetType(TBDD_USERRow)) + ' Zeilen in Oberfläche und in Datenbank einfügen + For Each userRow As TBDD_USERRow In userRowsToBeDeleted + TBDD_GROUPS_USERTableAdapter.Delete(userRow.GUID, selectedGroup.GUID) + Next - 'End Sub + listGroups.DataSource = GetGroupsForUser(USERNAMETextBox.Text) - Private Sub gridUsersAssigned_DragDrop(sender As Object, e As DragEventArgs) Handles gridUsersAssigned.DragDrop - Console.WriteLine("gridUsersAssigned_DragOver") + ' Verfügbare Benutzer aktualisieren und Checkboxen leeren + gridGroups_AssignedUsers.DataSource = GetAssignedUsersByGroupId(selectedGroup.GUID) + gridGroups_AvailableUsers.DataSource = GetAvailableUsersByGroupId(selectedGroup.GUID) + gvGroups_AvailableUsers.ClearSelection() + gvGroups_AssignedUsers.ClearSelection() + End Sub + Private Sub gridUsersAssigned_DragDrop(sender As Object, e As DragEventArgs) Handles gridGroups_AssignedUsers.DragDrop Dim grid As GridControl = sender Dim table As DataTable = grid.DataSource - Dim row As TBDD_USERRow = e.Data.GetData(GetType(TBDD_USERRow)) + Dim userRowsToBeInserted = GetModifiedRowsFromDragDropData(grid, e.Data) + Dim selectedGroup As TBDD_USER_GROUPSRow = GetSelectedGroup() - 'If Not IsNothing(row) And Not table.Rows.Contains(row) Then - If Not IsNothing(row) Then - table.ImportRow(row) - End If + ' Zeilen in Oberfläche und in Datenbank einfügen + For Each userRow As TBDD_USERRow In userRowsToBeInserted + TBDD_GROUPS_USERTableAdapter.Insert(userRow.GUID, selectedGroup.GUID, $"Assign User {userRow.USERNAME} to Group {selectedGroup.NAME}", Environment.UserName) + Next + listGroups.DataSource = GetGroupsForUser(USERNAMETextBox.Text) + + ' Verfügbare Benutzer aktualisieren und Checkboxen leeren + gridGroups_AssignedUsers.DataSource = GetAssignedUsersByGroupId(selectedGroup.GUID) + gridGroups_AvailableUsers.DataSource = GetAvailableUsersByGroupId(selectedGroup.GUID) + gvGroups_AvailableUsers.ClearSelection() + gvGroups_AssignedUsers.ClearSelection() End Sub +#End Region +#Region "DragDrop Events for Clients" + Private Sub gridClients_AvailableUsers_DragDrop(sender As Object, e As DragEventArgs) Handles gridClients_AvailableUsers.DragDrop + Dim grid As GridControl = sender + Dim table As DataTable = grid.DataSource + Dim userRowsToBeDeleted = GetModifiedRowsFromDragDropData(grid, e.Data) + Dim selectedClient As TBDD_CLIENTRow = GetSelectedClient() - Private Sub gridUsersAssigned_DragOver(sender As Object, e As DragEventArgs) Handles gridUsersAssigned.DragOver - Console.WriteLine("gridUsersAssigned_DragOver") + For Each userRow As TBDD_USERRow In userRowsToBeDeleted + TBDD_CLIENT_USERTableAdapter.Delete(userRow.GUID, selectedClient.GUID) + Next - If e.Data.GetDataPresent(GetType(TBDD_USERRow)) Then - e.Effect = DragDropEffects.Move - Else - e.Effect = DragDropEffects.None - End If + listClients.DataSource = GetClientsForUser(USERNAMETextBox.Text) + + ' Verfügbare Benutzer aktualisieren und Checkboxen leeren + gridClients_AssignedUsers.DataSource = GetAssignedUsersByClientId(selectedClient.GUID) + gridClients_AvailableUsers.DataSource = GetAvailableUsersByClientId(selectedClient.GUID) + gvClients_AssignedUsers.ClearSelection() + gvClients_AvailableUsers.ClearSelection() End Sub + Private Sub gridClients_AssignedUsers_DragDrop(sender As Object, e As DragEventArgs) Handles gridClients_AssignedUsers.DragDrop + Dim grid As GridControl = sender + Dim table As DataTable = grid.DataSource + Dim userRowsToBeInserted = GetModifiedRowsFromDragDropData(grid, e.Data) + Dim selectedClient As TBDD_CLIENTRow = GetSelectedClient() + + ' Zeilen in Oberfläche und in Datenbank einfügen + For Each userRow As TBDD_USERRow In userRowsToBeInserted + TBDD_CLIENT_USERTableAdapter.Insert(userRow.GUID, selectedClient.GUID, $"Assign User {userRow.USERNAME} to Client {selectedClient.CLIENT_NAME}", Environment.UserName) + Next -#End Region + listClients.DataSource = GetClientsForUser(USERNAMETextBox.Text) -End Class + ' Verfügbare Benutzer aktualisieren und Checkboxen leeren + gridClients_AssignedUsers.DataSource = GetAssignedUsersByClientId(selectedClient.GUID) + gridClients_AvailableUsers.DataSource = GetAvailableUsersByClientId(selectedClient.GUID) + gvClients_AssignedUsers.ClearSelection() + gvClients_AvailableUsers.ClearSelection() + End Sub +#End Region +End Class \ No newline at end of file