MS ClassUpdate entfernt
This commit is contained in:
parent
fc87dc05a9
commit
5ae2d466d0
@ -1,8 +1,7 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
"",
|
||||
"\\app"
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\app\\DD-Record-Organizer.sln",
|
||||
"SelectedNode": "\\OrgFlow.sln",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
@ -174,9 +174,8 @@ Public Class ClassHelper
|
||||
RESULT_DOC_PATH = FORMAT_WM_PATH(RESULT_DOC_PATH)
|
||||
CURRENT_OFFICE_FILE_CHANGED = False
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If USER_GENERAL_VIEWER = "NONE" Then
|
||||
Dim EXT = Path.GetExtension(RESULT_DOC_PATH)
|
||||
EXT = EXT.Replace(".", "")
|
||||
Dim EXT = Path.GetExtension(RESULT_DOC_PATH)
|
||||
EXT = EXT.Replace(".", "")
|
||||
Dim sql = String.Format("SELECT VIEWER FROM TBPMO_DOC_USER_VIEW WHERE USER_ID = {0} AND FILE_EXTENSION = '{1}'", USER_GUID, EXT)
|
||||
Dim DT As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
If DT.Rows.Count = 1 Then
|
||||
@ -187,12 +186,6 @@ Public Class ClassHelper
|
||||
Else
|
||||
File_SYSOPEN(RESULT_DOC_PATH, DocID)
|
||||
End If
|
||||
Else
|
||||
Select Case USER_GENERAL_VIEWER
|
||||
Case "DOC-VIEW"
|
||||
OPEN_DOCVIEW(RESULT_DOC_PATH, DocID)
|
||||
End Select
|
||||
End If
|
||||
Return True
|
||||
Else
|
||||
MSGBOX_Handler("ERROR", "", "Sorry, but the docpath for doc-id: " & DocID & " is nothing!")
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports DD_LIB_Standards
|
||||
Imports DevExpress.DataAccess.Native
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
@ -22,7 +23,6 @@ Public Class ClassInit
|
||||
Dim oStartupPath = Application.StartupPath
|
||||
' If AppConfig from Startup Path should be forced, rewrite the common app data path
|
||||
If My.Settings.UseAppConfigConString = True Then
|
||||
' UserAppDataPath = StartupPath
|
||||
oCommonAppDataPath = oStartupPath
|
||||
End If
|
||||
|
||||
@ -183,7 +183,7 @@ Public Class ClassInit
|
||||
WMPATH_PREFIX = KONFIG_DT.Rows(0).Item("WMPATH_PREFIX")
|
||||
If Not WMPATH_PREFIX.ToUpper.StartsWith("\\WINDREAM\OBJECTS") Then
|
||||
SHARE_DRIVE_ACTIVE = True
|
||||
LOGGER.Info("WM SHARE_DRIVE via TBPMO_KONFIGURATION is active")
|
||||
LOGGER.Info($"WM SHARE_DRIVE [{WMPATH_PREFIX}] via TBPMO_KONFIGURATION is active")
|
||||
End If
|
||||
End If
|
||||
|
||||
@ -234,18 +234,18 @@ Public Class ClassInit
|
||||
|
||||
Public Shared Function InitUserLogin(Optional _User As String = "")
|
||||
Try
|
||||
|
||||
Dim oMODULE_ACCES As Boolean = False
|
||||
If _User = "" Then
|
||||
USER_USERNAME = Environment.UserName
|
||||
Else
|
||||
USER_USERNAME = _User
|
||||
End If
|
||||
|
||||
Dim sql = String.Format("SELECT T.*, T1.IS_ADMIN FROM TBDD_USER T INNER JOIN TBDD_USER_MODULES T1 ON T.GUID = T1.USER_ID INNER JOIN TBDD_MODULES T2 ON T1.MODULE_ID = T2.GUID
|
||||
WHERE (USERNAME = '{0}') AND T2.SHORT_NAME = 'ADDI'", USER_USERNAME)
|
||||
Dim oFNSQL = String.Format("SELECT * FROM [dbo].[FNDD_LOGIN_USER_MODULE] ('{0}','ORGFLOW',{1})", USER_USERNAME, CLIENT_SELECTED)
|
||||
Dim DT_CHECKUSER_MODULE As DataTable
|
||||
LOGGER.Info("Login at: " & Now.ToString)
|
||||
LOGGER.Info("Username: " & USER_USERNAME)
|
||||
Dim USER_DT As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
Dim USER_DT As DataTable = MYDB_ECM.GetDatatable(oFNSQL)
|
||||
If USER_DT.Rows.Count = 0 Then
|
||||
LOGGER.Warn(" - User '" & USER_USERNAME & "' not listed in Useradministration!")
|
||||
|
||||
@ -254,168 +254,186 @@ WHERE (USERNAME = '{0}') AND T2.SHORT_NAME = 'ADDI'", USER_USERNAME)
|
||||
ClassHelper.InsertEssential_Log(0, "USER-ID", String.Format("User '{0}' not listed in Userconfiguration", USER_USERNAME))
|
||||
Return False
|
||||
Else
|
||||
Dim Right_RO As Boolean = False
|
||||
USER_GUID = USER_DT.Rows(0).Item("GUID")
|
||||
USERID_FK_INT_ECM = USER_DT.Rows(0).Item("USERID_FK_INT_ECM")
|
||||
USER_WAN = USER_DT.Rows(0).Item("WAN_ENVIRONMENT")
|
||||
USER_LANGUAGE = USER_DT.Rows(0).Item("LANGUAGE")
|
||||
clsCURRENT.USER_LANGUAGE = USER_LANGUAGE
|
||||
USER_DATE_FORMAT = USER_DT.Rows(0).Item("DATE_FORMAT")
|
||||
USER_GENERAL_VIEWER = USER_DT.Rows(0).Item("GENERAL_VIEWER")
|
||||
Right_RO = True
|
||||
|
||||
USER_GUID = USER_DT.Rows(0).Item("USER_ID")
|
||||
Try
|
||||
If CBool(USER_DT.Rows(0).Item("PMO_READ_ONLY")) = True Then
|
||||
WM_READ_ONLY = True
|
||||
LOGGER.Info("WINDREAM IS CONFIGURED READ ONLY!!")
|
||||
End If
|
||||
USERID_FK_INT_ECM = USER_DT.Rows(0).Item("USERID_FK_INT_ECM")
|
||||
Catch ex As Exception
|
||||
|
||||
USERID_FK_INT_ECM = 0
|
||||
End Try
|
||||
USER_LANGUAGE = USER_DT.Rows(0).Item("USER_LANGUAGE")
|
||||
clsCURRENT.USER_LANGUAGE = USER_LANGUAGE
|
||||
USER_DATE_FORMAT = USER_DT.Rows(0).Item("USER_DATE_FORMAT")
|
||||
oMODULE_ACCES = USER_DT.Rows(0).Item("MODULE_ACCESS")
|
||||
Dim oWORKING_MODE = USER_DT.Rows(0).Item("WORKING_MODE")
|
||||
|
||||
Dim oSplitWorkMode As String() = oWORKING_MODE.Split("#")
|
||||
|
||||
If Right_RO = False Then
|
||||
LOGGER.Warn("User '" & USER_USERNAME & "' not authorized for using OrgFlow!")
|
||||
'MsgBox("Achtung: Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
Dim msg = String.Format("Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
' Use For Each loop over words and display them.
|
||||
Dim oMode As String
|
||||
For Each oMode In oSplitWorkMode
|
||||
LOGGER.Debug($"oWorkingMode Parameter: {oMode}")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("You are not authorized for using this module." & vbNewLine & "Please contact the admin.")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
Return False
|
||||
'Me.Close()
|
||||
Else
|
||||
sql = String.Format("select * from TBPMO_RIGHT_USER WHERE USER_ID = " & USER_GUID)
|
||||
CURRENT_TBPMO_RIGHT_USER = MYDB_ECM.GetDatatable(sql)
|
||||
|
||||
|
||||
Init_CONN_SWITCH()
|
||||
DT_CLIENT_USER = MYDB_ECM.GetDatatable("SELECT T.*, T1.LICENSE_PMO, T1.CLIENT_NAME FROM TBDD_CLIENT_USER T,TBDD_CLIENT T1 WHERE T.CLIENT_ID = T1.GUID AND T.USER_ID = " & USER_GUID)
|
||||
If DT_CLIENT_USER.Rows.Count > 1 Then
|
||||
frmClientLogin.ShowDialog()
|
||||
ElseIf DT_CLIENT_USER.Rows.Count = 1 Then
|
||||
CLIENT_SELECTED = DT_CLIENT_USER.Rows(0).Item("CLIENT_ID")
|
||||
End If
|
||||
If CLIENT_SELECTED = 99 Then
|
||||
Dim msg = String.Format("Die Mandantenanmeldung war nicht möglich." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The client-login was not possible." & vbNewLine & "Please contact the admin.")
|
||||
If oMode.StartsWith("WMMODE") Then
|
||||
WorkMode_WMMODE = oMode.Replace("WMMODE=", "")
|
||||
If WorkMode_WMMODE = "READ" Then
|
||||
WM_READ_ONLY = True
|
||||
LOGGER.Info("WINDREAM IS CONFIGURED READ ONLY FOR USER!")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
Return False
|
||||
End If
|
||||
|
||||
'Am System anmelden
|
||||
ClassLicence.Refresh_Licence(CLIENT_SELECTED)
|
||||
'Am System anmelden
|
||||
'sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 1, LOGGED_WHERE = '{0}' WHERE GUID = {1}", Environment.MachineName, USER_GUID)
|
||||
MYDB_ECM.ExecuteNonQuery(sql)
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND UPPER(MODULE)= UPPER('Record-Organizer')"
|
||||
If MYDB_ECM.ExecuteNonQuery(sql) = True Then
|
||||
|
||||
End If
|
||||
Dim ConStringMain As String
|
||||
If clsDatabase.DB_PROXY_INITIALIZED = True Then
|
||||
ConStringMain = "PROXY: " & ClassProxy.MyPROXYConnectionString & " # MAIN: " & MyConnectionString
|
||||
Else
|
||||
ConStringMain = "Main: " & MyConnectionString
|
||||
End If
|
||||
sql = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME,CONNECTION_STRING) VALUES ({0},{1},'Record-Organizer','{2}','{3}','{4}')", USER_GUID, CLIENT_SELECTED, My.Application.Info.Version.ToString, Environment.MachineName, ConStringMain)
|
||||
MYDB_ECM.ExecuteNonQuery(sql)
|
||||
|
||||
USER_IS_ADMIN = USER_DT.Rows(0).Item("IS_ADMIN") 'vorher RECORD_ADMIN
|
||||
If USER_IS_ADMIN = True Then
|
||||
If ESC_Hidden = True Then
|
||||
frmLoginUserSelect.ShowDialog()
|
||||
ESC_Hidden = False
|
||||
If USER_USERNAME <> "" Then
|
||||
InitUserLogin(USER_USERNAME)
|
||||
End If
|
||||
ElseIf oMode.StartsWith("WM_PRAEFIX") Then
|
||||
WMPATH_PREFIX = oMode.Replace("WM_PRAEFIX=", "")
|
||||
If Not WMPATH_PREFIX.ToUpper.StartsWith("\\WINDREAM\OBJECTS") Then
|
||||
SHARE_DRIVE_ACTIVE = True
|
||||
LOGGER.Info($"WM SHARE_DRIVE [{WMPATH_PREFIX}] via WORKING_MODE is active")
|
||||
End If
|
||||
Else
|
||||
|
||||
If oMode <> "0" Then
|
||||
LOGGER.Info($"Wrong oMode: {oMode}")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If SHARE_DRIVE_ACTIVE = True And Len(oWORKING_MODE) = 0 Then
|
||||
LOGGER.Info("WINDREAM IS CONFIGURED READ ONLY AS No Workmode was configured and Sharedrive is active!")
|
||||
WM_READ_ONLY = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If oMODULE_ACCES = False Then
|
||||
LOGGER.Warn("User '" & USER_USERNAME & "' not authorized for using OrgFlow!")
|
||||
'MsgBox("Achtung: Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
Dim msg = String.Format("Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("You are not authorized for using this module." & vbNewLine & "Please contact the admin.")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
Return False
|
||||
End If
|
||||
'Me.Close()
|
||||
|
||||
oFNSQL = String.Format("select * from TBPMO_RIGHT_USER WHERE USER_ID = " & USER_GUID)
|
||||
CURRENT_TBPMO_RIGHT_USER = MYDB_ECM.GetDatatable(oFNSQL)
|
||||
|
||||
|
||||
Init_CONN_SWITCH()
|
||||
DT_CLIENT_USER = MYDB_ECM.GetDatatable("SELECT T.*, T1.LICENSE_PMO, T1.CLIENT_NAME FROM TBDD_CLIENT_USER T,TBDD_CLIENT T1 WHERE T.CLIENT_ID = T1.GUID AND T.USER_ID = " & USER_GUID)
|
||||
If DT_CLIENT_USER.Rows.Count > 1 Then
|
||||
frmClientLogin.ShowDialog()
|
||||
ElseIf DT_CLIENT_USER.Rows.Count = 1 Then
|
||||
CLIENT_SELECTED = DT_CLIENT_USER.Rows(0).Item("CLIENT_ID")
|
||||
End If
|
||||
If CLIENT_SELECTED = 99 Then
|
||||
Dim msg = String.Format("Die Mandantenanmeldung war nicht möglich." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The client-login was not possible." & vbNewLine & "Please contact the admin.")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
Return False
|
||||
End If
|
||||
|
||||
'Am System anmelden
|
||||
ClassLicence.Refresh_Licence(CLIENT_SELECTED)
|
||||
'Am System anmelden
|
||||
'sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 1, LOGGED_WHERE = '{0}' WHERE GUID = {1}", Environment.MachineName, USER_GUID)
|
||||
MYDB_ECM.ExecuteNonQuery(oFNSQL)
|
||||
oFNSQL = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND UPPER(MODULE)= UPPER('Record-Organizer')"
|
||||
If MYDB_ECM.ExecuteNonQuery(oFNSQL) = True Then
|
||||
|
||||
End If
|
||||
Dim ConStringMain As String
|
||||
If clsDatabase.DB_PROXY_INITIALIZED = True Then
|
||||
ConStringMain = "PROXY: " & ClassProxy.MyPROXYConnectionString & " # MAIN: " & MyConnectionString
|
||||
Else
|
||||
ConStringMain = "Main: " & MyConnectionString
|
||||
End If
|
||||
oFNSQL = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME,CONNECTION_STRING) VALUES ({0},{1},'Record-Organizer','{2}','{3}','{4}')", USER_GUID, CLIENT_SELECTED, My.Application.Info.Version.ToString, Environment.MachineName, ConStringMain)
|
||||
MYDB_ECM.ExecuteNonQuery(oFNSQL)
|
||||
|
||||
USER_IS_ADMIN = USER_DT.Rows(0).Item("IS_ADMIN") 'vorher RECORD_ADMIN
|
||||
If USER_IS_ADMIN = True Then
|
||||
If ESC_Hidden = True Then
|
||||
frmLoginUserSelect.ShowDialog()
|
||||
ESC_Hidden = False
|
||||
If USER_USERNAME <> "" Then
|
||||
InitUserLogin(USER_USERNAME)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Try
|
||||
If WM_READ_ONLY = False Then
|
||||
Try
|
||||
If WM_READ_ONLY = True Then
|
||||
If SHARE_DRIVE_ACTIVE = True Then
|
||||
LOGGER.Info($"SHAREDRIVE IS ACTIVE = {SHARE_DRIVE_ACTIVE.ToString}")
|
||||
WM_READ_ONLY = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Try
|
||||
WMMOD = New DigitalData.Modules.Windream.Windream(LOGCONFIG, False, WMDriveLetter, WMPATH_PREFIX, True, "", "", "", "")
|
||||
If IsNothing(WMMOD) Then
|
||||
MsgBox("No windream connectable", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Could not create the login for DigitalData.Modules.Windream.Windream!")
|
||||
End Try
|
||||
|
||||
If clsWindream.Create_Session = False Then
|
||||
LOGGER.Warn("Could not create the login for windream - No session created!")
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "windream-login Error:", "Could not create the login/session!", "OrgFlow will start anyway but be aware that searching and importing won't be possible!")
|
||||
End If
|
||||
WMMOD = New DigitalData.Modules.Windream.Windream(LOGCONFIG, False, WMDriveLetter, WMPATH_PREFIX, True, "", "", "", "")
|
||||
If IsNothing(WMMOD) Then
|
||||
MsgBox("Could not connect to windream! Check Your configuration", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in clswindream.Init: " & ex.Message)
|
||||
MsgBox("Unexpected Error in Creating windream-Session: " & ex.Message & vbNewLine & "Please inform Your sysadmin!", MsgBoxStyle.Critical)
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Warn("Could not create the login for DigitalData.Modules.Windream.Windream! Setting WM_READ_ONLY = True")
|
||||
WM_READ_ONLY = True
|
||||
End Try
|
||||
|
||||
sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Record-Organizer') AND CLIENT_ID = {0}", CLIENT_SELECTED)
|
||||
Dim anzahl = MYDB_ECM.GetScalarValue(sql)
|
||||
USERS_LOGGED_IN = CInt(anzahl)
|
||||
LOGGER.Info("User# logged in: " & anzahl.ToString)
|
||||
LOGGER.Info("LICENSE_COUNT: " & LICENSE_COUNT.ToString)
|
||||
'####
|
||||
|
||||
If LICENSE_COUNT <= (USERS_LOGGED_IN + 1) And LICENSE_EXPIRED = False Then
|
||||
Dim msg = String.Format("Die Anzahl der aktuell angemeldeten User (" & USERS_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses." & vbNewLine &
|
||||
"Number of licenses: " & LICENSE_COUNT.ToString & vbNewLine & "Please contact Your admin!")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
LOGGER.Warn("The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ")
|
||||
If USER_IS_ADMIN = False Then
|
||||
'Anmeldung wieder herausnehmen
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Record-Organizer'"
|
||||
MYDB_ECM.ExecuteNonQuery(sql)
|
||||
LOGGER.Warn(" - logged out the user")
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Try
|
||||
'Die FolderWatch starten
|
||||
Dim sql1 = "SELECT FOLDER_PATH FROM TBPMO_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & USER_GUID
|
||||
Dim folderwatch_SCAN = MYDB_ECM.GetScalarValue(sql1)
|
||||
|
||||
If Not folderwatch_SCAN Is Nothing Then
|
||||
CURRENT_SCAN_FOLDERWATCH = folderwatch_SCAN
|
||||
If FWSCAN_started = True Then
|
||||
ClassFolderWatcher.StartStop_FolderWatchSCAN()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in Init_Folderwatch: " & ex.Message, True)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
If clsWindream.Create_Session = False Then
|
||||
LOGGER.Warn("Could not create the login for windream - No session created!")
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "windream-login Error:", "Could not create the login/session!", "OrgFlow will start anyway but be aware that searching and importing won't be possible!")
|
||||
End If
|
||||
If LICENSE_PROXY = True And clsDatabase.DB_PROXY_INITIALIZED Then
|
||||
SQL_FULLTEXT = "SELECT DISTINCT [dwDocID] FROM [dbo].FullText WHERE CONTAINS([Text], '""*@FULLTEXT*""') "
|
||||
End If
|
||||
Dim oSQL = $"SELECT COUNT(GU.GUID) FROM TBDD_GROUPS_USER GU INNER JOIN TBDD_GROUPS G ON GU.GROUP_ID = G.GUID WHERE G.NAME = 'ORGFLOW-Supervisor' AND GU.USER_ID = {USER_GUID}"
|
||||
USER_IS_SUPERVISOR = MYDB_ECM.GetScalarValue(oSQL)
|
||||
Return True
|
||||
'LabelLoggedIn.Caption = "Anzahl Angemeldete User: " & anzahl.ToString
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in clswindream.Init: " & ex.Message)
|
||||
MsgBox("Unexpected Error in Creating windream-Session: " & ex.Message & vbNewLine & "Please inform Your sysadmin!", MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
oFNSQL = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Record-Organizer') AND CLIENT_ID = {0}", CLIENT_SELECTED)
|
||||
Dim anzahl = MYDB_ECM.GetScalarValue(oFNSQL)
|
||||
USERS_LOGGED_IN = CInt(anzahl)
|
||||
LOGGER.Info("User# logged in: " & anzahl.ToString)
|
||||
LOGGER.Info("LICENSE_COUNT: " & LICENSE_COUNT.ToString)
|
||||
'####
|
||||
|
||||
If LICENSE_COUNT <= (USERS_LOGGED_IN + 1) And LICENSE_EXPIRED = False Then
|
||||
Dim msg = String.Format("Die Anzahl der aktuell angemeldeten User (" & USERS_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses." & vbNewLine &
|
||||
"Number of licenses: " & LICENSE_COUNT.ToString & vbNewLine & "Please contact Your admin!")
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
LOGGER.Warn("The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ")
|
||||
If USER_IS_ADMIN = False Then
|
||||
'Anmeldung wieder herausnehmen
|
||||
oFNSQL = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Record-Organizer'"
|
||||
MYDB_ECM.ExecuteNonQuery(oFNSQL)
|
||||
LOGGER.Warn(" - logged out the user")
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Try
|
||||
'Die FolderWatch starten
|
||||
Dim sql1 = "SELECT FOLDER_PATH FROM TBPMO_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & USER_GUID
|
||||
Dim folderwatch_SCAN = MYDB_ECM.GetScalarValue(sql1)
|
||||
|
||||
If Not folderwatch_SCAN Is Nothing Then
|
||||
CURRENT_SCAN_FOLDERWATCH = folderwatch_SCAN
|
||||
If FWSCAN_started = True Then
|
||||
ClassFolderWatcher.StartStop_FolderWatchSCAN()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in Init_Folderwatch: " & ex.Message, True)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End If
|
||||
If LICENSE_PROXY = True And clsDatabase.DB_PROXY_INITIALIZED Then
|
||||
SQL_FULLTEXT = "SELECT DISTINCT [dwDocID] FROM [dbo].FullText WHERE CONTAINS([Text], '""*@FULLTEXT*""') "
|
||||
End If
|
||||
Dim oSQL = $"SELECT COUNT(GU.GUID) FROM TBDD_GROUPS_USER GU INNER JOIN TBDD_GROUPS G ON GU.GROUP_ID = G.GUID WHERE G.NAME = 'ORGFLOW-Supervisor' AND GU.USER_ID = {USER_GUID}"
|
||||
USER_IS_SUPERVISOR = MYDB_ECM.GetScalarValue(oSQL)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Warn("Unexpected Error in InitUserLogin: " & ex.Message)
|
||||
|
||||
@ -1,378 +0,0 @@
|
||||
Imports System.IO
|
||||
Public Class ClassUpdate
|
||||
Public Shared MyServer_UpdatePath As String
|
||||
|
||||
Public Shared VERSION_SERVER = "1.0.0.0"
|
||||
Public Shared VERSION_USER = "1.0.0.0"
|
||||
Public Shared FORCE_UPDATE As Boolean = False
|
||||
Public Shared UPDATE_ID As Integer
|
||||
Public Shared ALL_USERS As Boolean = False
|
||||
Public Shared VERSIONS_FOR_FORCE_UPDATE As String = ""
|
||||
Public Shared FOLDER_TEMP As String
|
||||
|
||||
Public Shared MY_INSTALL_PATH As String
|
||||
Public Shared DT_UPDATE_ITEMS As DataTable
|
||||
Public Shared DT_UPDATE As DataTable
|
||||
Public Shared ERROR_WHILE_UPDATING As Boolean = False
|
||||
|
||||
Public Shared UPDATE_NECESSARY As Boolean = False
|
||||
Public Shared UPDATE_CANCELLED As Boolean = False
|
||||
Public Shared UPDATE_ERROR As Boolean = False
|
||||
|
||||
Private Shared RecExe_found As Boolean = False
|
||||
Public Shared DT_USER_DATA As DataTable
|
||||
Private Shared USER_INFO1, USER_INFO2, USER_INFO3 As String
|
||||
Public Shared Function Init()
|
||||
Try
|
||||
Dim sql = String.Format("SELECT * FROM TBDD_MODULES WHERE UPPER(NAME) = UPPER('Record-Organizer')")
|
||||
Dim KONFIG_DT As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
If KONFIG_DT.Rows.Count = 1 Then
|
||||
MyServer_UpdatePath = KONFIG_DT.Rows(0).Item("VERSION_UPATE_PATH")
|
||||
MIN_REQUIRED_VERSION = KONFIG_DT.Rows(0).Item("MIN_REQUIRED_VERSION")
|
||||
Try
|
||||
DBVERSION = KONFIG_DT.Rows(0).Item("DB_VERSION")
|
||||
Catch ex As Exception
|
||||
DBVERSION = "No DB Version-Config"
|
||||
End Try
|
||||
End If
|
||||
sql = String.Format("Select * FROM TBDD_VERSION_UPDATE WHERE GUID = (Select MAX(GUID) FROM TBDD_VERSION_UPDATE WHERE UPPER(MODULE_NAME) = UPPER('{0}'))", "Record-Organizer")
|
||||
DT_UPDATE = MYDB_ECM.GetDatatable(sql)
|
||||
If Not IsNothing(DT_UPDATE) Then
|
||||
If DT_UPDATE.Rows.Count = 1 Then
|
||||
UPDATE_ID = DT_UPDATE.Rows(0).Item("GUID")
|
||||
VERSION_SERVER = DT_UPDATE.Rows(0).Item("VERSION_NO")
|
||||
FORCE_UPDATE = DT_UPDATE.Rows(0).Item("FORCE_UPD")
|
||||
VERSIONS_FOR_FORCE_UPDATE = DT_UPDATE.Rows(0).Item("VERSION_FORCE_UPD")
|
||||
ALL_USERS = DT_UPDATE.Rows(0).Item("ALL_USERS")
|
||||
sql = String.Format("SELECT * FROM TBDD_VERSION_ITEMS WHERE UPDATE_ID = {0} AND [INFO1] IS NOT NULL ORDER BY GUID", UPDATE_ID)
|
||||
DT_UPDATE_ITEMS = MYDB_ECM.GetDatatable(sql)
|
||||
LOGGER.Info(String.Format("{0} items need to be updated!", DT_UPDATE_ITEMS.Rows.Count.ToString))
|
||||
Else
|
||||
LOGGER.Info("No Updates Configured!")
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in ClassUpdate - Init: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Shared Function InitInstallPath()
|
||||
Try
|
||||
Dim readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Digital Data\Record Organizer", "Path", Nothing)
|
||||
If Not IsNothing(readValue) Then
|
||||
MY_INSTALL_PATH = readValue
|
||||
Return True
|
||||
Else
|
||||
MY_INSTALL_PATH = ""
|
||||
For Each s In Directory.GetLogicalDrives()
|
||||
If RecExe_found = False Then
|
||||
DirSearch(s)
|
||||
End If
|
||||
Next
|
||||
If RecExe_found = False Then
|
||||
LOGGER.Warn("Could not find the path for RecordOrganizer")
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in InitInstallPath: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Shared Sub DirSearch(ByVal sDir As String)
|
||||
Dim d As String
|
||||
Dim f As String
|
||||
Try
|
||||
For Each d In Directory.GetDirectories(sDir)
|
||||
If d.Contains("$Recycle") = False Or d.Contains("System Volume") = False Then
|
||||
If RecExe_found = False Then
|
||||
For Each f In Directory.GetFiles(d, "DD-OrgFlow.exe")
|
||||
RecExe_found = True
|
||||
MY_INSTALL_PATH = Path.GetDirectoryName(f)
|
||||
Exit Sub
|
||||
Next
|
||||
End If
|
||||
If RecExe_found = False Then
|
||||
DirSearch(d)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Catch excpt As System.Exception
|
||||
LOGGER.Warn("Unexpected Error in DirSearch: " & excpt.Message)
|
||||
MY_INSTALL_PATH = ""
|
||||
End Try
|
||||
End Sub
|
||||
Public Shared Function InitUser(Optional _User As String = "")
|
||||
Try
|
||||
Dim sql = ""
|
||||
USER_USERNAME = Environment.UserName
|
||||
sql = String.Format("SELECT * FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('{0}'))", USER_USERNAME)
|
||||
Dim USER_DT As DataTable = MYDB_ECM.GetDatatable(sql)
|
||||
If USER_DT.Rows.Count = 0 Then
|
||||
LOGGER.Warn(" - User '" & USER_USERNAME & "' not listed in Useradministration!")
|
||||
'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
'Me.Close()
|
||||
Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.")
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation)
|
||||
Return False
|
||||
Else
|
||||
USER_GUID = USER_DT.Rows(0).Item("GUID")
|
||||
USER_LANGUAGE = USER_DT.Rows(0).Item("LANGUAGE")
|
||||
sql = String.Format("SELECT UPDATE_PATH,TEMPPATH,INFO1,INFO2,INFO3 FROM TBDD_VERSION_USER_UPDATE_PATH WHERE USER_ID = {0} AND UPPER(MODULE_NAME) = UPPER('{1}')", USER_GUID, "Record-Organizer")
|
||||
DT_USER_DATA = MYDB_ECM.GetDatatable(sql)
|
||||
MyServer_UpdatePath = DT_USER_DATA.Rows(0).Item("UPDATE_PATH")
|
||||
|
||||
sql = String.Format("SELECT CASE VERSION_CLIENT WHEN '' THEN '{3}' ELSE VERSION_CLIENT END AS VERSION_CLIENT FROM VWDD_LOGIN_USER_HISTORY WHERE GUID = (select MAX(GUID) from VWDD_LOGIN_USER_HISTORY where USER_ID = {0} AND VERSION_CLIENT <> '' AND UPPER(MACHINE_NAME) = UPPER('{1}') AND UPPER(MODULE) = UPPER('{2}'))", USER_GUID, Environment.MachineName, "Record-Organizer", VERSION_SERVER)
|
||||
VERSION_USER = MYDB_ECM.GetScalarValue(sql)
|
||||
If IsNothing(VERSION_USER) Then
|
||||
sql = String.Format("SELECT CASE VERSION_CLIENT WHEN '' THEN '{2}' ELSE VERSION_CLIENT END AS VERSION_CLIENT FROM VWDD_LOGIN_USER_HISTORY WHERE GUID = (select MAX(GUID) from VWDD_LOGIN_USER_HISTORY where USER_ID = {0} AND VERSION_CLIENT <> '' AND UPPER(MODULE) = UPPER('{1}'))", USER_GUID, "Record-Organizer", VERSION_SERVER)
|
||||
VERSION_USER = MYDB_ECM.GetScalarValue(sql)
|
||||
If IsNothing(VERSION_USER) Then
|
||||
VERSION_USER = "1.0.0.0"
|
||||
End If
|
||||
End If
|
||||
VERSION_USER = CInt(VERSION_USER.ToString.Replace(".", ""))
|
||||
VERSION_SERVER = CInt(VERSION_SERVER.ToString.Replace(".", ""))
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Unexpected Error in InitUser_Update_Spec: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Shared Sub RUN_UPDATE()
|
||||
Dim UPD_VC As Boolean = False
|
||||
Dim UPD_RM As Boolean = False
|
||||
Dim KEEP_TEMPPATH As Boolean = False
|
||||
If DT_USER_DATA.Rows.Count <> 1 Then
|
||||
Exit Sub
|
||||
Else
|
||||
USER_INFO1 = DT_USER_DATA.Rows(0).Item("INFO1")
|
||||
USER_INFO2 = DT_USER_DATA.Rows(0).Item("INFO2")
|
||||
USER_INFO3 = DT_USER_DATA.Rows(0).Item("INFO3")
|
||||
|
||||
If DT_USER_DATA.Rows(0).Item("TEMPPATH") <> "" Then
|
||||
FOLDER_TEMP = DT_USER_DATA.Rows(0).Item("TEMPPATH")
|
||||
Else
|
||||
For Each Upd_item As DataRow In DT_UPDATE_ITEMS.Rows
|
||||
If Upd_item.Item("ITEM_INFO") = "VERSION_CHECKER.exe" Then
|
||||
If Not USER_INFO1.Contains(Upd_item.Item("INFO2")) Then
|
||||
UPD_VC = True
|
||||
|
||||
End If
|
||||
ElseIf Upd_item.Item("ITEM_INFO") = "RecordOrganizer_RightManager.exe" Then
|
||||
If Not USER_INFO1.Contains(Upd_item.Item("INFO2")) Then
|
||||
UPD_RM = True
|
||||
End If
|
||||
End If
|
||||
If Not IsDBNull(Upd_item.Item("INFO3")) Then
|
||||
FOLDER_TEMP = Upd_item.Item("INFO3")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If UPD_VC = True Or UPD_RM = True Then
|
||||
UPDATE_NECESSARY = True
|
||||
End If
|
||||
|
||||
If UPDATE_NECESSARY = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim msg = "Auf dem Server liegt ein Update für ein OrgFlow-AddOn bereit!" & vbNewLine & "Wollen Sie das Update nun durchführen? Die Dauer ist abhängig von Ihrer Netzwerkverbindung!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "There is a new release available for an OrgFlow-AddOn!" & vbNewLine & "Would You like to install the update now? This might take some time minute(s)!"
|
||||
End If
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.No Then
|
||||
UPDATE_CANCELLED = True
|
||||
Exit Sub
|
||||
End If
|
||||
'End If
|
||||
|
||||
If FOLDER_TEMP <> String.Empty Then
|
||||
If Directory.Exists(FOLDER_TEMP) Then
|
||||
' GetTempFolderGuid()
|
||||
' If FOLDER_TEMP <> String.Empty Then
|
||||
|
||||
Dim error_while_copying = False
|
||||
For Each Upd_item As DataRow In DT_UPDATE_ITEMS.Rows
|
||||
LOGGER.Info(String.Format("...working on item {0}: ", Upd_item.Item("ITEM_INFO")))
|
||||
|
||||
If Upd_item.Item("ITEM_INFO") = "VERSION_CHECKER.exe" Then
|
||||
KEEP_TEMPPATH = Upd_item.Item("BIT3")
|
||||
End If
|
||||
|
||||
If error_while_copying = True Then
|
||||
Exit For
|
||||
End If
|
||||
Dim tempfilename = Path.Combine(FOLDER_TEMP, Upd_item.Item("ITEM_INFO"))
|
||||
If File.Exists(tempfilename) Then
|
||||
Try
|
||||
Dim error_while_replacing = False
|
||||
|
||||
Dim BackUpOfFileToReplace As String = MY_INSTALL_PATH & "\" & Upd_item.Item("INFO1") & Upd_item.Item("ITEM_INFO") & ".bac"
|
||||
BackUpOfFileToReplace = BackUpOfFileToReplace.Replace("//", "/")
|
||||
|
||||
Dim sourcefile = Path.Combine(FOLDER_TEMP, Upd_item.Item("ITEM_INFO"))
|
||||
Dim targetfile
|
||||
If IsDBNull(Upd_item.Item("INFO1")) Then
|
||||
targetfile = Path.Combine(MY_INSTALL_PATH, Upd_item.Item("ITEM_INFO"))
|
||||
Else
|
||||
If Upd_item.Item("INFO1") <> String.Empty Then
|
||||
targetfile = Path.Combine(MY_INSTALL_PATH, Upd_item.Item("INFO1"), Upd_item.Item("ITEM_INFO"))
|
||||
Else
|
||||
targetfile = Path.Combine(MY_INSTALL_PATH, Upd_item.Item("ITEM_INFO"))
|
||||
End If
|
||||
End If
|
||||
targetfile = targetfile.ToString.Replace("//", "/")
|
||||
LOGGER.Info(String.Format("...replacing targetfile '{0}': ", targetfile))
|
||||
Try
|
||||
' Replace the file.
|
||||
If File.Exists(targetfile) Then
|
||||
If File_Rename(targetfile, BackUpOfFileToReplace) = True Then
|
||||
If File.Exists(BackUpOfFileToReplace) Then
|
||||
If KEEP_TEMPPATH Then
|
||||
If CopyFile(sourcefile, targetfile) = True Then
|
||||
File_Delete(BackUpOfFileToReplace)
|
||||
LOGGER.Warn(String.Format("...targetfile '{0}' was copied! ", targetfile))
|
||||
Dim updinfo
|
||||
If USER_INFO1 <> "" Then
|
||||
updinfo = USER_INFO1 & ";" & Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
Else
|
||||
updinfo = Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
End If
|
||||
Dim _Sql = String.Format("Update TBDD_VERSION_USER_UPDATE_PATH SET INFO1 = '{2}' WHERE USER_ID = {0} AND UPPER(MODULE_NAME) = UPPER('{1}')", USER_GUID, "Record-Organizer", updinfo)
|
||||
MYDB_ECM.ExecuteNonQuery(_Sql)
|
||||
End If
|
||||
Else
|
||||
If MoveFile(sourcefile, targetfile) = True Then
|
||||
File_Delete(BackUpOfFileToReplace)
|
||||
LOGGER.Info(String.Format("...targetfile '{0}' was replaced! ", targetfile))
|
||||
Dim updinfo
|
||||
If USER_INFO1 <> "" Then
|
||||
updinfo = USER_INFO1 & ";" & Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
Else
|
||||
updinfo = Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
End If
|
||||
Dim _Sql = String.Format("Update TBDD_VERSION_USER_UPDATE_PATH SET INFO1 = '{2}' WHERE USER_ID = {0} AND UPPER(MODULE_NAME) = UPPER('{1}')", USER_GUID, "Record-Organizer", updinfo)
|
||||
MYDB_ECM.ExecuteNonQuery(_Sql)
|
||||
Else
|
||||
LOGGER.Warn(String.Format("MoveFile was not successfull! BackupFile will be activated!"))
|
||||
'Verschieben hat nicht geklappt also die Backupdatei wieder umbenennen!
|
||||
File_Rename(BackUpOfFileToReplace, targetfile)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Error while copying file {0} to {1}: " & ex.Message, sourcefile, targetfile))
|
||||
error_while_replacing = True
|
||||
UPDATE_ERROR = True
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Unexpected Error in Replace_Files: {0}", ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
End Try
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Dim upd = String.Format("Update TBDD_VERSION_USER_UPDATE_PATH SET TEMPPATH = '' WHERE USER_ID = {0} AND UPPER(MODULE_NAME) = UPPER('{1}')", USER_GUID, "Record-Organizer")
|
||||
MYDB_ECM.ExecuteNonQuery(upd)
|
||||
Try
|
||||
If KEEP_TEMPPATH = False Then
|
||||
'Delete the tempfolder and all data
|
||||
System.IO.Directory.Delete(FOLDER_TEMP, True)
|
||||
Else
|
||||
LOGGER.Info(String.Format("TEMP FOLDER SHALL BE KEPT..."))
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
'Else
|
||||
' Logger.Warn(String.Format("The temporaryFolder could not be created!"))
|
||||
'End If
|
||||
Else
|
||||
LOGGER.Warn(String.Format("The Updatepath '{0}'is not accessible or does not exist", MyServer_UpdatePath))
|
||||
End If
|
||||
Else
|
||||
LOGGER.Warn(String.Format("NO ACTION: the Updatepath is empty"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Shared Function GetTempFolderGuid() As String
|
||||
Try
|
||||
Dim folder As String = Path.Combine(Path.GetTempPath, Guid.NewGuid.ToString)
|
||||
If Not Directory.Exists(folder) Then
|
||||
Directory.CreateDirectory(folder)
|
||||
End If
|
||||
FOLDER_TEMP = folder
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Error while Creating tempfolder: " & ex.Message))
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Private Shared Function File_Rename(targetfile As String, Renamefilestring As String)
|
||||
Try
|
||||
Renamefilestring = Renamefilestring.Replace("\\", "\")
|
||||
If File.Exists(Renamefilestring) Then
|
||||
|
||||
If File_Delete(Renamefilestring) = False Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Rename(targetfile, Renamefilestring)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("ClassUpdate - Unexpected Error in File_Rename: " & "OldPath '{0}'" & "NewPath '{1}'" & "ERROR: {2}", targetfile, Renamefilestring, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Shared Function File_Delete(deletefile As String)
|
||||
Try
|
||||
File.Delete(deletefile)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Unexpected Error in File_Delete: " & vbNewLine & "deletefile '{0}'" & vbNewLine & "ERROR: {2}", deletefile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Shared Function MoveFile(sourcefile As String, targetfile As String)
|
||||
Try
|
||||
File.Move(sourcefile, targetfile)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Unexpected Error in MoveFile: sourcefile '{0}', targetfile '{1}' - ERROR: {2}", sourcefile, targetfile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Shared Function CopyFile(sourcefile As String, destfile As String)
|
||||
Try
|
||||
File.Copy(sourcefile, destfile, True)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn(String.Format("Unexpected Error in CopyFile: sourcefile '{0}', destfile '{1}' - ERROR: {2}", sourcefile, destfile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
@ -20,9 +20,10 @@ Module ModuleMySettings
|
||||
Public WD_GROUP1 As String
|
||||
Public WD_UNICODE As Boolean = False
|
||||
Public WMDriveLetter As String
|
||||
Public WMPATH_PREFIX As String
|
||||
Public WMPATH_PREFIX As String = ""
|
||||
Public WMMOD As Windream
|
||||
Public SHARE_DRIVE_ACTIVE As Boolean = False
|
||||
Public WorkMode_WMMODE As String = "NORMAL"
|
||||
Public WM_READ_ONLY As Boolean = False
|
||||
Public GridDocResult_BestFitColumns As Boolean = True
|
||||
Public SQL_FULLTEXT As String
|
||||
@ -50,12 +51,12 @@ Module ModuleMySettings
|
||||
Public USERID_FK_INT_ECM = 0
|
||||
Public USER_LANGUAGE As String = "de-DE"
|
||||
Public USER_DATE_FORMAT As String
|
||||
Public USER_GENERAL_VIEWER As String
|
||||
Public USER_WAN As Boolean = False
|
||||
|
||||
|
||||
Public DT_CLIENT_USER As DataTable
|
||||
Public CLIENT_SELECTED As Integer = 99
|
||||
|
||||
|
||||
'Public USER_CLIENTS_COMMA_SEPERATED As String
|
||||
Public FWSCAN_started As Boolean = False
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ Module ModuleRuntimeVariables
|
||||
|
||||
Public ESC_Hidden As Boolean = False
|
||||
|
||||
Public MIN_REQUIRED_VERSION As String
|
||||
Public MIN_REQUIRED_VERSION As String = "1.0.0.0"
|
||||
|
||||
Public MAIN_FORM As frmMain = Nothing
|
||||
Public ERROR_INIT = "NONE"
|
||||
|
||||
@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.0.2")>
|
||||
<Assembly: AssemblyVersion("3.1.0.3")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
|
||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||
@ -2815,9 +2815,6 @@ Public Class frmConstructor_Main
|
||||
|
||||
CURRENT_SQL_AUTO_VALUES_DT = DT_AUTOVALUES
|
||||
|
||||
If USER_WAN = True Then
|
||||
|
||||
End If
|
||||
Try
|
||||
Dim primaryKey(1) As DataColumn
|
||||
primaryKey(0) = CURRENT_DT_ENTITY_RECORDS.Columns("Record-ID")
|
||||
|
||||
@ -594,53 +594,6 @@ Public Class frmMain
|
||||
Me.BarButtonItemSAPConnect.Enabled = True
|
||||
End If
|
||||
End If
|
||||
Try
|
||||
If ClassUpdate.Init = True And Not IsNothing(ClassUpdate.DT_UPDATE_ITEMS) Then
|
||||
'MsgBox("532")
|
||||
If Not IsNothing(ClassUpdate.DT_UPDATE) Then
|
||||
|
||||
If ClassUpdate.DT_UPDATE_ITEMS.Rows.Count > 0 Then
|
||||
If ClassUpdate.InitUser = False Then
|
||||
Me.Cursor = Cursors.Default
|
||||
Exit Sub
|
||||
Else
|
||||
If ClassUpdate.DT_USER_DATA.Rows.Count = 1 Or ClassUpdate.ALL_USERS = True Then
|
||||
If ClassUpdate.InitInstallPath() = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
ClassUpdate.RUN_UPDATE()
|
||||
If ClassUpdate.UPDATE_ERROR = True Then
|
||||
Dim msg = String.Format("Während des Updatevorgangs für Version '{0}' haben sich unerwartet Fehler ereignet!" & vbNewLine & "Wollen Sie die Logdatei anzeigen?", ClassUpdate.VERSION_SERVER)
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("During update of version '{0}' unexpected errors occured!" & vbNewLine & "Would You like to show the logfile?", ClassUpdate.VERSION_SERVER)
|
||||
End If
|
||||
ClassHelper.InsertEssential_Log(USER_GUID, "USER-ID", String.Format("Unexpected errors occured during client-update update of version {0}!", ClassUpdate.VERSION_SERVER))
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show(msg, CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Process.Start(LOGCONFIG.LogFile)
|
||||
End If
|
||||
Else
|
||||
If ClassUpdate.UPDATE_NECESSARY Then
|
||||
Dim msg = "Das Addon-Update war erfolgreich!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "The Addon-Update was successful!"
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Update VersionChecker: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
Else
|
||||
MsgBox("Application will close now!", MsgBoxStyle.Critical)
|
||||
Me.Close()
|
||||
|
||||
@ -754,9 +754,6 @@ LOGGER.Error(ex)
|
||||
|
||||
CURRENT_SQL_AUTO_VALUES_DT = DT_AUTOVALUES
|
||||
|
||||
If USER_WAN = True Then
|
||||
|
||||
End If
|
||||
Try
|
||||
Dim primaryKey(1) As DataColumn
|
||||
primaryKey(0) = CURRENT_DT_ENTITY_RECORDS.Columns("Record-ID")
|
||||
@ -1636,7 +1633,10 @@ LOGGER.Error(ex)
|
||||
End Sub
|
||||
Private Sub OnCBSelectedValueChanged(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
|
||||
Dim docId As Integer = oDocuments.First.DocId
|
||||
If docId = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
@ -1662,13 +1662,14 @@ LOGGER.Error(ex)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in OnCBSelectedValueChanged: ", ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub OnDateSelectedValueChanged(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
Dim DatePicker As DateEdit = sender
|
||||
Dim value As DateTime = DatePicker.EditValue
|
||||
|
||||
@ -1678,7 +1679,7 @@ LOGGER.Error(ex)
|
||||
Try
|
||||
validDate = Date.TryParse(DatePicker.OldEditValue, oldValue)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
oldValue = Date.MinValue
|
||||
End Try
|
||||
|
||||
@ -1697,7 +1698,7 @@ LOGGER.Error(ex)
|
||||
Dim detailRow As DataRowView = detailView.GetRow(detailView.FocusedRowHandle)
|
||||
Dim configid = detailRow.Item("CONFIG_ID")
|
||||
|
||||
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
Dim docId As Integer = oDocuments.First.DocId
|
||||
If docId = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
@ -1712,13 +1713,14 @@ LOGGER.Error(ex)
|
||||
ClassProxy.PRPROXY_DOC_VALUES_UPD(docId, SELECTED_NODE_RECORD_ID)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in OnDateSelectedValueChanged: ", ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub OnTextSelectedValueChanged(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
Dim TextBox As TextEdit = sender
|
||||
Dim value = TextBox.EditValue
|
||||
If value.ToUpper = "Not displayable in Group-Search".ToUpper Then
|
||||
@ -1733,7 +1735,7 @@ LOGGER.Error(ex)
|
||||
Dim detailRow As DataRowView = detailView.GetRow(detailView.FocusedRowHandle)
|
||||
Dim configid = detailRow.Item("CONFIG_ID")
|
||||
|
||||
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
Dim docId As Integer = oDocuments.First.DocId
|
||||
If docId = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
@ -1747,7 +1749,7 @@ LOGGER.Error(ex)
|
||||
ClassProxy.PRPROXY_DOC_VALUES_UPD(docId, SELECTED_NODE_RECORD_ID)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in OnTextSelectedValueChanged: ", ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
@ -1755,6 +1757,7 @@ LOGGER.Error(ex)
|
||||
Private Sub OnCheckboxValueChanged(sender As Object, e As EventArgs)
|
||||
'TODO Save Checkboxvalue
|
||||
Try
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
Dim CheckBox As CheckEdit = sender
|
||||
Dim value As Boolean = CheckBox.EditValue
|
||||
|
||||
@ -1764,7 +1767,7 @@ LOGGER.Error(ex)
|
||||
Dim detailRow As DataRowView = detailView.GetRow(detailView.FocusedRowHandle)
|
||||
Dim configid = detailRow.Item("CONFIG_ID")
|
||||
|
||||
Dim docId As Integer = ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
Dim docId As Integer = oDocuments.First.DocId
|
||||
If docId = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
@ -1778,7 +1781,7 @@ LOGGER.Error(ex)
|
||||
ClassProxy.PRPROXY_DOC_VALUES_UPD(docId, SELECTED_NODE_RECORD_ID)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in OnCheckboxValueChanged: ", ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
@ -1805,11 +1808,10 @@ LOGGER.Error(ex)
|
||||
Refresh_DocID()
|
||||
End Sub
|
||||
Sub Refresh_DocID()
|
||||
If ClassWindreamDocGrid.SELECTED_DOC_ID <> 0 Then
|
||||
Dim omsg = "Doc-ID: " & ClassWindreamDocGrid.SELECTED_DOC_ID.ToString
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
If oDocuments.Count <> 0 Then
|
||||
Dim omsg = "Doc-ID: " & oDocuments.First.DocId
|
||||
Update_DocID_Label(True, omsg, EditState.Update)
|
||||
|
||||
|
||||
Else
|
||||
Update_DocID_Label(True, "DocRow not selected", EditState.None)
|
||||
End If
|
||||
@ -1890,7 +1892,11 @@ LOGGER.Error(ex)
|
||||
#Region "Dropping Files"
|
||||
Sub Drag_Enter(e As DragEventArgs)
|
||||
If _EntityId <> 0 Then
|
||||
ClassDragDrop.Drag_enter(e)
|
||||
If WM_READ_ONLY = False Then
|
||||
ClassDragDrop.Drag_enter(e)
|
||||
Else
|
||||
Update_Status_Label(True, "READ ONLY ACCESS", EditState.Insert)
|
||||
End If
|
||||
Else
|
||||
Update_Status_Label(True, "No entity selected", EditState.Insert)
|
||||
End If
|
||||
@ -2229,41 +2235,46 @@ LOGGER.Error(ex)
|
||||
ContextMenu_Multiplefiles()
|
||||
ElseIf oSelectedDocs.Count = 1 Then
|
||||
File_in_Work()
|
||||
Dim oSelectedDocument = oSelectedDocs.First
|
||||
Dim Result = ClassDOC_SEARCH.Get_File_Rights(oSelectedDocument.DocId)
|
||||
If Not IsNothing(Result) Then
|
||||
_RowReadOnly = False
|
||||
Select Case Result.ToString
|
||||
Case "R"
|
||||
ContextMenu_Read()
|
||||
Case "RW"
|
||||
ContextMenu_Write()
|
||||
Case "RWA"
|
||||
ContextMenu_Write()
|
||||
Case ""
|
||||
If WM_READ_ONLY Then
|
||||
ContextMenu_Read()
|
||||
Else
|
||||
Dim oSelectedDocument = oSelectedDocs.First
|
||||
Dim Result = ClassDOC_SEARCH.Get_File_Rights(oSelectedDocument.DocId)
|
||||
If Not IsNothing(Result) Then
|
||||
_RowReadOnly = False
|
||||
Select Case Result.ToString
|
||||
Case "R"
|
||||
ContextMenu_Read()
|
||||
Case "RW"
|
||||
ContextMenu_Write()
|
||||
Case "RWA"
|
||||
ContextMenu_Write()
|
||||
Case ""
|
||||
If USER_IS_ADMIN = False Then
|
||||
ContextMenu_Read()
|
||||
Else
|
||||
LOGGER.Warn("FileRight is '' but User is Admin!! - Check the configuration!")
|
||||
End If
|
||||
_RowReadOnly = True
|
||||
End Select
|
||||
CURRENT_FILE_RIGHT = Result.ToString
|
||||
Else
|
||||
ContextMenu_Read()
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Getting rights - check the log")
|
||||
e.Cancel = True
|
||||
End If
|
||||
If _RowReadOnly = False Then
|
||||
If RIGHT_READ_ONLY_DOC = True Then
|
||||
If USER_IS_ADMIN = False Then
|
||||
ContextMenu_Read()
|
||||
Else
|
||||
LOGGER.Warn("FileRight is '' but User is Admin!! - Check the configuration!")
|
||||
LOGGER.Warn("RIGHT_READ_ONLY_DOC = True but User is Admin!! - Check the configuration!")
|
||||
End If
|
||||
_RowReadOnly = True
|
||||
End Select
|
||||
CURRENT_FILE_RIGHT = Result.ToString
|
||||
Else
|
||||
ContextMenu_Read()
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Getting rights - check the log")
|
||||
e.Cancel = True
|
||||
End If
|
||||
If _RowReadOnly = False Then
|
||||
If RIGHT_READ_ONLY_DOC = True Then
|
||||
If USER_IS_ADMIN = False Then
|
||||
ContextMenu_Read()
|
||||
Else
|
||||
LOGGER.Warn("RIGHT_READ_ONLY_DOC = True but User is Admin!! - Check the configuration!")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If oSelectedDocs.First.DisplayName <> "" Then
|
||||
tsmiFileRenameDisplayname.Visible = True
|
||||
Else
|
||||
@ -2284,12 +2295,9 @@ LOGGER.Error(ex)
|
||||
|
||||
Sub ContextMenu_Multiplefiles()
|
||||
tsmiFileProperties.Enabled = False
|
||||
|
||||
tsmiFileOpen.Enabled = False
|
||||
tsmiFileFolderOpen.Enabled = False
|
||||
|
||||
tsmiFileInWork.Enabled = False
|
||||
|
||||
tsmiFileLink_Add.Enabled = True
|
||||
tsmiFileLink_ShowAll.Enabled = True
|
||||
tsmiFileLinkRemove.Enabled = True
|
||||
@ -2342,8 +2350,8 @@ LOGGER.Error(ex)
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim allow_Open As Boolean = False
|
||||
'ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
|
||||
Dim Result = ClassDOC_SEARCH.Get_File_Rights(ClassWindreamDocGrid.SELECTED_DOC_ID)
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
Dim Result = ClassDOC_SEARCH.Get_File_Rights(oDocuments.First.DocId)
|
||||
|
||||
|
||||
If Not IsNothing(Result) Then
|
||||
@ -2376,8 +2384,8 @@ LOGGER.Error(ex)
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If clsWD_GET.WDFile_exists(ClassWindreamDocGrid.SELECTED_DOC_PATH, DD_LIB_Standards.clsDatabase.DB_PROXY_INITIALIZED, ClassProxy.MyLinkedServer, True) = True Then
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Right-Management", "File is existing, but you do not have the rights to open this file! " & vbNewLine & "Please contact your admin!" & vbNewLine & "DOC-ID: " & ClassWindreamDocGrid.SELECTED_DOC_ID.ToString)
|
||||
If clsWD_GET.WDFile_exists(oDocuments.First.DocPath, DD_LIB_Standards.clsDatabase.DB_PROXY_INITIALIZED, ClassProxy.MyLinkedServer, True) = True Then
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Right-Management", "File is existing, but you do not have the rights to open this file! " & vbNewLine & "Please contact your admin!" & vbNewLine & "DOC-ID: " & oDocuments.First.DocId.ToString)
|
||||
Else
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "", "File does not exist! Please contact your admin!")
|
||||
End If
|
||||
@ -2390,50 +2398,55 @@ LOGGER.Error(ex)
|
||||
INWORK_FILE = False
|
||||
tsmiFileInWork.Enabled = True
|
||||
Try
|
||||
Dim expression As String
|
||||
expression = "DocID = " & ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
Dim foundRowsLevel0() As DataRow
|
||||
'Dim expression As String
|
||||
'expression = "DocID = " & ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
'Dim foundRowsLevel0() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRowsLevel0 = CURRENT_DOC_RESULTS.Select(expression)
|
||||
'foundRowsLevel0 = CURRENT_DOC_RESULTS.Select(expression)
|
||||
|
||||
Try
|
||||
Dim oSQLDRList = $"Select COALESCE(IN_WORK_USER,'') IN_WORK_USER, COALESCE(IN_WORK_COMMENT,'') IN_WORK_COMMENT,IN_WORK FROM TBPMO_DOCRESULT_LIST where DocID = {ClassWindreamDocGrid.SELECTED_DOC_ID}"
|
||||
Dim oDT As DataTable = MYDB_ECM.GetDatatable(oSQLDRList)
|
||||
If Not IsNothing(oDT) Then
|
||||
If oDT.Rows.Count = 1 Then
|
||||
IW_USER = oDT.Rows(0).Item("IN_WORK_USER")
|
||||
IW_COMMENT = oDT.Rows(0).Item("IN_WORK_COMMENT")
|
||||
INWORK_FILE = CBool(oDT.Rows(0).Item("IN_WORK"))
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
If oDocuments.Count = 1 Then
|
||||
Try
|
||||
Dim oSQLDRList = $"Select COALESCE(IN_WORK_USER,'') IN_WORK_USER, COALESCE(IN_WORK_COMMENT,'') IN_WORK_COMMENT,IN_WORK FROM TBPMO_DOCRESULT_LIST where DocID = {oDocuments.First.DocId}"
|
||||
Dim oDT As DataTable = MYDB_ECM.GetDatatable(oSQLDRList)
|
||||
If Not IsNothing(oDT) Then
|
||||
If oDT.Rows.Count = 1 Then
|
||||
IW_USER = oDT.Rows(0).Item("IN_WORK_USER")
|
||||
IW_COMMENT = oDT.Rows(0).Item("IN_WORK_COMMENT")
|
||||
INWORK_FILE = CBool(oDT.Rows(0).Item("IN_WORK"))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Error(ex)
|
||||
IW_USER = ""
|
||||
IW_COMMENT = ""
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
IW_USER = ""
|
||||
IW_COMMENT = ""
|
||||
End Try
|
||||
|
||||
|
||||
Dim displ As String
|
||||
If INWORK_FILE = True Then
|
||||
If IW_USER.ToUpper = USER_USERNAME.ToUpper Or USER_IS_ADMIN Or USER_IS_SUPERVISOR Then
|
||||
displ = "Datei wieder freigeben"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
displ = "Set file free"
|
||||
Dim displ As String
|
||||
If INWORK_FILE = True Then
|
||||
If IW_USER.ToUpper = USER_USERNAME.ToUpper Or USER_IS_ADMIN Or USER_IS_SUPERVISOR Then
|
||||
displ = "Datei wieder freigeben"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
displ = "Set file free"
|
||||
End If
|
||||
Else
|
||||
displ = "Datei in Bearbeitung (zeige Info)"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
displ = "File is in work (show details)"
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
displ = "Datei in Bearbeitung (zeige Info)"
|
||||
displ = "Datei in Bearbeitung nehmen"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
displ = "File is in work (show details)"
|
||||
displ = "Lock file for working"
|
||||
End If
|
||||
End If
|
||||
tsmiFileInWork.Text = displ
|
||||
Else
|
||||
displ = "Datei in Bearbeitung nehmen"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
displ = "Lock file for working"
|
||||
End If
|
||||
MsgBox("Bitte nur eine Datei wählen!", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
tsmiFileInWork.Text = displ
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Warn("Unexpected Error in File-Work Info: " & ex.Message)
|
||||
@ -2446,27 +2459,31 @@ LOGGER.Error(ex)
|
||||
MsgBox("Could not read File Parameters (3)!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
ClassFileResult.DocID = ClassWindreamDocGrid.SELECTED_DOC_ID
|
||||
If INWORK_FILE = True Then ' Datei ist in Bearbeitung
|
||||
Dim msglbl As String
|
||||
Dim msg1 As String
|
||||
If IW_USER.ToUpper = USER_USERNAME.ToUpper Or USER_IS_ADMIN Or USER_IS_SUPERVISOR Then
|
||||
If ClassFileResult.Set_InWork(0, "") = True Then
|
||||
Await RUN_WDSEARCH_GRID(True)
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
If oDocuments.Count = 1 Then
|
||||
ClassFileResult.DocID = oDocuments.First.DocId
|
||||
If INWORK_FILE = True Then ' Datei ist in Bearbeitung
|
||||
Dim msglbl As String
|
||||
Dim msg1 As String
|
||||
If IW_USER.ToUpper = USER_USERNAME.ToUpper Or USER_IS_ADMIN Or USER_IS_SUPERVISOR Then
|
||||
If ClassFileResult.Set_InWork(0, "") = True Then
|
||||
Await RUN_WDSEARCH_GRID(True)
|
||||
End If
|
||||
Else
|
||||
msglbl = "In Bearbeitung durch User '" & IW_USER & "' - Kommentar:"
|
||||
msg1 = IW_COMMENT
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msglbl = "File being edited by user '" & IW_USER & "' - Comment:"
|
||||
End If
|
||||
ClassHelper.MSGBOX_Handler("INFO", "Information file", msglbl, msg1)
|
||||
End If
|
||||
Else
|
||||
msglbl = "In Bearbeitung durch User '" & IW_USER & "' - Kommentar:"
|
||||
msg1 = IW_COMMENT
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msglbl = "File in Work through User '" & IW_USER & "' - Comment:"
|
||||
End If
|
||||
ClassHelper.MSGBOX_Handler("INFO", "Information file", msglbl, msg1)
|
||||
frmFileInWork.ShowDialog()
|
||||
ClassWindreamDocGrid.SELECTED_INWORK = ClassFileResult.InWork
|
||||
Await RUN_WDSEARCH_GRID(True)
|
||||
End If
|
||||
Else
|
||||
frmFileInWork.ShowDialog()
|
||||
ClassWindreamDocGrid.SELECTED_INWORK = ClassFileResult.InWork
|
||||
Await RUN_WDSEARCH_GRID(True)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmNodeNavigation_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
@ -2686,7 +2703,9 @@ LOGGER.Error(ex)
|
||||
End Sub
|
||||
|
||||
Private Sub tsmiFileRightsShow_Click(sender As Object, e As EventArgs) Handles tsmiFileRightsShow.Click
|
||||
Dim result = ClassDOC_SEARCH.Get_File_Rights(ClassWindreamDocGrid.SELECTED_DOC_ID)
|
||||
Dim oDocuments = DocList.SelectedDocuments
|
||||
|
||||
Dim result = ClassDOC_SEARCH.Get_File_Rights(oDocuments.First.DocId)
|
||||
If Not IsNothing(result) Then
|
||||
Dim msg = "Das aktuelle Recht für Sie (" & USER_USERNAME & ") ist: "
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user