fix file skip not working

This commit is contained in:
Jonathan Jenne 2019-02-12 17:46:52 +01:00
parent dd50938155
commit 4e756f06ed
2 changed files with 48 additions and 12 deletions

View File

@ -33,6 +33,14 @@ Module ModuleMySettings
Return Path.Combine(Application.CommonAppDataPath(), CONFIG_FILE)
End Function
Public Function GetCurrentConfigPath() As String
If File.Exists(GetUserConfigPath()) Then
Return GetUserConfigPath()
Else
Return GetAllUsersConfigPath()
End If
End Function
Public Function Settings_Load()
Try
Dim oDatatable As DataTable
@ -192,8 +200,10 @@ Module ModuleMySettings
''' </summary>
Public Function SaveMySettingsValue(name As String, value As String)
Try
Dim oConfigPath = GetUserConfigPath()
Dim oDatatable As DataTable = GetTablefromXML(oConfigPath)
Dim oUserConfigPath = GetUserConfigPath()
Dim oCurrentConfigPath = GetCurrentConfigPath()
Dim oDatatable As DataTable = GetTablefromXML(oCurrentConfigPath)
For Each Row As DataRow In oDatatable.Rows
If Row.Item("ConfigName") = name Then
@ -201,7 +211,7 @@ Module ModuleMySettings
End If
Next
oDatatable.AcceptChanges()
oDatatable.WriteXml(oConfigPath)
oDatatable.WriteXml(oUserConfigPath)
Return True
Catch ex As Exception
MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical)

View File

@ -1204,15 +1204,42 @@ Public Class frmValidator
viewerID = Proc.Id
End If
End Sub
Function ReplaceWindreamDriveLetter(Filepath As String) As String
Return Filepath.
Replace("W:", "\\windream\objects").
Replace("K:", "\\windream\objects")
End Function
Function Next_GUID(Filepath As String, ProfilId As Integer, OrderByNewest As Boolean) As Integer
Dim oFilePath = ReplaceWindreamDriveLetter(Filepath).ToUpper()
Dim oSQL = $"
SELECT GUID FROM TBPM_PROFILE_FILES WHERE
PROFIL_ID = {CURRENT_ProfilGUID} AND EDIT = 0 AND IN_WORK = 0 AND
UPPER(REPLACE(FILE_PATH, 'W:','\\windream\objects')) <> '{oFilePath}' AND
UPPER(REPLACE(FILE_PATH, 'W:','\\windream\objects')) NOT IN (
SELECT UPPER(FILE_PATH)
FROM TBPM_FILES_USER_NOT_INDEXED
WHERE (PROFIL_ID = {ProfilId}) AND (UPPER(USR_NAME) = UPPER('{Environment.UserName}'))
)
{IIf(OrderByNewest, " ORDER BY DMS_ERSTELLT_DATE DESC", "")}
"
Return ClassDatabase.Execute_Scalar(oSQL, MyConnectionString, True)
End Function
Function Get_Next_GUID() As Integer
Try
Dim newGUID As Integer
If LogErrorsOnly = False Then ClassLogger.Add(" >> Old Document_Path: " & OLD_Document_Path, False)
If PROFIL_sortbynewest = True Then
newGUID = TBPM_PROFILE_FILESTableAdapter.cmdgetNextFile_GUID_Newest(CURRENT_ProfilGUID, OLD_Document_Path, Environment.UserName)
Else
newGUID = TBPM_PROFILE_FILESTableAdapter.cmdGetNextFile_GUID(CURRENT_ProfilGUID, OLD_Document_Path, Environment.UserName)
End If
newGUID = Next_GUID(OLD_Document_Path, CURRENT_ProfilGUID, PROFIL_sortbynewest)
'If PROFIL_sortbynewest = True Then
' newGUID = TBPM_PROFILE_FILESTableAdapter.cmdgetNextFile_GUID_Newest(CURRENT_ProfilGUID, OLD_Document_Path, Environment.UserName)
'Else
' newGUID = TBPM_PROFILE_FILESTableAdapter.cmdGetNextFile_GUID(CURRENT_ProfilGUID, OLD_Document_Path, Environment.UserName)
'End If
Document_Path = ""
CURRENT_DOC_PATH = ""
If newGUID > 0 Then
@ -2135,16 +2162,15 @@ Public Class frmValidator
Try
Dim lookup As LookupControl = inctrl
Dim wertWD = aktivesDokument.GetVariableValue(idxname)
If wertWD.GetType.ToString.Contains("System.Object") Then
If IsNothing(wertWD) Then
lookup.SelectedValues = New List(Of String)
ElseIf wertWD.GetType.ToString.Contains("System.Object") Then
Dim oArrlist As New List(Of String)
For Each oVectorRow As Object In wertWD
oArrlist.Add(oVectorRow.ToString)
Next
lookup.SelectedValues = oArrlist
Else
End If
Catch ex As Exception