Vor Profilauswahl prüfen, ob Session vorhanden - frmIndex

This commit is contained in:
OlgunR 2025-05-07 13:28:09 +02:00
parent 199904b695
commit 574fd88b99

View File

@ -11,6 +11,7 @@ Imports Limilabs.Mail
Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Windream
'Imports DevExpress.DataAccess.Native.Json
'Imports GdPicture.Internal.MSOfficeBinary.translator.Spreadsheet.XlsFileFormat.Records
@ -1847,57 +1848,69 @@ Public Class frmIndex
Private Sub ComboBoxEdit1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboboxDoctype.EditValueChanged
If ComboboxDoctype.EditValue IsNot Nothing And FormLoaded = True Then
Dim oSelectedItem As DocType = ComboboxDoctype.EditValue
CURRENT_DOKART_ID = oSelectedItem.Guid
CURRENT_LASTDOKART = oSelectedItem.Name
WINDREAM = New Windream(LOGCONFIG, False, WMDrive, WINDREAM_BASEPATH, True, "", "", "", "")
If Not IsNothing(WINDREAM) Then
If WINDREAM.SessionLoggedin Then
'lblhinweis.Visible = False
ClearNotice()
Dim oSelectedItem As DocType = ComboboxDoctype.EditValue
'lblerror.Visible = False
ClearError()
CURRENT_DOKART_ID = oSelectedItem.Guid
CURRENT_LASTDOKART = oSelectedItem.Name
pnlIndex.Controls.Clear()
Dim sql As String = "Select WINDREAM_DIRECT, ZIEL_PFAD, DUPLICATE_HANDLING from TBDD_DOKUMENTART WHERE GUID = " & oSelectedItem.Guid
Dim oDoctypes As DataTable = DATABASE_ECM.GetDatatable(sql)
'lblhinweis.Visible = False
ClearNotice()
Dim oDocType As DataRow = oDoctypes.Rows.Item(0)
WMDirect = oDocType.Item("WINDREAM_DIRECT")
Dim oDestination As String = oDocType.Item("ZIEL_PFAD")
Dim oNewDestination As String
If WMDirect Then
Dim oNormalized As String = WINDREAM.GetNormalizedPath(oDestination, False)
oNewDestination = Path.Combine(WINDREAM.ClientBasePath, oNormalized)
Else
oNewDestination = oDestination
End If
'lblerror.Visible = False
ClearError()
pnlIndex.Controls.Clear()
Dim sql As String = "Select WINDREAM_DIRECT, ZIEL_PFAD, DUPLICATE_HANDLING from TBDD_DOKUMENTART WHERE GUID = " & oSelectedItem.Guid
Dim oDoctypes As DataTable = DATABASE_ECM.GetDatatable(sql)
Dim oDocType As DataRow = oDoctypes.Rows.Item(0)
WMDirect = oDocType.Item("WINDREAM_DIRECT")
Dim oDestination As String = oDocType.Item("ZIEL_PFAD")
Dim oNewDestination As String
If WMDirect Then
Dim oNormalized As String = WINDREAM.GetNormalizedPath(oDestination, False)
oNewDestination = Path.Combine(WINDREAM.ClientBasePath, oNormalized)
Else
oNewDestination = oDestination
End If
LOGGER.Debug("Path from Database is [{0}]", oDestination)
LOGGER.Debug("Checking for path [{0}]", oNewDestination)
Dim oPathExists As Boolean
If WMDirect Then
oPathExists = WINDREAM.TestFolderExists(oNewDestination)
Else
oPathExists = Directory.Exists(oNewDestination)
End If
LOGGER.Debug("Path from Database is [{0}]", oDestination)
LOGGER.Debug("Checking for path [{0}]", oNewDestination)
Dim oPathExists As Boolean
If WMDirect Then
oPathExists = WINDREAM.TestFolderExists(oNewDestination)
Else
oPathExists = Directory.Exists(oNewDestination)
End If
If oPathExists = False Then
Dim oMessage As String
If oPathExists = False Then
Dim oMessage As String
If USER_LANGUAGE = "de-DE" Then
oMessage = $"Der Pfad für das ausgewählte Profil ist nicht erreichbar:{vbNewLine}[{oNewDestination}].{vbNewLine}{vbNewLine}Bitte wählen Sie ein anderes Profil."
Else
oMessage = $"Profile Path is not available:{vbNewLine}[{oNewDestination}].{vbNewLine}{vbNewLine}Please select another profile."
End If
MsgBox(oMessage, MsgBoxStyle.Information, Text)
ComboboxDoctype.EditValue = Nothing
Else
CURRENT_DOKART_DUPLICATE_HANDLING = oDocType.Item("DUPLICATE_HANDLING")
Refresh_IndexeMan(oSelectedItem.Guid)
End If
If USER_LANGUAGE = "de-DE" Then
oMessage = $"Der Pfad für das ausgewählte Profil ist nicht erreichbar:{vbNewLine}[{oNewDestination}].{vbNewLine}{vbNewLine}Bitte wählen Sie ein anderes Profil."
Else
oMessage = $"Profile Path is not available:{vbNewLine}[{oNewDestination}].{vbNewLine}{vbNewLine}Please select another profile."
MsgBox("Es konnte keine Session aufgebaut werden.")
End If
MsgBox(oMessage, MsgBoxStyle.Information, Text)
ComboboxDoctype.EditValue = Nothing
Else
CURRENT_DOKART_DUPLICATE_HANDLING = oDocType.Item("DUPLICATE_HANDLING")
Refresh_IndexeMan(oSelectedItem.Guid)
MsgBox("Es konnte keine Windream-Verbindung aufgebaut werden.")
End If
End If
End Sub