jj: Add AD import, Reload users after import

This commit is contained in:
Jonathan Jenne 2018-05-11 15:42:03 +02:00
parent 4a06f7e927
commit c6be81dda4
10 changed files with 2000 additions and 177 deletions

View File

@ -3502,8 +3502,6 @@ Partial Public Class UserDataSet
Private columnEMAIL As Global.System.Data.DataColumn
Private columnSELECTED As Global.System.Data.DataColumn
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Sub New()
@ -3571,14 +3569,6 @@ Partial Public Class UserDataSet
End Get
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public ReadOnly Property SELECTEDColumn() As Global.System.Data.DataColumn
Get
Return Me.columnSELECTED
End Get
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _
Global.System.ComponentModel.Browsable(false)> _
@ -3616,9 +3606,9 @@ Partial Public Class UserDataSet
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Overloads Function AddTBLOCAL_ADUSERSRow(ByVal USERNAME As String, ByVal PRENAME As String, ByVal NAME As String, ByVal EMAIL As String, ByVal SELECTED As Boolean) As TBLOCAL_ADUSERSRow
Public Overloads Function AddTBLOCAL_ADUSERSRow(ByVal USERNAME As String, ByVal PRENAME As String, ByVal NAME As String, ByVal EMAIL As String) As TBLOCAL_ADUSERSRow
Dim rowTBLOCAL_ADUSERSRow As TBLOCAL_ADUSERSRow = CType(Me.NewRow,TBLOCAL_ADUSERSRow)
Dim columnValuesArray() As Object = New Object() {USERNAME, PRENAME, NAME, EMAIL, SELECTED}
Dim columnValuesArray() As Object = New Object() {USERNAME, PRENAME, NAME, EMAIL}
rowTBLOCAL_ADUSERSRow.ItemArray = columnValuesArray
Me.Rows.Add(rowTBLOCAL_ADUSERSRow)
Return rowTBLOCAL_ADUSERSRow
@ -3645,7 +3635,6 @@ Partial Public Class UserDataSet
Me.columnPRENAME = MyBase.Columns("PRENAME")
Me.columnNAME = MyBase.Columns("NAME")
Me.columnEMAIL = MyBase.Columns("EMAIL")
Me.columnSELECTED = MyBase.Columns("SELECTED")
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@ -3659,9 +3648,6 @@ Partial Public Class UserDataSet
MyBase.Columns.Add(Me.columnNAME)
Me.columnEMAIL = New Global.System.Data.DataColumn("EMAIL", GetType(String), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnEMAIL)
Me.columnSELECTED = New Global.System.Data.DataColumn("SELECTED", GetType(Boolean), Nothing, Global.System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnSELECTED)
Me.columnSELECTED.DefaultValue = CType(false,Boolean)
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@ -5615,11 +5601,11 @@ Partial Public Class UserDataSet
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Property PRENAME() As String
Get
Try
If Me.IsPRENAMENull Then
Return Nothing
Else
Return CType(Me(Me.tableTBLOCAL_ADUSERS.PRENAMEColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte PRENAME in Tabelle TBLOCAL_ADUSERS ist DBNull.", e)
End Try
End If
End Get
Set
Me(Me.tableTBLOCAL_ADUSERS.PRENAMEColumn) = value
@ -5630,11 +5616,11 @@ Partial Public Class UserDataSet
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Property NAME() As String
Get
Try
If Me.IsNAMENull Then
Return Nothing
Else
Return CType(Me(Me.tableTBLOCAL_ADUSERS.NAMEColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte NAME in Tabelle TBLOCAL_ADUSERS ist DBNull.", e)
End Try
End If
End Get
Set
Me(Me.tableTBLOCAL_ADUSERS.NAMEColumn) = value
@ -5645,32 +5631,17 @@ Partial Public Class UserDataSet
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Property EMAIL() As String
Get
Try
If Me.IsEMAILNull Then
Return Nothing
Else
Return CType(Me(Me.tableTBLOCAL_ADUSERS.EMAILColumn),String)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte EMAIL in Tabelle TBLOCAL_ADUSERS ist DBNull.", e)
End Try
End If
End Get
Set
Me(Me.tableTBLOCAL_ADUSERS.EMAILColumn) = value
End Set
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Property SELECTED() As Boolean
Get
Try
Return CType(Me(Me.tableTBLOCAL_ADUSERS.SELECTEDColumn),Boolean)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte SELECTED in Tabelle TBLOCAL_ADUSERS ist DBNull.", e)
End Try
End Get
Set
Me(Me.tableTBLOCAL_ADUSERS.SELECTEDColumn) = value
End Set
End Property
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Function IsUSERNAMENull() As Boolean
@ -5718,18 +5689,6 @@ Partial Public Class UserDataSet
Public Sub SetEMAILNull()
Me(Me.tableTBLOCAL_ADUSERS.EMAILColumn) = Global.System.Convert.DBNull
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Function IsSELECTEDNull() As Boolean
Return Me.IsNull(Me.tableTBLOCAL_ADUSERS.SELECTEDColumn)
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Public Sub SetSELECTEDNull()
Me(Me.tableTBLOCAL_ADUSERS.SELECTEDColumn) = Global.System.Convert.DBNull
End Sub
End Class
'''<summary>
@ -9796,7 +9755,7 @@ Namespace UserDataSetTableAdapters
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _
Private Sub InitCommandCollection()
Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(8) {}
Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(10) {}
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"
@ -9878,11 +9837,26 @@ Namespace UserDataSetTableAdapters
Me._commandCollection(7).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USERNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(8) = New Global.System.Data.SqlClient.SqlCommand()
Me._commandCollection(8).Connection = Me.Connection
Me._commandCollection(8).CommandText = "SELECT T.GUID FROM TBDD_USER T"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"INNER JOIN TBDD_USER_MODULES T2 ON T.GUID = T2.US"& _
Me._commandCollection(8).CommandText = "INSERT INTO TBDD_USER"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (PRENAME, NAME, USERNAME, EMAIL, "& _
"ADDED_WHO)"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"VALUES (@PRENAME,@NAME,@USERNAME,@EMAIL,@ADDED_WHO)"
Me._commandCollection(8).CommandType = Global.System.Data.CommandType.Text
Me._commandCollection(8).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@PRENAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "PRENAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(8).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@NAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "NAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(8).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USERNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(8).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@EMAIL", Global.System.Data.SqlDbType.VarChar, 100, Global.System.Data.ParameterDirection.Input, 0, 0, "EMAIL", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(8).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._commandCollection(9) = New Global.System.Data.SqlClient.SqlCommand()
Me._commandCollection(9).Connection = Me.Connection
Me._commandCollection(9).CommandText = "SELECT T.GUID FROM TBDD_USER T"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"INNER JOIN TBDD_USER_MODULES T2 ON T.GUID = T2.US"& _
"ER_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"INNER JOIN TBDD_MODULES T3 ON T3.GUID = T2.MODULE_ID"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"WHERE T.USERNAME = "& _
"@USERNAME AND T2.IS_ADMIN = 1 AND T3.SHORT_NAME = 'UM'"
Me._commandCollection(8).CommandType = Global.System.Data.CommandType.Text
Me._commandCollection(8).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USERNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(9).CommandType = Global.System.Data.CommandType.Text
Me._commandCollection(9).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USERNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
Me._commandCollection(10) = New Global.System.Data.SqlClient.SqlCommand()
Me._commandCollection(10).Connection = Me.Connection
Me._commandCollection(10).CommandText = "SELECT GUID FROM TBDD_USER WHERE USERNAME = @USERNAME"
Me._commandCollection(10).CommandType = Global.System.Data.CommandType.Text
Me._commandCollection(10).Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@USERNAME", Global.System.Data.SqlDbType.VarChar, 50, Global.System.Data.ParameterDirection.Input, 0, 0, "USERNAME", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", ""))
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
@ -10702,11 +10676,89 @@ Namespace UserDataSetTableAdapters
Return Me.Update(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, Original_GUID, Original_PRENAME, Original_NAME, Original_USERNAME, Original_SHORTNAME, Original_EMAIL, Original_LANGUAGE, Original_GENERAL_VIEWER, Original_COMMENT, Original_WAN_ENVIRONMENT, Original_LOGGED_IN, Original_LOGGED_WHERE, Original_LOG_IN_WHEN, Original_LOG_OUT_WHEN, Original_PM_RIGHT_FILE_DELETE, Original_USERID_FK_INT_ECM, Original_DATE_FORMAT, Original_ADDED_WHO, Original_ADDED_WHEN, Original_CHANGED_WHO, Original_CHANGED_WHEN, Original_GUID)
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
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, false)> _
Public Overloads Overridable Function InsertUser(ByVal PRENAME As String, ByVal NAME As String, ByVal USERNAME As String, ByVal EMAIL As String, ByVal ADDED_WHO As String) As Integer
Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(8)
If (PRENAME Is Nothing) Then
command.Parameters(0).Value = Global.System.DBNull.Value
Else
command.Parameters(0).Value = CType(PRENAME,String)
End If
If (NAME Is Nothing) Then
command.Parameters(1).Value = Global.System.DBNull.Value
Else
command.Parameters(1).Value = CType(NAME,String)
End If
If (USERNAME Is Nothing) Then
Throw New Global.System.ArgumentNullException("USERNAME")
Else
command.Parameters(2).Value = CType(USERNAME,String)
End If
If (EMAIL Is Nothing) Then
command.Parameters(3).Value = Global.System.DBNull.Value
Else
command.Parameters(3).Value = CType(EMAIL,String)
End If
If (ADDED_WHO Is Nothing) Then
Throw New Global.System.ArgumentNullException("ADDED_WHO")
Else
command.Parameters(4).Value = CType(ADDED_WHO,String)
End If
Dim previousConnectionState As Global.System.Data.ConnectionState = command.Connection.State
If ((command.Connection.State And Global.System.Data.ConnectionState.Open) _
<> Global.System.Data.ConnectionState.Open) Then
command.Connection.Open
End If
Dim returnValue As Integer
Try
returnValue = command.ExecuteNonQuery
Finally
If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then
command.Connection.Close
End If
End Try
Return returnValue
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function IsUserManagerAdmin(ByVal USERNAME As String) As Global.System.Nullable(Of Integer)
Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(8)
Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(9)
If (USERNAME Is Nothing) Then
Throw New Global.System.ArgumentNullException("USERNAME")
Else
command.Parameters(0).Value = CType(USERNAME,String)
End If
Dim previousConnectionState As Global.System.Data.ConnectionState = command.Connection.State
If ((command.Connection.State And Global.System.Data.ConnectionState.Open) _
<> Global.System.Data.ConnectionState.Open) Then
command.Connection.Open
End If
Dim returnValue As Object
Try
returnValue = command.ExecuteScalar
Finally
If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then
command.Connection.Close
End If
End Try
If ((returnValue Is Nothing) _
OrElse (returnValue.GetType Is GetType(Global.System.DBNull))) Then
Return New Global.System.Nullable(Of Integer)()
Else
Return New Global.System.Nullable(Of Integer)(CType(returnValue,Integer))
End If
End Function
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0"), _
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function UserExists(ByVal USERNAME As String) As Global.System.Nullable(Of Integer)
Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(10)
If (USERNAME Is Nothing) Then
Throw New Global.System.ArgumentNullException("USERNAME")
Else

View File

@ -2,6 +2,9 @@
End Class
Namespace UserDataSetTableAdapters
Partial Public Class TBDD_MODULESTableAdapter
End Class
Partial Public Class TBDD_USERTableAdapter
End Class

View File

@ -903,6 +903,22 @@ WHERE (USERNAME = @USERNAME)</CommandText>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="DD_ECMConnectionString (MySettings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="InsertUser" Modifier="Public" Name="InsertUser" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="InsertUser">
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>INSERT INTO TBDD_USER
(PRENAME, NAME, USERNAME, EMAIL, ADDED_WHO)
VALUES (@PRENAME,@NAME,@USERNAME,@EMAIL,@ADDED_WHO)</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="PRENAME" ColumnName="PRENAME" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@PRENAME" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="PRENAME" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="NAME" ColumnName="NAME" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@NAME" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="NAME" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="USERNAME" ColumnName="USERNAME" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@USERNAME" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="USERNAME" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="EMAIL" ColumnName="EMAIL" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(100)" DbType="AnsiString" Direction="Input" ParameterName="@EMAIL" Precision="0" ProviderType="VarChar" Scale="0" Size="100" SourceColumn="EMAIL" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="ADDED_WHO" ColumnName="ADDED_WHO" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@ADDED_WHO" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="ADDED_WHO" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
</DbSource>
<DbSource ConnectionRef="DD_ECMConnectionString (MySettings)" DbObjectName="DD_ECM_TEST.dbo.TBDD_USER" DbObjectType="Table" GenerateShortCommands="true" GeneratorSourceName="IsUserManagerAdmin" Modifier="Public" Name="IsUserManagerAdmin" QueryType="Scalar" ScalarCallRetval="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="IsUserManagerAdmin">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
@ -916,6 +932,16 @@ WHERE T.USERNAME = @USERNAME AND T2.IS_ADMIN = 1 AND T3.SHORT_NAME = 'UM'</Comma
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="DD_ECMConnectionString (MySettings)" DbObjectName="DD_ECM_TEST.dbo.TBDD_USER" DbObjectType="Table" GenerateShortCommands="true" GeneratorSourceName="UserExists" Modifier="Public" Name="UserExists" QueryType="Scalar" ScalarCallRetval="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy1" UserSourceName="UserExists">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT GUID FROM TBDD_USER WHERE USERNAME = @USERNAME</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="USERNAME" ColumnName="USERNAME" DataSourceName="DD_ECM_TEST.dbo.TBDD_USER" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@USERNAME" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="USERNAME" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
@ -1316,10 +1342,9 @@ WHERE T.USERNAME = @USERNAME AND T2.IS_ADMIN = 1 AND T3.SHORT_NAME = 'UM'</Comma
<xs:complexType>
<xs:sequence>
<xs:element name="USERNAME" msprop:Generator_ColumnVarNameInTable="columnUSERNAME" msprop:Generator_ColumnPropNameInRow="USERNAME" msprop:Generator_ColumnPropNameInTable="USERNAMEColumn" msprop:Generator_UserColumnName="USERNAME" type="xs:string" minOccurs="0" />
<xs:element name="PRENAME" msprop:Generator_ColumnVarNameInTable="columnPRENAME" msprop:Generator_ColumnPropNameInRow="PRENAME" msprop:Generator_ColumnPropNameInTable="PRENAMEColumn" msprop:Generator_UserColumnName="PRENAME" type="xs:string" minOccurs="0" />
<xs:element name="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" msprop:Generator_UserColumnName="NAME" type="xs:string" minOccurs="0" />
<xs:element name="EMAIL" msprop:Generator_ColumnVarNameInTable="columnEMAIL" msprop:Generator_ColumnPropNameInRow="EMAIL" msprop:Generator_ColumnPropNameInTable="EMAILColumn" msprop:Generator_UserColumnName="EMAIL" type="xs:string" minOccurs="0" />
<xs:element name="SELECTED" msprop:Generator_ColumnVarNameInTable="columnSELECTED" msprop:Generator_ColumnPropNameInRow="SELECTED" msprop:Generator_ColumnPropNameInTable="SELECTEDColumn" msprop:Generator_UserColumnName="SELECTED" type="xs:boolean" default="false" minOccurs="0" />
<xs:element name="PRENAME" msprop:nullValue="_null" msprop:Generator_ColumnPropNameInRow="PRENAME" msprop:Generator_ColumnVarNameInTable="columnPRENAME" msprop:Generator_ColumnPropNameInTable="PRENAMEColumn" msprop:Generator_UserColumnName="PRENAME" type="xs:string" minOccurs="0" />
<xs:element name="NAME" msprop:nullValue="_null" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" msprop:Generator_UserColumnName="NAME" type="xs:string" minOccurs="0" />
<xs:element name="EMAIL" msprop:nullValue="_null" msprop:Generator_ColumnPropNameInRow="EMAIL" msprop:Generator_ColumnVarNameInTable="columnEMAIL" msprop:Generator_ColumnPropNameInTable="EMAILColumn" msprop:Generator_UserColumnName="EMAIL" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@ -13,7 +13,7 @@
<Shape ID="DesignTable:TBDD_CLIENT" ZOrder="10" X="447" Y="503" Height="305" Width="224" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:TBDD_CLIENT_USER" ZOrder="12" X="730" Y="596" Height="191" Width="260" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:TBDD_USER" ZOrder="4" X="538" Y="-27" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="256" />
<Shape ID="DesignTable:TBLOCAL_ADUSERS" ZOrder="1" X="1158" Y="607" Height="125" Width="179" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:TBLOCAL_ADUSERS" ZOrder="1" X="1158" Y="607" Height="105" Width="179" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="101" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_TBDD_GROUPS_USER_GROUP_ID" ZOrder="14" LineWidth="11">

View File

@ -23,22 +23,22 @@ Partial Class frmADImport
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmADImport))
Me.gridAD_Groups = New DevExpress.XtraGrid.GridControl()
Me.viewAD_Groups = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.gridAD_Users = New DevExpress.XtraGrid.GridControl()
Me.TBLOCAL_ADUSERSBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.UserDataSet = New DDUserManager.UserDataSet()
Me.viewAD_Users = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colSELECTED = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colUSERNAME = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colPRENAME = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colNAME = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colEMAIL = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colSELECTED = New DevExpress.XtraGrid.Columns.GridColumn()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.RadioButton2 = New System.Windows.Forms.RadioButton()
Me.RadioButton1 = New System.Windows.Forms.RadioButton()
Me.Button1 = New System.Windows.Forms.Button()
Me.btnImport = New System.Windows.Forms.Button()
Me.TBDD_USERTableAdapter = New DDUserManager.UserDataSetTableAdapters.TBDD_USERTableAdapter()
Me.TableAdapterManager = New DDUserManager.UserDataSetTableAdapters.TableAdapterManager()
CType(Me.gridAD_Groups, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.viewAD_Groups, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.gridAD_Users, System.ComponentModel.ISupportInitialize).BeginInit()
@ -46,7 +46,6 @@ Partial Class frmADImport
CType(Me.UserDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.viewAD_Users, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'gridAD_Groups
@ -55,7 +54,7 @@ Partial Class frmADImport
Me.gridAD_Groups.Location = New System.Drawing.Point(0, 0)
Me.gridAD_Groups.MainView = Me.viewAD_Groups
Me.gridAD_Groups.Name = "gridAD_Groups"
Me.gridAD_Groups.Size = New System.Drawing.Size(294, 456)
Me.gridAD_Groups.Size = New System.Drawing.Size(294, 464)
Me.gridAD_Groups.TabIndex = 0
Me.gridAD_Groups.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.viewAD_Groups})
'
@ -63,6 +62,8 @@ Partial Class frmADImport
'
Me.viewAD_Groups.GridControl = Me.gridAD_Groups
Me.viewAD_Groups.Name = "viewAD_Groups"
Me.viewAD_Groups.OptionsView.ShowAutoFilterRow = True
Me.viewAD_Groups.OptionsView.ShowGroupPanel = False
'
'gridAD_Users
'
@ -71,7 +72,7 @@ Partial Class frmADImport
Me.gridAD_Users.Location = New System.Drawing.Point(294, 0)
Me.gridAD_Users.MainView = Me.viewAD_Users
Me.gridAD_Users.Name = "gridAD_Users"
Me.gridAD_Users.Size = New System.Drawing.Size(571, 360)
Me.gridAD_Users.Size = New System.Drawing.Size(579, 409)
Me.gridAD_Users.TabIndex = 1
Me.gridAD_Users.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.viewAD_Users})
'
@ -90,6 +91,17 @@ Partial Class frmADImport
Me.viewAD_Users.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSELECTED, Me.colUSERNAME, Me.colPRENAME, Me.colNAME, Me.colEMAIL})
Me.viewAD_Users.GridControl = Me.gridAD_Users
Me.viewAD_Users.Name = "viewAD_Users"
Me.viewAD_Users.OptionsSelection.MultiSelect = True
Me.viewAD_Users.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect
Me.viewAD_Users.OptionsView.ShowAutoFilterRow = True
Me.viewAD_Users.OptionsView.ShowGroupPanel = False
'
'colSELECTED
'
Me.colSELECTED.FieldName = "SELECTED"
Me.colSELECTED.Name = "colSELECTED"
Me.colSELECTED.Visible = True
Me.colSELECTED.VisibleIndex = 1
'
'colUSERNAME
'
@ -97,7 +109,7 @@ Partial Class frmADImport
Me.colUSERNAME.Name = "colUSERNAME"
Me.colUSERNAME.OptionsColumn.AllowEdit = False
Me.colUSERNAME.Visible = True
Me.colUSERNAME.VisibleIndex = 1
Me.colUSERNAME.VisibleIndex = 2
'
'colPRENAME
'
@ -105,7 +117,7 @@ Partial Class frmADImport
Me.colPRENAME.Name = "colPRENAME"
Me.colPRENAME.OptionsColumn.AllowEdit = False
Me.colPRENAME.Visible = True
Me.colPRENAME.VisibleIndex = 2
Me.colPRENAME.VisibleIndex = 3
'
'colNAME
'
@ -113,7 +125,7 @@ Partial Class frmADImport
Me.colNAME.Name = "colNAME"
Me.colNAME.OptionsColumn.AllowEdit = False
Me.colNAME.Visible = True
Me.colNAME.VisibleIndex = 3
Me.colNAME.VisibleIndex = 4
'
'colEMAIL
'
@ -121,79 +133,57 @@ Partial Class frmADImport
Me.colEMAIL.Name = "colEMAIL"
Me.colEMAIL.OptionsColumn.AllowEdit = False
Me.colEMAIL.Visible = True
Me.colEMAIL.VisibleIndex = 4
'
'colSELECTED
'
Me.colSELECTED.FieldName = "SELECTED"
Me.colSELECTED.Name = "colSELECTED"
Me.colSELECTED.Visible = True
Me.colSELECTED.VisibleIndex = 0
Me.colEMAIL.VisibleIndex = 5
'
'Panel1
'
Me.Panel1.Controls.Add(Me.GroupBox1)
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Controls.Add(Me.btnImport)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel1.Location = New System.Drawing.Point(294, 360)
Me.Panel1.Location = New System.Drawing.Point(294, 409)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(571, 96)
Me.Panel1.Size = New System.Drawing.Size(579, 55)
Me.Panel1.TabIndex = 3
'
'GroupBox1
'btnImport
'
Me.GroupBox1.Controls.Add(Me.RadioButton2)
Me.GroupBox1.Controls.Add(Me.RadioButton1)
Me.GroupBox1.Location = New System.Drawing.Point(6, 6)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(220, 78)
Me.GroupBox1.TabIndex = 1
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Import Methode"
Me.btnImport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnImport.Enabled = False
Me.btnImport.Image = Global.DDUserManager.My.Resources.Resources.user_go
Me.btnImport.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnImport.Location = New System.Drawing.Point(388, 16)
Me.btnImport.Name = "btnImport"
Me.btnImport.Size = New System.Drawing.Size(179, 27)
Me.btnImport.TabIndex = 0
Me.btnImport.Text = "Import starten"
Me.btnImport.UseVisualStyleBackColor = True
'
'RadioButton2
'TBDD_USERTableAdapter
'
Me.RadioButton2.AutoSize = True
Me.RadioButton2.Location = New System.Drawing.Point(6, 42)
Me.RadioButton2.Name = "RadioButton2"
Me.RadioButton2.Size = New System.Drawing.Size(132, 17)
Me.RadioButton2.TabIndex = 0
Me.RadioButton2.TabStop = True
Me.RadioButton2.Text = "UserPrincipal Methode"
Me.RadioButton2.UseVisualStyleBackColor = True
Me.TBDD_USERTableAdapter.ClearBeforeFill = True
'
'RadioButton1
'TableAdapterManager
'
Me.RadioButton1.AutoSize = True
Me.RadioButton1.Location = New System.Drawing.Point(6, 19)
Me.RadioButton1.Name = "RadioButton1"
Me.RadioButton1.Size = New System.Drawing.Size(112, 17)
Me.RadioButton1.TabIndex = 0
Me.RadioButton1.TabStop = True
Me.RadioButton1.Text = "Einfache Methode"
Me.RadioButton1.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Image = Global.DDUserManager.My.Resources.Resources.user_go
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button1.Location = New System.Drawing.Point(380, 57)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(179, 27)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Import starten"
Me.Button1.UseVisualStyleBackColor = True
Me.TableAdapterManager.BackupDataSetBeforeUpdate = False
Me.TableAdapterManager.TBDD_CLIENT_USERTableAdapter = Nothing
Me.TableAdapterManager.TBDD_CLIENTTableAdapter = Nothing
Me.TableAdapterManager.TBDD_GROUPS_USERTableAdapter = Nothing
Me.TableAdapterManager.TBDD_MODULESTableAdapter = Nothing
Me.TableAdapterManager.TBDD_USER_GROUPSTableAdapter = Nothing
Me.TableAdapterManager.TBDD_USER_MODULESTableAdapter = Nothing
Me.TableAdapterManager.TBDD_USERTableAdapter = Me.TBDD_USERTableAdapter
Me.TableAdapterManager.UpdateOrder = DDUserManager.UserDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete
'
'frmADImport
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(865, 456)
Me.ClientSize = New System.Drawing.Size(873, 464)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.gridAD_Users)
Me.Controls.Add(Me.gridAD_Groups)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmADImport"
Me.Text = "frmADImport"
Me.Text = "Active Directory Import"
CType(Me.gridAD_Groups, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.viewAD_Groups, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.gridAD_Users, System.ComponentModel.ISupportInitialize).EndInit()
@ -201,8 +191,6 @@ Partial Class frmADImport
CType(Me.UserDataSet, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.viewAD_Users, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.ResumeLayout(False)
End Sub
@ -219,8 +207,7 @@ Partial Class frmADImport
Friend WithEvents colEMAIL As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colSELECTED As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents Panel1 As Panel
Friend WithEvents Button1 As Button
Friend WithEvents GroupBox1 As GroupBox
Friend WithEvents RadioButton2 As RadioButton
Friend WithEvents RadioButton1 As RadioButton
Friend WithEvents btnImport As Button
Friend WithEvents TBDD_USERTableAdapter As UserDataSetTableAdapters.TBDD_USERTableAdapter
Friend WithEvents TableAdapterManager As UserDataSetTableAdapters.TableAdapterManager
End Class

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
Imports System.DirectoryServices.ActiveDirectory
Imports System.DirectoryServices.AccountManagement
Imports DDUserManager.UserDataSet
Imports DevExpress.XtraGrid.Views.Grid
Public Class frmADImport
@ -143,8 +144,6 @@ Public Class frmADImport
row.PRENAME = user.GivenName
row.USERNAME = user.SamAccountName
row.EMAIL = user.EmailAddress
row.SELECTED = False
UserDataSet.TBLOCAL_ADUSERS.AddTBLOCAL_ADUSERSRow(row)
Next
@ -154,4 +153,41 @@ Public Class frmADImport
MsgBox($"Error while loading users for group {groupName}")
End Try
End Sub
Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
Dim selectedUserHandles As List(Of Integer) = viewAD_Users.GetSelectedRows().ToList()
Dim importedUsers As Integer = 0
For Each rowHandle In selectedUserHandles
Dim rowView As DataRowView = viewAD_Users.GetRow(rowHandle)
Dim userRow As TBLOCAL_ADUSERSRow = rowView.Row
Dim Username As String = userRow.USERNAME
Dim Prename As String = IIf(IsDBNull(userRow.PRENAME), Nothing, userRow.PRENAME)
Dim Name As String = IIf(IsDBNull(userRow.NAME), Nothing, userRow.NAME)
Dim Email As String = IIf(IsDBNull(userRow.EMAIL), Nothing, userRow.EMAIL)
If IsNothing(TBDD_USERTableAdapter.UserExists(userRow.USERNAME)) Then
TBDD_USERTableAdapter.InsertUser(Prename, Name, Username, Email, Environment.UserName)
importedUsers = importedUsers + 1
End If
Next
If importedUsers = 0 Then
MsgBox($"Es wurden keine neuen Benutzer importiert, da alle ausgewählten Benutzer bereits in der Benutzerverwaltung vorhanden sind.", MsgBoxStyle.Exclamation, "UserManager")
Else
MsgBox($"{importedUsers} Benutzer wurden erfolgreich importiert!", MsgBoxStyle.Information, "UserManager")
End If
End Sub
Private Sub viewAD_Users_SelectionChanged(sender As Object, e As DevExpress.Data.SelectionChangedEventArgs) Handles viewAD_Users.SelectionChanged
Dim view As GridView = sender
If view.SelectedRowsCount > 0 Then
btnImport.Enabled = True
Else
btnImport.Enabled = False
End If
End Sub
End Class

View File

@ -269,6 +269,7 @@ Partial Class frmMain
Me.TBDD_USER_MODULESTableAdapter = New DDUserManager.UserDataSetTableAdapters.TBDD_USER_MODULESTableAdapter()
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.tsLabelUser = New System.Windows.Forms.ToolStripStatusLabel()
Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton()
GUIDLabel = New System.Windows.Forms.Label()
PRENAMELabel = New System.Windows.Forms.Label()
NAMELabel = New System.Windows.Forms.Label()
@ -1796,7 +1797,7 @@ Partial Class frmMain
Me.TBDD_USERBindingNavigator.CountItem = Me.BindingNavigatorCountItem
Me.TBDD_USERBindingNavigator.CountItemFormat = "von {0} Benutzern"
Me.TBDD_USERBindingNavigator.DeleteItem = Me.BindingNavigatorDeleteItem
Me.TBDD_USERBindingNavigator.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorMoveFirstItem, Me.BindingNavigatorMovePreviousItem, Me.BindingNavigatorSeparator, Me.BindingNavigatorPositionItem, Me.BindingNavigatorCountItem, Me.BindingNavigatorSeparator1, Me.BindingNavigatorMoveNextItem, Me.BindingNavigatorMoveLastItem, Me.BindingNavigatorSeparator2, Me.BindingNavigatorAddNewItem, Me.BindingNavigatorDeleteItem, Me.TBDD_USERBindingNavigatorSaveItem, Me.ToolStripButton1})
Me.TBDD_USERBindingNavigator.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorMoveFirstItem, Me.BindingNavigatorMovePreviousItem, Me.BindingNavigatorSeparator, Me.BindingNavigatorPositionItem, Me.BindingNavigatorCountItem, Me.BindingNavigatorSeparator1, Me.BindingNavigatorMoveNextItem, Me.BindingNavigatorMoveLastItem, Me.BindingNavigatorSeparator2, Me.BindingNavigatorAddNewItem, Me.BindingNavigatorDeleteItem, Me.TBDD_USERBindingNavigatorSaveItem, Me.ToolStripButton1, Me.ToolStripButton2})
Me.TBDD_USERBindingNavigator.Location = New System.Drawing.Point(0, 0)
Me.TBDD_USERBindingNavigator.MoveFirstItem = Me.BindingNavigatorMoveFirstItem
Me.TBDD_USERBindingNavigator.MoveLastItem = Me.BindingNavigatorMoveLastItem
@ -2688,6 +2689,15 @@ Partial Class frmMain
Me.tsLabelUser.Size = New System.Drawing.Size(83, 17)
Me.tsLabelUser.Text = "tsLabelUser"
'
'ToolStripButton2
'
Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image)
Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta
Me.ToolStripButton2.Name = "ToolStripButton2"
Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22)
Me.ToolStripButton2.Text = "Daten neu laden"
'
'frmMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -3022,4 +3032,5 @@ Partial Class frmMain
Friend WithEvents TextBox3 As TextBox
Friend WithEvents TextBox6 As TextBox
Friend WithEvents TextBox5 As TextBox
Friend WithEvents ToolStripButton2 As ToolStripButton
End Class

View File

@ -222,6 +222,9 @@
<metadata name="TBDD_USERBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
<metadata name="UserDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="TBDD_MODULESBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1158, 95</value>
</metadata>
@ -231,12 +234,6 @@
<metadata name="TBDD_CLIENTBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>268, 95</value>
</metadata>
<metadata name="TBDD_USERBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>136, 17</value>
</metadata>
<metadata name="UserDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="TBDD_USERBindingNavigator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>693, 17</value>
</metadata>
@ -312,27 +309,23 @@
dtINAGGiDUDGyGpoawAxeNSAQWkAORiqnRLAwAAA9EMMU8Daa3MAAAAASUVORK5CYII=
</value>
</data>
<metadata name="TBDD_USER_GROUPSBindingNavigator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>672, 95</value>
</metadata>
<metadata name="TBDD_CLIENTBindingNavigator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>936, 95</value>
</metadata>
<metadata name="TBDD_MODULESBindingNavigator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>234, 134</value>
</metadata>
<metadata name="UserDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="TBDD_MODULESBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1158, 95</value>
</metadata>
<metadata name="TBDD_USER_GROUPSBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>489, 56</value>
</metadata>
<metadata name="TBDD_CLIENTBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>268, 95</value>
</metadata>
<data name="ToolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJqSURBVDhPlZPtT1JhGMbZ/DvIGUYtrS1lOQgzli+pgDqB
NpnIAWE4fGG5TCVROYLKCXlREJMkzWXT3Njcoqwslem0F5O19dlvzs2vzW9XeHimo1rL37dr93PtPnt+
z+H8D3efyTuV88oMEs+OPFSaKPdJwiT+nXurWq55ucHSuFQX0yyqDuqeV6N2qhKyYAlML7TQzagh6sn3
kuPpmN/qhKY3mii93gX/9jDC38YwtRvAxI4XY58ewbM1iMF4HxQBOXKb+QOklqLptZZrfKWOjmw5MPt9
EqGvHjze8SPw2Q3v9hCYDRqOuA29q12QusuQbchykWqKxiW1xfbhPqYTIYR3xuDedMIwp8EtpxAimwD5
HVdR5S1HBVOCbF3mKKmdUr9QGxte72M3uuI0bjOFe4X2624yZuEbeAme9lyExHQUT6X7VROlR3d8kp+S
wRuH4j4BTUYnZDVwrRwlJ0Mzr6BUM3KqZrKcko5KqGJGTHGkgWKq1F1EFTmFlNAmoK515FLHztvW9FbS
P0E5LaPlobLD1DLRkbhXsE9G6bR+1EealjUJEllqn1S4ZYGSvZENZ9LKEDqW2pL3cyVGxqe0rFCjjk0r
+tceQLOgQPIVIvnJML/Ug1mnWaXDG3aoxquR08K3kFoK8zuti453Ye7HFKs0khhPU2pf62aV6mfrcdl8
IcrT8rikmiL5Cgcevm9HZDfIKg1+8cC37QKz6UD/SjeaFw2o8Vfikik7ytNlCkktHdWMzNsaNcI0T6GY
KcRNugAF1jzktecc5DZfjPGN5y1/bP6d4x8nqTTtEs/EsUZhT34nif+Aw/kFSy8zXbcRzP8AAAAASUVO
RK5CYII=
</value>
</data>
<metadata name="TBDD_USER_GROUPSBindingNavigator.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>672, 95</value>
</metadata>

View File

@ -18,14 +18,7 @@ Public Class frmMain
tsLabelUser.Text = $"Angemeldeter Benutzer: {userRow.USERNAME}"
CurrentUser = userRow
TBDD_CLIENTTableAdapter.Fill(UserDataSet.TBDD_CLIENT)
TBDD_USER_GROUPSTableAdapter.Fill(UserDataSet.TBDD_USER_GROUPS)
TBDD_CLIENT_USERTableAdapter.Fill(UserDataSet.TBDD_CLIENT_USER)
TBDD_GROUPS_USERTableAdapter.Fill(UserDataSet.TBDD_GROUPS_USER)
TBDD_USERTableAdapter.Fill(UserDataSet.TBDD_USER)
TBDD_MODULESTableAdapter.FillByUserId_IsAdmin(UserDataSet.TBDD_MODULES, CurrentUser.GUID)
TBDD_USER_MODULESTableAdapter.Fill(UserDataSet.TBDD_USER_MODULES)
LoadData()
gvUsers.BestFitColumns()
@ -43,10 +36,12 @@ Public Class frmMain
Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
Dim frm As New frmADImport()
frm.ShowDialog()
LoadData()
End Sub
Private Sub grvwAllGroups_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles gvGroups_AllGroups.FocusedRowChanged
If e.FocusedRowHandle = -1 Then
If e.FocusedRowHandle < 0 Then
Exit Sub
End If
@ -57,7 +52,7 @@ Public Class frmMain
End Sub
Private Sub gvClients_AllClients_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles gvClients_AllClients.FocusedRowChanged
If e.FocusedRowHandle = -1 Then
If e.FocusedRowHandle < 0 Then
Exit Sub
End If
@ -68,7 +63,7 @@ Public Class frmMain
End Sub
Private Sub gvModules_AllModules_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles gvModules_AllModules.FocusedRowChanged
If e.FocusedRowHandle = -1 Then
If e.FocusedRowHandle < 0 Then
Exit Sub
End If
@ -78,6 +73,21 @@ Public Class frmMain
gridModules_AvailableUsers.DataSource = GetAvailableUsersByModuleId(moduleId)
End Sub
Private Sub LoadData()
Try
TBDD_CLIENTTableAdapter.Fill(UserDataSet.TBDD_CLIENT)
TBDD_USER_GROUPSTableAdapter.Fill(UserDataSet.TBDD_USER_GROUPS)
TBDD_CLIENT_USERTableAdapter.Fill(UserDataSet.TBDD_CLIENT_USER)
TBDD_GROUPS_USERTableAdapter.Fill(UserDataSet.TBDD_GROUPS_USER)
TBDD_USERTableAdapter.Fill(UserDataSet.TBDD_USER)
TBDD_MODULESTableAdapter.Fill(UserDataSet.TBDD_MODULES)
TBDD_USER_MODULESTableAdapter.Fill(UserDataSet.TBDD_USER_MODULES)
Catch ex As Exception
MsgBox($"Error while loading UserData: {ex.Message}")
End Try
End Sub
#Region "User Details"
Private Function GetCurrentUserRow(username As String) As TBDD_USERRow
Dim dt As DataTable = TBDD_USERTableAdapter.GetDataByUsername(username)
@ -458,5 +468,9 @@ Public Class frmMain
gvModules_AssignedUsers.ClearSelection()
gvModules_AvailableUsers.ClearSelection()
End Sub
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
LoadData()
End Sub
#End Region
End Class