85 lines
3.1 KiB
VB.net
85 lines
3.1 KiB
VB.net
Imports WINDREAMLib
|
|
Imports System.IO
|
|
Public Class clsDateiverarbeitung
|
|
|
|
#Region "***** Variablen *****"
|
|
Public Shared _windream As New clsWindream_allgemein
|
|
|
|
Public Shared pr_Profilname, pr_Objekttyp, pr_wdSuche, WDLaufwerk As String
|
|
Public Shared pr_GUID As Integer
|
|
Public Shared pr_DTPROFIL_REGELN As DataTable
|
|
|
|
Private email As New clsEmail
|
|
Public Shared CriticalError As Boolean = False
|
|
|
|
Private Shared regel_TYP, regel_INDEX_NAME, regel_QUELLE1, regel_FROM1, regel_FROM2 As String
|
|
Private Shared Indexe() As String = Nothing ' zum Speichern der Indexe
|
|
Private Shared NI_Values() As String = Nothing ' zum Speichern der Werte
|
|
|
|
Private Shared WD_aktivesDokument As WMObject
|
|
|
|
#End Region
|
|
Public Shared Function InitProfilData()
|
|
Try
|
|
pr_Profilname = Nothing
|
|
pr_Objekttyp = Nothing
|
|
pr_wdSuche = Nothing
|
|
pr_DTPROFIL_REGELN = Nothing
|
|
|
|
' Profildaten der Klasse mitteilen
|
|
pr_Profilname = clsProfil._Profilname
|
|
pr_Objekttyp = clsProfil._profObjekttyp
|
|
pr_wdSuche = clsProfil._profwdSuche
|
|
pr_GUID = clsProfil._profGUID
|
|
|
|
WDLaufwerk = Service1.WDLaufwerk
|
|
|
|
Return True
|
|
Catch ex As Exception
|
|
ClassLogger.Add(ex.Message, True, "cls_DV.InitProfilData")
|
|
Return False
|
|
End Try
|
|
End Function
|
|
'Kopiert die übergebene Datei in den Zielpfad
|
|
Public Shared Function Export_File(WDDatei As WMObject, Zielpfad As String)
|
|
Try
|
|
ClassLogger.Add(">> Verarbeitung von Dokument: " & WDDatei.aName, "clsDV Export_File")
|
|
|
|
|
|
'Die Quelle zusammensetzen
|
|
Dim Quelle As String = IO.Path.GetDirectoryName(WDLaufwerk & ":" & WDDatei.aPath & "\" & WDDatei.aName)
|
|
ClassLogger.AddDetailLog("* Quell-Dokument Dokuments: " & Quelle)
|
|
'Das eigentliche kopieren
|
|
File.Copy(Quelle, Zielpfad & "\" & WDDatei.aName)
|
|
|
|
Return True
|
|
Catch ex As Exception
|
|
'bei einem Fehler einen Eintrag in der Logdatei machen
|
|
ClassLogger.Add("Unvorhergesehener Fehler: " & ex.Message, "clsDV Export_File", True)
|
|
Return False
|
|
End Try
|
|
End Function
|
|
Public Shared Function SetSingle_Index(ByVal _value As Object, ByVal _dok As WINDREAMLib.WMObject, ByVal _Indexname As String)
|
|
'Überprüfen ob Validierung bereits gesetzt wurde?
|
|
Dim akt_Value = _dok.GetVariableValue(_Indexname)
|
|
If akt_Value <> _value Then
|
|
|
|
Dim arrIndex() As String = Nothing
|
|
Dim arrValue() As String = Nothing
|
|
'Nun die Datei indexieren
|
|
arrIndex = Nothing
|
|
arrValue = Nothing
|
|
ReDim Preserve arrIndex(0)
|
|
ReDim Preserve arrValue(0)
|
|
arrIndex(0) = _Indexname
|
|
arrValue(0) = _value.ToString
|
|
clsWindream_Index.RunIndexing(_dok, arrIndex, arrValue, pr_Profilname, pr_Objekttyp)
|
|
Else
|
|
'Validation muß nicht angepasst werden
|
|
ClassLogger.AddDetailLog(" - Indexvalue identisch")
|
|
End If
|
|
|
|
End Function
|
|
End Class
|
|
|