Zooflow: Add user relations

This commit is contained in:
Jonathan Jenne 2022-03-09 14:09:44 +01:00
parent 9e448641a0
commit 574dcf9d32
8 changed files with 710 additions and 147 deletions

View File

@ -24,6 +24,7 @@
Public Const PAGE_USERS_USERLIST = "USERS_USERLIST"
Public Const PAGE_USERS_GROUPLIST = "USERS_GROUPLIST"
Public Const PAGE_USERS_MODULELIST = "USERS_MODULELIST"
Public Const PAGE_USERS_USER_GROUP_RELATIONS = "USERS_USER_GROUP_RELATIONS"
Public Const COLUMN_NAME_ACTIVE = "ACTIVE"

View File

@ -84,11 +84,10 @@ Public Class ClassDetailForm
.[Module] = MODULE_USERS,
.Entity = PAGE_USERS_GROUPLIST
}},
{PAGE_USERS_MODULELIST, New DetailSettings With {
.GridTitle = "Modul Übersicht",
.NewRecordTitle = "Neues Modul",
{PAGE_USERS_USER_GROUP_RELATIONS, New DetailSettings With {
.GridTitle = "User Group Relations",
.[Module] = MODULE_USERS,
.Entity = PAGE_USERS_MODULELIST
.Entity = PAGE_USERS_USER_GROUP_RELATIONS
}}
}
@ -96,6 +95,69 @@ Public Class ClassDetailForm
MyBase.New(LogConfig)
End Sub
Public Function Handle_OpenDetail(PrimaryKey As Integer, Page As String, IsInsert As Boolean) As Boolean
Try
Dim oForm As Form = Nothing
Select Case Page
Case PAGE_IDB_ATTRIBUTES
oForm = New frmAdmin_IDBAttribute(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_IDB_BUSINESS_ENTITIES
oForm = New frmAdmin_IDBEntity(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_IDB_OBJECT_STORES
oForm = New frmAdmin_IDBObjectStore(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_CW_PROFILES
oForm = New frmAdmin_ClipboardWatcher(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_GI_PROFILES
GLOBIX_JUMP_DOCTYPE_ID = PrimaryKey
oForm = New frmAdmin_Globix(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_META_SOURCE_SQL
oForm = New frmAdmin_SourceSQL(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_IDB_ATTRIBUTE_REL
oForm = New frmAdmin_IDBBERelations
Case PAGE_GI_RELATIONS
oForm = New frmAdmin_GlobixRelations
Case PAGE_IDB_DOCTYPE_CONFIG
oForm = New frmAdmin_DoctypeConfig(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_IDB_DOCTYPE
oForm = New frmAdmin_Doctype(0)
Case PAGE_IDB_DOCTYPE_BE
oForm = New frmAdmin_DoctypeBE()
Case PAGE_USERS_USERLIST
oForm = New frmAdmin_User(PrimaryKey) With {.IsInsert = IsInsert}
Case PAGE_USERS_USER_GROUP_RELATIONS
oForm = New frmAdmin_UserGroupRelations(PrimaryKey) With {.isinsert = IsInsert}
End Select
' If the selected form was valid, open it
' and then raise the form closed event for it
If oForm IsNot Nothing Then
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Return True
Else
Return False
End If
Catch ex As Exception
Throw ex
End Try
End Function
Public Function LoadData() As Boolean
Try
Dim oTable As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL WHERE SCOPE = 'OVERVIEW' ORDER BY GUID")
@ -132,149 +194,6 @@ Public Class ClassDetailForm
End Try
End Function
Public Function Handle_OpenDetail(PrimaryKey As Integer, Page As String, IsInsert As Boolean) As Boolean
Select Case Page
Case PAGE_IDB_ATTRIBUTES
Load_IDBAttribute(PrimaryKey, IsInsert)
Return True
Case PAGE_IDB_BUSINESS_ENTITIES
Load_IDBEntity(PrimaryKey, IsInsert)
Return True
Case PAGE_IDB_OBJECT_STORES
Load_IDBObjectstore(PrimaryKey, IsInsert)
Return True
Case PAGE_CW_PROFILES
Load_CWProfile(PrimaryKey, IsInsert)
Return True
Case PAGE_GI_PROFILES
GLOBIX_JUMP_DOCTYPE_ID = PrimaryKey
Load_GLOBIXProfile(PrimaryKey, IsInsert)
Return True
Case PAGE_META_SOURCE_SQL
Load_SourceSQL(PrimaryKey, IsInsert)
Return True
Case PAGE_IDB_ATTRIBUTE_REL
Dim oForm As New frmAdmin_IDBBERelations
oForm.ShowDialog()
Return True
Case PAGE_GI_RELATIONS
Dim oForm As New frmAdmin_GlobixRelations
oForm.ShowDialog()
Return True
Case PAGE_IDB_DOCTYPE_CONFIG
Dim oForm As New frmAdmin_DoctypeConfig(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
Return True
Case PAGE_IDB_DOCTYPE
Dim oForm As New frmAdmin_Doctype(0)
oForm.ShowDialog()
Return True
Case PAGE_IDB_DOCTYPE_BE
Dim oForm As New frmAdmin_DoctypeBE()
oForm.ShowDialog()
Return True
Case PAGE_USERS_USERLIST
Load_User(PrimaryKey, IsInsert)
Return True
Case Else
Return False
End Select
End Function
Private Sub Load_SourceSQL(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_SourceSQL(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_IDBAttribute(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_IDBAttribute(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_User(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_User(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_IDBObjectstore(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_IDBObjectStore(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_IDBEntity(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_IDBEntity(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_CWProfile(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_ClipboardWatcher(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Private Sub Load_GLOBIXProfile(PrimaryKey As Integer, IsInsert As Boolean)
Try
Dim oForm As New frmAdmin_Globix(PrimaryKey) With {.IsInsert = IsInsert}
oForm.ShowDialog()
RaiseEvent DetailFormClosed(Me, oForm)
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Public Class DetailSettings
Public Property GridTitle As String
Public Property [Module] As String

View File

@ -0,0 +1,354 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmAdmin_UserGroupRelations
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl()
Me.GridControl3 = New DevExpress.XtraGrid.GridControl()
Me.GridView3 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colUsername2 = New DevExpress.XtraGrid.Columns.GridColumn()
Me.GridControl2 = New DevExpress.XtraGrid.GridControl()
Me.GridView2 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colName = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colInternal = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colActive = New DevExpress.XtraGrid.Columns.GridColumn()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colUsername = New DevExpress.XtraGrid.Columns.GridColumn()
Me.Root = New DevExpress.XtraLayout.LayoutControlGroup()
Me.SimpleLabelItem1 = New DevExpress.XtraLayout.SimpleLabelItem()
Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem()
Me.SimpleLabelItem2 = New DevExpress.XtraLayout.SimpleLabelItem()
Me.SimpleLabelItem3 = New DevExpress.XtraLayout.SimpleLabelItem()
Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem()
Me.colSurname = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colSurname2 = New DevExpress.XtraGrid.Columns.GridColumn()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.LayoutControl1.SuspendLayout()
CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SimpleLabelItem1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SimpleLabelItem2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SimpleLabelItem3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RibbonControl1
'
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 1
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.Size = New System.Drawing.Size(1221, 158)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'RibbonPage1
'
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2})
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 651)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1221, 24)
'
'RibbonPage2
'
Me.RibbonPage2.Name = "RibbonPage2"
Me.RibbonPage2.Text = "RibbonPage2"
'
'LayoutControl1
'
Me.LayoutControl1.Controls.Add(Me.GridControl3)
Me.LayoutControl1.Controls.Add(Me.GridControl2)
Me.LayoutControl1.Controls.Add(Me.GridControl1)
Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.LayoutControl1.Location = New System.Drawing.Point(0, 158)
Me.LayoutControl1.Name = "LayoutControl1"
Me.LayoutControl1.Root = Me.Root
Me.LayoutControl1.Size = New System.Drawing.Size(1221, 493)
Me.LayoutControl1.TabIndex = 2
Me.LayoutControl1.Text = "LayoutControl1"
'
'GridControl3
'
Me.GridControl3.AllowDrop = True
Me.GridControl3.Location = New System.Drawing.Point(816, 45)
Me.GridControl3.MainView = Me.GridView3
Me.GridControl3.MenuManager = Me.RibbonControl1
Me.GridControl3.Name = "GridControl3"
Me.GridControl3.Size = New System.Drawing.Size(393, 436)
Me.GridControl3.TabIndex = 6
Me.GridControl3.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView3})
'
'GridView3
'
Me.GridView3.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colUsername2, Me.colSurname2})
Me.GridView3.GridControl = Me.GridControl3
Me.GridView3.Name = "GridView3"
'
'colUsername2
'
Me.colUsername2.Caption = "Benutzername"
Me.colUsername2.FieldName = "USERNAME"
Me.colUsername2.Name = "colUsername2"
Me.colUsername2.Visible = True
Me.colUsername2.VisibleIndex = 0
'
'GridControl2
'
Me.GridControl2.Location = New System.Drawing.Point(414, 45)
Me.GridControl2.MainView = Me.GridView2
Me.GridControl2.MenuManager = Me.RibbonControl1
Me.GridControl2.Name = "GridControl2"
Me.GridControl2.Size = New System.Drawing.Size(398, 436)
Me.GridControl2.TabIndex = 5
Me.GridControl2.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView2})
'
'GridView2
'
Me.GridView2.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colName, Me.colInternal, Me.colActive})
Me.GridView2.GridControl = Me.GridControl2
Me.GridView2.Name = "GridView2"
'
'colName
'
Me.colName.Caption = "Name"
Me.colName.FieldName = "NAME"
Me.colName.Name = "colName"
Me.colName.Visible = True
Me.colName.VisibleIndex = 0
'
'colInternal
'
Me.colInternal.Caption = "Systemgruppe"
Me.colInternal.FieldName = "INTERNAL"
Me.colInternal.Name = "colInternal"
Me.colInternal.Visible = True
Me.colInternal.VisibleIndex = 1
'
'colActive
'
Me.colActive.Caption = "Aktiv"
Me.colActive.FieldName = "ACTIVE"
Me.colActive.Name = "colActive"
Me.colActive.Visible = True
Me.colActive.VisibleIndex = 2
'
'GridControl1
'
Me.GridControl1.AllowDrop = True
Me.GridControl1.Location = New System.Drawing.Point(12, 45)
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.MenuManager = Me.RibbonControl1
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(398, 436)
Me.GridControl1.TabIndex = 4
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
'GridView1
'
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSurname, Me.colUsername})
Me.GridView1.GridControl = Me.GridControl1
Me.GridView1.Name = "GridView1"
'
'colUsername
'
Me.colUsername.Caption = "Benutzername"
Me.colUsername.FieldName = "USERNAME"
Me.colUsername.Name = "colUsername"
Me.colUsername.Visible = True
Me.colUsername.VisibleIndex = 1
'
'Root
'
Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.Root.GroupBordersVisible = False
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.SimpleLabelItem1, Me.LayoutControlItem1, Me.SimpleLabelItem2, Me.SimpleLabelItem3, Me.LayoutControlItem2, Me.LayoutControlItem3})
Me.Root.Name = "Root"
Me.Root.Size = New System.Drawing.Size(1221, 493)
Me.Root.TextVisible = False
'
'SimpleLabelItem1
'
Me.SimpleLabelItem1.AllowHotTrack = False
Me.SimpleLabelItem1.Location = New System.Drawing.Point(0, 0)
Me.SimpleLabelItem1.Name = "SimpleLabelItem1"
Me.SimpleLabelItem1.Padding = New DevExpress.XtraLayout.Utils.Padding(10, 10, 10, 10)
Me.SimpleLabelItem1.Size = New System.Drawing.Size(402, 33)
Me.SimpleLabelItem1.Text = "Nicht zugeordnete Benutzer"
Me.SimpleLabelItem1.TextSize = New System.Drawing.Size(144, 13)
'
'LayoutControlItem1
'
Me.LayoutControlItem1.Control = Me.GridControl1
Me.LayoutControlItem1.Location = New System.Drawing.Point(0, 33)
Me.LayoutControlItem1.Name = "LayoutControlItem1"
Me.LayoutControlItem1.Size = New System.Drawing.Size(402, 440)
Me.LayoutControlItem1.TextSize = New System.Drawing.Size(0, 0)
Me.LayoutControlItem1.TextVisible = False
'
'SimpleLabelItem2
'
Me.SimpleLabelItem2.AllowHotTrack = False
Me.SimpleLabelItem2.Location = New System.Drawing.Point(402, 0)
Me.SimpleLabelItem2.Name = "SimpleLabelItem2"
Me.SimpleLabelItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(10, 10, 10, 10)
Me.SimpleLabelItem2.Size = New System.Drawing.Size(402, 33)
Me.SimpleLabelItem2.Text = "Gruppen"
Me.SimpleLabelItem2.TextSize = New System.Drawing.Size(144, 13)
'
'SimpleLabelItem3
'
Me.SimpleLabelItem3.AllowHotTrack = False
Me.SimpleLabelItem3.Location = New System.Drawing.Point(804, 0)
Me.SimpleLabelItem3.Name = "SimpleLabelItem3"
Me.SimpleLabelItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(10, 10, 10, 10)
Me.SimpleLabelItem3.Size = New System.Drawing.Size(397, 33)
Me.SimpleLabelItem3.Text = "Zugeordnete Benutzer"
Me.SimpleLabelItem3.TextSize = New System.Drawing.Size(144, 13)
'
'LayoutControlItem2
'
Me.LayoutControlItem2.Control = Me.GridControl2
Me.LayoutControlItem2.Location = New System.Drawing.Point(402, 33)
Me.LayoutControlItem2.Name = "LayoutControlItem2"
Me.LayoutControlItem2.Size = New System.Drawing.Size(402, 440)
Me.LayoutControlItem2.TextSize = New System.Drawing.Size(0, 0)
Me.LayoutControlItem2.TextVisible = False
'
'LayoutControlItem3
'
Me.LayoutControlItem3.Control = Me.GridControl3
Me.LayoutControlItem3.Location = New System.Drawing.Point(804, 33)
Me.LayoutControlItem3.Name = "LayoutControlItem3"
Me.LayoutControlItem3.Size = New System.Drawing.Size(397, 440)
Me.LayoutControlItem3.TextSize = New System.Drawing.Size(0, 0)
Me.LayoutControlItem3.TextVisible = False
'
'colSurname
'
Me.colSurname.Caption = "Name"
Me.colSurname.FieldName = "NAME"
Me.colSurname.Name = "colSurname"
Me.colSurname.Visible = True
Me.colSurname.VisibleIndex = 0
'
'colSurname2
'
Me.colSurname2.Caption = "Name"
Me.colSurname2.FieldName = "NAME"
Me.colSurname2.Name = "colSurname2"
Me.colSurname2.Visible = True
Me.colSurname2.VisibleIndex = 1
'
'frmAdmin_UserGroupRelations
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1221, 675)
Me.Controls.Add(Me.LayoutControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmAdmin_UserGroupRelations"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "frmAdmin_UserGroupRelations"
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.LayoutControl1.ResumeLayout(False)
CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SimpleLabelItem1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SimpleLabelItem2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SimpleLabelItem3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl
Friend WithEvents GridControl3 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView3 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents GridControl2 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView2 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents Root As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents SimpleLabelItem1 As DevExpress.XtraLayout.SimpleLabelItem
Friend WithEvents LayoutControlItem1 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents SimpleLabelItem2 As DevExpress.XtraLayout.SimpleLabelItem
Friend WithEvents SimpleLabelItem3 As DevExpress.XtraLayout.SimpleLabelItem
Friend WithEvents LayoutControlItem2 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents LayoutControlItem3 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents colName As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colInternal As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colActive As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colUsername2 As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colUsername As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colSurname2 As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colSurname As DevExpress.XtraGrid.Columns.GridColumn
End Class

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,155 @@
Imports DigitalData.GUIs.Common
Imports DigitalData.GUIs.Common.Base
Public Class frmAdmin_UserGroupRelations
Implements IBaseForm, IAdminForm
Public ReadOnly Property LogConfig As Modules.Logging.LogConfig Implements IBaseForm.LogConfig
Public ReadOnly Property Logger As Modules.Logging.Logger Implements IBaseForm.Logger
Public ReadOnly Property ErrorHandler As BaseErrorHandler Implements IBaseForm.ErrorHandler
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
Public Property HasChanges As Boolean Implements IAdminForm.HasChanges
Public Property IsInsert As Boolean Implements IAdminForm.IsInsert
Private Property SelectedGroupId As Integer = Nothing
Public Sub New(pPrimaryKey As Integer)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
LogConfig = My.LogConfig
ErrorHandler = New BaseErrorHandler(LogConfig, Me)
End Sub
Private Async Sub frmAdmin_UserGroupRelations_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim DragDropManager = New ClassDragDrop(LogConfig)
DragDropManager.AddGridView(GridView1)
DragDropManager.AddGridView(GridView3)
Dim GridBuilder = New GridBuilder(GridView1, GridView2, GridView3)
GridBuilder.
WithDefaults().
WithReadOnlyOptions()
Dim oSQL = "SELECT * FROM TBDD_GROUPS"
Dim oTable As DataTable = Await My.DatabaseECM.GetDatatableAsync(oSQL)
GridControl2.DataSource = oTable
Catch ex As Exception
ErrorHandler.ShowErrorMessage(ex, "Fehler beim Laden des Formulars")
End Try
End Sub
Private Async Function GetAvailableUsersByGroupId(pGroupId As Integer) As Threading.Tasks.Task(Of DataTable)
Try
Dim oSql As String = $"
SELECT T1.GUID, T1.PRENAME, T1.NAME, T1.USERNAME, T1.SHORTNAME, T1.EMAIL, T1.LANGUAGE, T1.COMMENT, T1.DATE_FORMAT, T1.ADDED_WHO, T1.ADDED_WHEN, T1.CHANGED_WHO, T1.CHANGED_WHEN
FROM TBDD_USER AS T1 INNER JOIN
TBDD_GROUPS_USER AS T2 ON T1.GUID = T2.USER_ID
WHERE (T2.GROUP_ID = {pGroupId})
"
Dim oTable = Await My.DatabaseECM.GetDatatableAsync(oSql)
Return oTable
Catch ex As Exception
ErrorHandler.ShowErrorMessage(ex, "GetAvailableUsersByGroupId")
Return Nothing
End Try
End Function
Private Async Function GetRelatedUsersByGroupId(pGroupId As Integer) As Threading.Tasks.Task(Of DataTable)
Try
Dim oSql As String = $"
SELECT GUID, PRENAME, NAME, USERNAME, SHORTNAME, EMAIL, LANGUAGE, COMMENT, 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_GROUPS_USER AS T1 ON T.GUID = T1.USER_ID
WHERE (T1.GROUP_ID = {pGroupId})))
"
Dim oTable = Await My.DatabaseECM.GetDatatableAsync(oSql)
Return oTable
Catch ex As Exception
ErrorHandler.ShowErrorMessage(ex, "GetRelatedUsersByGroupId")
Return Nothing
End Try
End Function
Public Function DeleteData() As Boolean Implements IAdminForm.DeleteData
Throw New NotImplementedException()
End Function
Private Async Sub GridView2_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridView2.FocusedRowChanged
Dim oRowView As DataRowView = GridView2.GetRow(GridView2.FocusedRowHandle)
Dim oRow As DataRow = oRowView.Row
If oRow IsNot Nothing Then
SelectedGroupId = oRow.Item("GUID")
Await UpdateUsers(SelectedGroupId)
End If
End Sub
Private Async Function UpdateUsers(pGroupId As Integer) As Threading.Tasks.Task
Dim oAvailableTable = Await GetAvailableUsersByGroupId(SelectedGroupId)
GridControl1.DataSource = oAvailableTable
Dim oRelatedTable = Await GetRelatedUsersByGroupId(SelectedGroupId)
GridControl3.DataSource = oRelatedTable
End Function
Private Async Sub GridControl1_DragDrop(sender As Object, e As DragEventArgs) Handles GridControl1.DragDrop
Dim oData As String = e.Data.GetData(DataFormats.Text)
Dim oGuid As Integer = oData.Split("|").ToList.First()
If Await AddUserToGroup(oGuid, SelectedGroupId) Then
Await UpdateUsers(SelectedGroupId)
End If
End Sub
Private Async Sub GridControl3_DragDrop(sender As Object, e As DragEventArgs) Handles GridControl3.DragDrop
Dim oData As String = e.Data.GetData(DataFormats.Text)
Dim oGuid As Integer = oData.Split("|").ToList.First()
If Await RemoveUserFromGroup(oGuid, SelectedGroupId) Then
Await UpdateUsers(SelectedGroupId)
End If
End Sub
Private Async Function AddUserToGroup(pUserId As Integer, pGroupId As Integer) As Threading.Tasks.Task(Of Boolean)
Try
Dim oUser = My.Application.User.UserName
Dim oSql = $"
INSERT INTO TBDD_GROUPS_USER
(USER_ID, GROUP_ID, COMMENT, ADDED_WHO)
VALUES (
{pUserId},
{pGroupId},
'Assign User {pUserId} to Group {pGroupId}',
'{oUser}'
)"
Return Await My.DatabaseECM.ExecuteNonQueryAsync(oSql)
Catch ex As Exception
Logger.error(ex)
Return False
End Try
End Function
Private Async Function RemoveUserFromGroup(pUserId As Integer, pGroupId As Integer) As Threading.Tasks.Task(Of Boolean)
Try
Dim oUser = My.Application.User.UserName
Dim oSql = $"
DELETE FROM TBDD_GROUPS_USER
WHERE USER_ID = {pUserId} AND GROUP_ID = {pGroupId}
"
Return Await My.DatabaseECM.ExecuteNonQueryAsync(oSql)
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
End Class

View File

@ -439,6 +439,7 @@ Partial Class frmAdmin_Start
Me.TreeListMenu.AppendNode(New Object() {"User Management"}, -1, 11, 11, -1)
Me.TreeListMenu.AppendNode(New Object() {"User List"}, 16, 5, 5, -1, "USERS_USERLIST")
Me.TreeListMenu.AppendNode(New Object() {"Group List"}, 16, 12, 12, -1, "USERS_GROUPLIST")
Me.TreeListMenu.AppendNode(New Object() {"User To Group Relations"}, 16, "USERS_USER_GROUP_RELATIONS")
Me.TreeListMenu.EndUnboundLoad()
Me.TreeListMenu.OptionsBehavior.Editable = False
Me.TreeListMenu.OptionsView.ShowColumns = False

View File

@ -274,4 +274,8 @@ Public Class frmAdmin_Start
Dim oForm As New frmAdmin_ImportUser()
oForm.ShowDialog()
End Sub
Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click
End Sub
End Class

View File

@ -241,6 +241,12 @@
<Compile Include="Administration\Users\frmAdmin_User.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Administration\Users\frmAdmin_UserGroupRelations.Designer.vb">
<DependentUpon>frmAdmin_UserGroupRelations.vb</DependentUpon>
</Compile>
<Compile Include="Administration\Users\frmAdmin_UserGroupRelations.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Administration\Users\frmWaitForm.Designer.vb">
<DependentUpon>frmWaitForm.vb</DependentUpon>
</Compile>
@ -479,6 +485,9 @@
<EmbeddedResource Include="Administration\Users\frmAdmin_User.resx">
<DependentUpon>frmAdmin_User.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Administration\Users\frmAdmin_UserGroupRelations.resx">
<DependentUpon>frmAdmin_UserGroupRelations.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Administration\Users\frmWaitForm.resx">
<DependentUpon>frmWaitForm.vb</DependentUpon>
</EmbeddedResource>