Zooflow: Massive Clean up
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
Imports DigitalData.GUIs.ZooFlow.Administration.ClassConstants
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class ClassDetailForm
|
||||
Inherits Base.BaseClass
|
||||
Inherits BaseClass
|
||||
|
||||
Public Event DetailFormClosed As EventHandler(Of Form)
|
||||
|
||||
|
||||
@@ -1,31 +1,41 @@
|
||||
Public Class ClassGIDatatables
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ClassGIDatatables
|
||||
Inherits BaseClass
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig)
|
||||
End Sub
|
||||
|
||||
#Region "TBDD_GROUP"
|
||||
Public Shared Function AddGroupToProfile(GroupId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
|
||||
|
||||
Public Function AddGroupToProfile(GroupId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
INSERT INTO TBDD_USRGRP_DOKTYPE
|
||||
(DOCTYPE_ID, GROUP_ID, ADDED_WHO)
|
||||
VALUES ({ProfileId}, {GroupId}, '{Environment.UserName}')
|
||||
"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function RemoveGroupFromProfile(GroupId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"DELETE FROM TBDD_USRGRP_DOKTYPE WHERE DOCTYPE_ID = {ProfileId} AND GROUP_ID = {GroupId}"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAssignedGroups(ProfileId As Integer) As DataTable
|
||||
Public Function RemoveGroupFromProfile(GroupId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"DELETE FROM TBDD_USRGRP_DOKTYPE WHERE DOCTYPE_ID = {ProfileId} AND GROUP_ID = {GroupId}"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetAssignedGroups(ProfileId As Integer) As DataTable
|
||||
Try
|
||||
Dim oSQL As String = $"
|
||||
SELECT GUID, NAME FROM TBDD_GROUPS
|
||||
@@ -40,12 +50,12 @@
|
||||
|
||||
Return oDatatable
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAvailableGroups(ProfileId As Integer) As DataTable
|
||||
Public Function GetAvailableGroups(ProfileId As Integer) As DataTable
|
||||
Try
|
||||
Dim oSQL As String = $"
|
||||
SELECT GUID, NAME FROM TBDD_GROUPS
|
||||
@@ -60,7 +70,7 @@
|
||||
|
||||
Return oDatatable
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
@@ -68,7 +78,7 @@
|
||||
|
||||
#Region "TBDD_USER"
|
||||
|
||||
Public Shared Function AddUserToProfile(UserId As Integer, ProfileId As Integer) As Boolean
|
||||
Public Function AddUserToProfile(UserId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
INSERT INTO TBDD_USER_DOKTYPE
|
||||
@@ -77,22 +87,22 @@
|
||||
"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function RemoveUserFromProfile(UserId As Integer, ProfileId As Integer) As Boolean
|
||||
Public Function RemoveUserFromProfile(UserId As Integer, ProfileId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"DELETE FROM TBDD_USER_DOKTYPE WHERE DOCTYPE_ID = {ProfileId} AND USER_ID = {UserId}"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAssignedUsers(ProfileId As Integer) As DataTable
|
||||
Public Function GetAssignedUsers(ProfileId As Integer) As DataTable
|
||||
Try
|
||||
Dim oSQL As String = $"
|
||||
SELECT GUID, EMAIL, NAME + ', ' + PRENAME AS NAME FROM TBDD_USER
|
||||
@@ -106,12 +116,12 @@
|
||||
|
||||
Return oDatatable
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAvailableUsers(ProfileId As Integer) As DataTable
|
||||
Public Function GetAvailableUsers(ProfileId As Integer) As DataTable
|
||||
Try
|
||||
Dim oSQL As String = $"
|
||||
SELECT GUID, EMAIL, NAME + ', ' + PRENAME AS NAME FROM TBDD_USER
|
||||
@@ -125,14 +135,14 @@
|
||||
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL)
|
||||
|
||||
Return oDatatable
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
@@ -7,7 +7,7 @@ Public Class frmAdmin_Globix
|
||||
Public Property HasChanges As Boolean = False Implements IAdminForm.HasChanges
|
||||
Public Property IsInsert As Boolean = False Implements IAdminForm.IsInsert
|
||||
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
|
||||
|
||||
Public Property GlobixHelper As ClassGIDatatables
|
||||
|
||||
Private Pages As ClassDetailPages
|
||||
Public Sub New(PrimaryKey As Integer, Optional IsInsert As Boolean = False)
|
||||
@@ -17,6 +17,7 @@ Public Class frmAdmin_Globix
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
Me.PrimaryKey = PrimaryKey
|
||||
Me.IsInsert = IsInsert
|
||||
Me.GlobixHelper = New ClassGIDatatables(My.LogConfig)
|
||||
End Sub
|
||||
|
||||
Private Sub frmAdmin_Globix_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
@@ -409,10 +410,10 @@ Public Class frmAdmin_Globix
|
||||
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl1.SelectedPageChanged
|
||||
Select Case XtraTabControl1.SelectedTabPageIndex
|
||||
Case 1
|
||||
gridAssignedGroups.DataSource = ClassGIDatatables.GetAssignedGroups(TextEditDoctypeID.Text)
|
||||
gridAvailableGroups.DataSource = ClassGIDatatables.GetAvailableGroups(TextEditDoctypeID.Text)
|
||||
gridAssignedUsers.DataSource = ClassGIDatatables.GetAssignedUsers(TextEditDoctypeID.Text)
|
||||
gridAvailableUsers.DataSource = ClassGIDatatables.GetAvailableUsers(TextEditDoctypeID.Text)
|
||||
gridAssignedGroups.DataSource = GlobixHelper.GetAssignedGroups(TextEditDoctypeID.Text)
|
||||
gridAvailableGroups.DataSource = GlobixHelper.GetAvailableGroups(TextEditDoctypeID.Text)
|
||||
gridAssignedUsers.DataSource = GlobixHelper.GetAssignedUsers(TextEditDoctypeID.Text)
|
||||
gridAvailableUsers.DataSource = GlobixHelper.GetAvailableUsers(TextEditDoctypeID.Text)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -422,9 +423,9 @@ Public Class frmAdmin_Globix
|
||||
Dim userId As Integer = data.Split("|")(0)
|
||||
Dim profileId As Integer = TextEditDoctypeID.Text
|
||||
|
||||
ClassGIDatatables.AddUserToProfile(userId, profileId)
|
||||
gridAssignedUsers.DataSource = ClassGIDatatables.GetAssignedUsers(profileId)
|
||||
gridAvailableUsers.DataSource = ClassGIDatatables.GetAvailableUsers(profileId)
|
||||
GlobixHelper.AddUserToProfile(userId, profileId)
|
||||
gridAssignedUsers.DataSource = GlobixHelper.GetAssignedUsers(profileId)
|
||||
gridAvailableUsers.DataSource = GlobixHelper.GetAvailableUsers(profileId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:")
|
||||
@@ -437,9 +438,9 @@ Public Class frmAdmin_Globix
|
||||
Dim userId As Integer = data.Split("|")(0)
|
||||
Dim profileId As Integer = TextEditDoctypeID.Text
|
||||
|
||||
ClassGIDatatables.RemoveUserFromProfile(userId, profileId)
|
||||
gridAssignedUsers.DataSource = ClassGIDatatables.GetAssignedUsers(profileId)
|
||||
gridAvailableUsers.DataSource = ClassGIDatatables.GetAvailableUsers(profileId)
|
||||
GlobixHelper.RemoveUserFromProfile(userId, profileId)
|
||||
gridAssignedUsers.DataSource = GlobixHelper.GetAssignedUsers(profileId)
|
||||
gridAvailableUsers.DataSource = GlobixHelper.GetAvailableUsers(profileId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:")
|
||||
@@ -452,9 +453,9 @@ Public Class frmAdmin_Globix
|
||||
Dim groupId As Integer = data.Split("|")(0)
|
||||
Dim profileId As Integer = TextEditDoctypeID.Text
|
||||
|
||||
ClassGIDatatables.AddGroupToProfile(groupId, profileId)
|
||||
gridAssignedGroups.DataSource = ClassGIDatatables.GetAssignedGroups(profileId)
|
||||
gridAvailableGroups.DataSource = ClassGIDatatables.GetAvailableGroups(profileId)
|
||||
GlobixHelper.AddGroupToProfile(groupId, profileId)
|
||||
gridAssignedGroups.DataSource = GlobixHelper.GetAssignedGroups(profileId)
|
||||
gridAvailableGroups.DataSource = GlobixHelper.GetAvailableGroups(profileId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:")
|
||||
@@ -467,9 +468,9 @@ Public Class frmAdmin_Globix
|
||||
Dim groupId As Integer = data.Split("|")(0)
|
||||
Dim profileId As Integer = TextEditDoctypeID.Text
|
||||
|
||||
ClassGIDatatables.RemoveGroupFromProfile(groupId, profileId)
|
||||
gridAssignedGroups.DataSource = ClassGIDatatables.GetAssignedGroups(profileId)
|
||||
gridAvailableGroups.DataSource = ClassGIDatatables.GetAvailableGroups(profileId)
|
||||
GlobixHelper.RemoveGroupFromProfile(groupId, profileId)
|
||||
gridAssignedGroups.DataSource = GlobixHelper.GetAssignedGroups(profileId)
|
||||
gridAvailableGroups.DataSource = GlobixHelper.GetAvailableGroups(profileId)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:")
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
Public Class frmAdmin_GlobixRelations
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class frmAdmin_GlobixRelations
|
||||
|
||||
Private SELECTED_DTID As Integer
|
||||
Private Logger As Logger
|
||||
|
||||
Private Function GetAvailableUsers(doctypeid As Integer) As DataTable
|
||||
Try
|
||||
Dim dt As DataTable
|
||||
@@ -33,6 +38,8 @@ INNER JOIN TBDD_USER B ON A.USER_ID = B.GUID WHERE A.DOCTYPE_ID = {doctypeid}"
|
||||
Try
|
||||
Dim oSQL = "SELECT DOCTYPE_ID As ID, DOCTYPE as Doctype FROM VWGI_DOCTYPE_IDB ORDER BY DOCTYPE"
|
||||
Dim oDT As DataTable = My.DatabaseECM.GetDatatable(oSQL)
|
||||
Logger = My.LogConfig.GetLogger()
|
||||
|
||||
GridControlDoctypesUsers.DataSource = oDT
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage($"Error in FormLoad", ex)
|
||||
@@ -76,7 +83,7 @@ INNER JOIN TBDD_USER B ON A.USER_ID = B.GUID WHERE A.DOCTYPE_ID = {doctypeid}"
|
||||
VALUES ({SELECTED_DTID},{UsrID},'{My.Application.User.UserName}')"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
@@ -91,12 +98,12 @@ INNER JOIN TBDD_USER B ON A.USER_ID = B.GUID WHERE A.DOCTYPE_ID = {doctypeid}"
|
||||
LoadFreeUsers()
|
||||
LoadRelatedAttributes()
|
||||
End Sub
|
||||
Public Shared Function DeleteUserRelation(ID As Integer) As Boolean
|
||||
Public Function DeleteUserRelation(ID As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"DELETE FROM TBDD_USER_DOKTYPE WHERE GUID = {ID}"
|
||||
Return My.DatabaseECM.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports DevExpress.XtraGrid.Views.Base
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class frmAdmin_IDBBERelations
|
||||
Private GridCursorLocation As Point
|
||||
@@ -11,6 +12,8 @@ Public Class frmAdmin_IDBBERelations
|
||||
Private DraggedAttributeID
|
||||
Private DragDropManager As ClassDragDrop = Nothing
|
||||
Private downHitInfo As GridHitInfo = Nothing
|
||||
Private Logger As Logger
|
||||
|
||||
Private Function GetAvailableAttributesByBEID(beID As Integer) As DataTable
|
||||
Try
|
||||
Dim dt As DataTable
|
||||
@@ -41,6 +44,8 @@ Public Class frmAdmin_IDBBERelations
|
||||
|
||||
Private Sub frmAdmin_IDBBERelations_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
Logger = My.LogConfig.GetLogger()
|
||||
|
||||
Dim oSQL = "Select Guid As ID,TITLE As BusinessEntity from TBIDB_BUSINESS_ENTITY"
|
||||
Dim oDT As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
|
||||
GridControlBusinessEntities.DataSource = oDT
|
||||
@@ -88,12 +93,12 @@ Public Class frmAdmin_IDBBERelations
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error Adding AttrID:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Function AddAttr2BE(AttrId As Integer, BeId As Integer) As Boolean
|
||||
Public Function AddAttr2BE(AttrId As Integer, BeId As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
INSERT INTO TBIDB_BE_ATTRIBUTE (BE_ID,ATTR_ID,ADDED_WHO)
|
||||
@@ -101,16 +106,16 @@ Public Class frmAdmin_IDBBERelations
|
||||
"
|
||||
Return My.DatabaseIDB.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function DeleteAttrfromBE(ID As Integer) As Boolean
|
||||
Public Function DeleteAttrfromBE(ID As Integer) As Boolean
|
||||
Try
|
||||
Dim oSQL = $"DELETE FROM TBIDB_BE_ATTRIBUTE WHERE GUID = {ID}"
|
||||
Return My.DatabaseIDB.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class frmSQLDesigner
|
||||
Imports DigitalData.Modules.Database
|
||||
|
||||
Public Class frmSQLDesigner
|
||||
Dim CurrentPosition As Integer = 0
|
||||
Dim CurrentPlaceholders As New Placeholders()
|
||||
Dim CurrentTableType As String
|
||||
@@ -130,7 +132,7 @@
|
||||
MsgBox(cmbConnection.SelectedValue)
|
||||
Dim oconString = My.DatabaseECM.Get_ConnectionStringforID(cmbConnection.SelectedValue)
|
||||
MsgBox(oconString)
|
||||
Dim decryptedConString = My.DatabaseECM.DecryptConnectionString(oconString)
|
||||
Dim decryptedConString = MSSQLServer.DecryptConnectionString(oconString)
|
||||
MsgBox(decryptedConString)
|
||||
Dim oDT = My.DatabaseECM.GetDatatableWithConnection(query, decryptedConString)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user