jj: use first vector value for auto index
This commit is contained in:
parent
e9da638521
commit
bde9868b8e
@ -413,20 +413,31 @@ Public Class frmIndex
|
|||||||
End Function
|
End Function
|
||||||
Function GetAutoIndex_Value(indexname As String)
|
Function GetAutoIndex_Value(indexname As String)
|
||||||
Try
|
Try
|
||||||
Dim DT As DataTable
|
Dim oDataTable As DataTable
|
||||||
Dim DR As DataRow
|
|
||||||
DT = MyDataset.VWDDINDEX_AUTOM
|
oDataTable = MyDataset.VWDDINDEX_AUTOM
|
||||||
For Each DR In DT.Rows
|
For Each oDataRow As DataRow In oDataTable.Rows
|
||||||
If DR.Item("INDEXNAME").ToString.ToLower = indexname.ToLower Then
|
If oDataRow.Item("INDEXNAME").ToString.ToLower = indexname.ToLower Then
|
||||||
If DR.Item("Indexiert") = True Then
|
Dim oIndexWert = oDataRow.Item("Indexwert")
|
||||||
If DR.Item("Indexwert").ToString <> String.Empty Then
|
Dim oIsIndexed = oDataRow.Item("Indexiert")
|
||||||
Return DR.Item("Indexwert")
|
|
||||||
|
If oIsIndexed = True Then
|
||||||
|
If oIndexWert.ToString <> String.Empty Then
|
||||||
|
oIndexWert = oIndexWert.ToString
|
||||||
|
|
||||||
|
' If Index is a vectorfield (read: Value contains the VECTORSEPARATOR character), use the first value
|
||||||
|
If oIndexWert.Contains(ClassConstants.VECTORSEPARATOR) Then
|
||||||
|
Return oIndexWert.ToString.Split(ClassConstants.VECTORSEPARATOR).FirstOrDefault()
|
||||||
Else
|
Else
|
||||||
showlblhinweis("Der Automatische Index: " & DR.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert!")
|
' Else just return the normal value
|
||||||
|
Return oIndexWert
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
showlblhinweis("Der Automatische Index: " & oDataRow.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert!")
|
||||||
Return ""
|
Return ""
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
showlblhinweis("Der Automatische Index: " & DR.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert!")
|
showlblhinweis("Der Automatische Index: " & oDataRow.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert!")
|
||||||
Return ""
|
Return ""
|
||||||
End If
|
End If
|
||||||
Exit For
|
Exit For
|
||||||
@ -2272,7 +2283,7 @@ Public Class frmIndex
|
|||||||
' versuchen wir, die Spalte VALUE zu ersetzen
|
' versuchen wir, die Spalte VALUE zu ersetzen
|
||||||
If oSqlResult = String.Empty Or oSqlActive = 0 Then
|
If oSqlResult = String.Empty Or oSqlActive = 0 Then
|
||||||
Dim oPlaceholderResult As String
|
Dim oPlaceholderResult As String
|
||||||
Dim oValue As String = oAutoIndexRow.Item("VALUE")
|
Dim oValue As String = ClassHelper.NotNull(oAutoIndexRow.Item("VALUE"), "")
|
||||||
|
|
||||||
oPlaceholderResult = GetPlaceholderValue(oValue, CURRENT_WORKFILE, USER_SHORT_NAME)
|
oPlaceholderResult = GetPlaceholderValue(oValue, CURRENT_WORKFILE, USER_SHORT_NAME)
|
||||||
|
|
||||||
@ -2986,12 +2997,12 @@ Public Class frmIndex
|
|||||||
'######
|
'######
|
||||||
Dim p_reg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
Dim p_reg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||||
' einen Regulären Ausdruck laden
|
' einen Regulären Ausdruck laden
|
||||||
Dim regularExpression As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(p_reg)
|
Dim regularExpression As Regex = New Regex(p_reg)
|
||||||
' die Vorkommen im Folder-String auslesen
|
' die Vorkommen im Folder-String auslesen
|
||||||
Dim elemente As System.Text.RegularExpressions.MatchCollection = regularExpression.Matches(folderindex)
|
Dim elemente As MatchCollection = regularExpression.Matches(folderindex)
|
||||||
'####
|
'####
|
||||||
' alle Vorkommen innerhalb des Ordnerstrings durchlaufen
|
' alle Vorkommen innerhalb des Ordnerstrings durchlaufen
|
||||||
For Each element As System.Text.RegularExpressions.Match In elemente
|
For Each element As Match In elemente
|
||||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Elementname in FolderString: '" & element.ToString & "'", False)
|
If LogErrorsOnly = False Then ClassLogger.Add(" >> Elementname in FolderString: '" & element.ToString & "'", False)
|
||||||
Select Case element.Value.Substring(2, 1).ToUpper
|
Select Case element.Value.Substring(2, 1).ToUpper
|
||||||
|
|
||||||
@ -3075,6 +3086,9 @@ Public Class frmIndex
|
|||||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Den Root-Folder zusammenfügen>> ", False)
|
If LogErrorsOnly = False Then ClassLogger.Add(" >> Den Root-Folder zusammenfügen>> ", False)
|
||||||
Dim fullpath As String = RootFolder & "\" & folderindex & "\"
|
Dim fullpath As String = RootFolder & "\" & folderindex & "\"
|
||||||
fullpath = fullpath.Replace("\\", "\")
|
fullpath = fullpath.Replace("\\", "\")
|
||||||
|
|
||||||
|
fullpath = Path.Combine(RootFolder, folderindex)
|
||||||
|
|
||||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Fullpath (mit evtl. Sonderzeichen (SZ)) '" & fullpath & "'", False)
|
If LogErrorsOnly = False Then ClassLogger.Add(" >> Fullpath (mit evtl. Sonderzeichen (SZ)) '" & fullpath & "'", False)
|
||||||
Dim invalidPathChars() As Char = Path.GetInvalidPathChars()
|
Dim invalidPathChars() As Char = Path.GetInvalidPathChars()
|
||||||
For Each sonderChar As Char In invalidPathChars
|
For Each sonderChar As Char In invalidPathChars
|
||||||
@ -3097,74 +3111,10 @@ Public Class frmIndex
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
End If
|
End If
|
||||||
CURRENT_NEWFILENAME = CURRENT_NEWFILENAME.Replace(RootFolder, fullpath)
|
|
||||||
CURRENT_NEWFILENAME = CURRENT_NEWFILENAME.Replace("\\", "\")
|
|
||||||
''Die aktuelle Datei soll gleichzeitig verschoben werden
|
|
||||||
'Dim extension As String = Path.GetExtension(CURRENT_NEWFILENAME)
|
|
||||||
'Dim Dateiname As String = Path.GetFileName(CURRENT_NEWFILENAME)
|
|
||||||
'Dim _Pfad, _WDLaufwerk, _Ziel As String
|
|
||||||
'_Ziel = fullpath & Dateiname
|
|
||||||
'If LogErrorsOnly = False Then ClassLogger.Add(" >> Ziel: " & _Ziel, False)
|
|
||||||
''Nur verschieben und überprüfen wenn Pfad ungleich
|
|
||||||
'Dim quell = Path.GetDirectoryName(CURRENT_NEWFILENAME)
|
|
||||||
'Dim ziel = Path.GetDirectoryName(_Ziel)
|
|
||||||
'If quell <> ziel Then
|
|
||||||
' If CURRENT_DOKART_DUPLICATE_HANDLING = "Default" Or CURRENT_DOKART_DUPLICATE_HANDLING = "Question" Then
|
|
||||||
' ''##########
|
|
||||||
' Dim msg = "Eine Datei mit identischem Namen existiert bereits! Wollen Sie die bestehende Datei ersetzen?"
|
|
||||||
' If USER_LANGUAGE <> "de-DE" Then
|
|
||||||
' msg = "Ther is already a file with the same name! Would You like to replace the file?"
|
|
||||||
' End If
|
|
||||||
' Dim result As MsgBoxResult
|
|
||||||
' result = MessageBox.Show(msg, "File alredy exists:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
|
||||||
' If result = MsgBoxResult.No Then
|
|
||||||
' _Ziel = ClassFilehandle.Versionierung_Datei(_Ziel).ToString.Substring(2)
|
|
||||||
' Else
|
|
||||||
' If ClassWindream.Delete_WDFile(_Ziel.Substring(2)) = False Then
|
|
||||||
' Return False
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
' ElseIf CURRENT_DOKART_DUPLICATE_HANDLING = "New version" Then
|
|
||||||
' _Ziel = ClassFilehandle.Versionierung_Datei(_Ziel).ToString.Substring(2)
|
|
||||||
' End If
|
|
||||||
|
|
||||||
|
CURRENT_NEWFILENAME = Path.Combine(fullpath, Path.GetFileName(CURRENT_NEWFILENAME))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' 'Dim Stammname As String = _Ziel.Substring(0, _Ziel.LastIndexOf("."))
|
|
||||||
' 'Dim version As Integer = 2
|
|
||||||
' 'Do While File.Exists(_Ziel) = True
|
|
||||||
' ' If LogErrorsOnly = False Then ClassLogger.Add(" >> Achtung: Datei ' " & Path.GetFileName(_Ziel) & "' existiert bereits!", False)
|
|
||||||
' ' Dim neuername As String = Stammname & "~" & version & extension
|
|
||||||
' ' _Ziel = neuername
|
|
||||||
' ' version = version + 1
|
|
||||||
' 'Loop
|
|
||||||
' If _Ziel.StartsWith("\") Then
|
|
||||||
' CURRENT_NEWFILENAME = "W:" & _Ziel
|
|
||||||
' Else
|
|
||||||
' CURRENT_NEWFILENAME = _Ziel
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' ' My.Computer.FileSystem.MoveFile(fullfilename, _Ziel)
|
|
||||||
' ClassLogger.Add(" >> Dateiname wurde nach CrFolderIndex-Methode erzeugt", False)
|
|
||||||
'Else
|
|
||||||
' ClassLogger.Add(" >> Quell- und Zielordner identisch", False)
|
|
||||||
' 'ClassLogger.Add(" >> (CrFolderForIndex) Quell- und Zielordner identisch", False)
|
|
||||||
' 'If Path.GetFileName(fullfilename) <> Path.GetFileName(_Ziel) And File.Exists(_Ziel) Then
|
|
||||||
' ' ClassLogger.Add(" >> (CrFolderForIndex) Quell- und Zielname nicht identisch", False)
|
|
||||||
' ' FileSystem.Rename(_Ziel, Path.GetDirectoryName(_Ziel) & Path.GetFileName(fullfilename))
|
|
||||||
' ' ClassLogger.Add(" >> Datei wurde nach CrFolderIndex-Methode umbenannt", False)
|
|
||||||
' ' CURRENT_NEWFILENAME = _Ziel
|
|
||||||
' 'End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
'Else
|
|
||||||
'ClassLogger.Add(" >> Es konnte kein dynamischer Pfad generiert werden", True)
|
|
||||||
'Return False
|
|
||||||
'End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Unexpected Error in CreateFolderforIndex-Method:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Unexpected Error in CreateFolderforIndex-Method:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
ClassLogger.Add(" >> Fehler in CrFolderForIndex: " & ex.Message, True)
|
ClassLogger.Add(" >> Fehler in CrFolderForIndex: " & ex.Message, True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user