Initial commit
This commit is contained in:
41
EDKB14WS/Backup/EDKB14WS/Klassen/DivFrnkt.vb
Normal file
41
EDKB14WS/Backup/EDKB14WS/Klassen/DivFrnkt.vb
Normal file
@@ -0,0 +1,41 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class clsDivFnkt
|
||||
|
||||
#Region "Deklarationen"
|
||||
Dim clsjournaleintrag As New edokaDB.clsJournaleintrag
|
||||
|
||||
Public Enum Enum_InfoTyp
|
||||
Keine = 0
|
||||
Information = 1
|
||||
Warnung = 2
|
||||
Fehler = 3
|
||||
End Enum
|
||||
|
||||
#End Region
|
||||
|
||||
Public Sub InsertJournale(ByVal Message As String, ByVal sTyp As Enum_InfoTyp)
|
||||
Try
|
||||
|
||||
If sTyp <> Enum_InfoTyp.Keine Then
|
||||
End If
|
||||
clsjournaleintrag.iJournalnr = New SqlInt32(CType(-3, Int32))
|
||||
clsjournaleintrag.daDatumzeit = New SqlDateTime(CType(Now, DateTime))
|
||||
clsjournaleintrag.sEintrag = New SqlString(CType(Message, String))
|
||||
clsjournaleintrag.cpMainConnectionProvider = Globals.connJournale
|
||||
Console.WriteLine(Message)
|
||||
Globals.connJournale.OpenConnection()
|
||||
clsjournaleintrag.Insert()
|
||||
Globals.connJournale.CloseConnection(True)
|
||||
Catch ex As Exception
|
||||
LogEntry.Writelog(Log.Logtype.Debug, ex.Message)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
43
EDKB14WS/Backup/EDKB14WS/Klassen/Log.vb
Normal file
43
EDKB14WS/Backup/EDKB14WS/Klassen/Log.vb
Normal file
@@ -0,0 +1,43 @@
|
||||
Public Class Log
|
||||
Dim mLogFileOK As String
|
||||
Dim mLogfileNOK As String
|
||||
|
||||
Dim mLogFileDebug As String
|
||||
Dim mdebugmode As Boolean
|
||||
|
||||
Public Enum Logtype As Integer
|
||||
OK = 1
|
||||
NOK = 2
|
||||
Debug = 3
|
||||
End Enum
|
||||
|
||||
Sub New(ByVal LogFileOK As String, ByVal logfilenok As String, ByVal logfiledebug As String, ByVal debugmode As Boolean)
|
||||
mLogFileOK = LogFileOK
|
||||
mLogfileNOK = logfilenok
|
||||
mLogFileDebug = logfiledebug
|
||||
mdebugmode = debugmode
|
||||
End Sub
|
||||
|
||||
Public Sub set_file_names(ByVal LogFileOK As String, ByVal logfilenok As String)
|
||||
mLogFileOK = LogFileOK
|
||||
mLogfileNOK = logfilenok
|
||||
End Sub
|
||||
|
||||
Public Sub Writelog(ByVal logtype As Logtype, ByVal Inhalt As String)
|
||||
Select Case logtype
|
||||
Case Log.Logtype.OK
|
||||
FileOpen(99, mLogFileOK, OpenMode.Append)
|
||||
Case Log.Logtype.NOK
|
||||
FileOpen(99, mLogfileNOK, OpenMode.Append)
|
||||
Case Log.Logtype.Debug
|
||||
FileOpen(99, mLogFileDebug, OpenMode.Append)
|
||||
End Select
|
||||
If logtype = Log.Logtype.Debug And mdebugmode = True Then
|
||||
WriteLine(99, Now.ToString + Chr(9) + Inhalt)
|
||||
Else
|
||||
If logtype = Log.Logtype.OK Or logtype = Log.Logtype.NOK Then WriteLine(99, Now.ToString + Chr(9) + Inhalt)
|
||||
End If
|
||||
FileClose(99)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
256
EDKB14WS/Backup/EDKB14WS/Klassen/Parameters.vb
Normal file
256
EDKB14WS/Backup/EDKB14WS/Klassen/Parameters.vb
Normal file
@@ -0,0 +1,256 @@
|
||||
Imports System.Xml
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class Parameters
|
||||
Dim sconnectionstring As String
|
||||
Property connectionstring() As String
|
||||
Get
|
||||
Return sconnectionstring
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sconnectionstring = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sconnectionstring_Journale As String
|
||||
Property connectionstring_Journale() As String
|
||||
Get
|
||||
Return sconnectionstring_Journale
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sconnectionstring_Journale = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Dim bDebugmode As Boolean
|
||||
Property DebugMode() As Boolean
|
||||
Get
|
||||
Return bDebugmode
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
bDebugmode = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sworkdir As String
|
||||
Property WorkDir() As String
|
||||
Get
|
||||
Return sworkdir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sworkdir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sDsrDir As String 'Input-Directory für DSR-XML-Dateien
|
||||
Property DSRDir() As String
|
||||
Get
|
||||
Return sDsrDir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sDsrDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim iAnzDokumente As Integer
|
||||
Property AnzDokumente() As Integer
|
||||
Get
|
||||
Return iAnzDokumente
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
iAnzDokumente = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim iDokTypeBriefvorlage As Integer
|
||||
Property DokTypeBriefvorlage() As Integer
|
||||
Get
|
||||
Return iDokTypeBriefvorlage
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
iDokTypeBriefvorlage = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sPSDir As String
|
||||
Property PSDir() As String
|
||||
Get
|
||||
Return sPSDir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sPSDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sPDFDir As String
|
||||
Property PDFDir() As String
|
||||
Get
|
||||
Return sPDFDir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sPDFDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim sPSPrinter As String
|
||||
Property PSPrinter() As String
|
||||
Get
|
||||
Return sPSPrinter
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
sPSPrinter = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_edkb08dir
|
||||
Property EDKB08Dir() As String
|
||||
Get
|
||||
Return m_edkb08dir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_edkb08dir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_logdir As String
|
||||
Property LogDir() As String
|
||||
Get
|
||||
Return m_logdir
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_logdir = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_waitloop As Integer
|
||||
Property WaitLoop() As Integer
|
||||
Get
|
||||
Return m_waitloop
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
m_waitloop = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_covertpdfdirect As Boolean
|
||||
Property ConvertPDFDirect() As Boolean
|
||||
Get
|
||||
Return m_covertpdfdirect
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
m_covertpdfdirect = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_oracleconnectionstring As String
|
||||
Property OracleConnectionString() As String
|
||||
Get
|
||||
Return m_oracleconnectionstring
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_oracleconnectionstring = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_AdresseAbOracle As Boolean
|
||||
Property AdresseAbOracle() As Boolean
|
||||
Get
|
||||
Return m_AdresseAbOracle
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
m_AdresseAbOracle = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_UsePDFInOutDir As Boolean
|
||||
Property Use_PDFInOutDir() As Boolean
|
||||
Get
|
||||
Return m_UsePDFInOutDir
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
m_UsePDFInOutDir = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Startzeit As String
|
||||
Property Startzeit() As String
|
||||
Get
|
||||
Return m_Startzeit
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_Startzeit = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Laufzeit As String
|
||||
Property Laufzeit() As String
|
||||
Get
|
||||
Return m_Laufzeit
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_Laufzeit = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_mailadresse As String
|
||||
Property Mailadresse() As String
|
||||
Get
|
||||
Return m_mailadresse
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
m_mailadresse = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_timerintervall As Integer
|
||||
Property TimerIntevall() As Integer
|
||||
Get
|
||||
Return m_timerintervall * 60 * 1000
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
m_timerintervall = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_CheckOffice2010 As Boolean
|
||||
Property CheckOffice2010() As Boolean
|
||||
Get
|
||||
Return m_CheckOffice2010
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
m_CheckOffice2010 = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim xmldoc As New XmlDocument
|
||||
|
||||
Public Sub New()
|
||||
xmldoc.Load(Me.ApplicationPath + "Parameters.xml")
|
||||
Me.connectionstring = xmldoc.SelectSingleNode("/Configuration/SQLConnectionString").InnerText
|
||||
Me.connectionstring_Journale = xmldoc.SelectSingleNode("/Configuration/SQLConnectionStringJournale").InnerText
|
||||
Me.WorkDir = xmldoc.SelectSingleNode("/Configuration/WorkDir").InnerText
|
||||
Me.DebugMode = UCase(xmldoc.SelectSingleNode("/Configuration/DebugMode").InnerText) = "TRUE"
|
||||
Me.DSRDir = xmldoc.SelectSingleNode("/Configuration/DSRDir").InnerText
|
||||
Me.AnzDokumente = xmldoc.SelectSingleNode("/Configuration/AnzDokumente").InnerText
|
||||
Me.DokTypeBriefvorlage = xmldoc.SelectSingleNode("/Configuration/DoktypeBriefvorlage").InnerText
|
||||
Me.sPSDir = xmldoc.SelectSingleNode("/Configuration/PSDir").InnerText
|
||||
Me.sPDFDir = xmldoc.SelectSingleNode("/Configuration/PDFDir").InnerText
|
||||
Me.sPSPrinter = xmldoc.SelectSingleNode("/Configuration/PSPrinter").InnerText
|
||||
Me.Use_PDFInOutDir = xmldoc.SelectSingleNode("/Configuration/DistillerInOutDirs").InnerText = True
|
||||
Me.ConvertPDFDirect = xmldoc.SelectSingleNode("/Configuration/ConvertPDFDirect").InnerText = True
|
||||
Me.EDKB08Dir = xmldoc.SelectSingleNode("/Configuration/EDKB08Dir").InnerText
|
||||
Me.LogDir = xmldoc.SelectSingleNode("/Configuration/LogDir").InnerText
|
||||
Me.WaitLoop = xmldoc.SelectSingleNode("/Configuration/WaitLoop").InnerText
|
||||
Me.OracleConnectionString = xmldoc.SelectSingleNode("/Configuration/OraConnectionstring").InnerText
|
||||
Me.AdresseAbOracle = xmldoc.SelectSingleNode("/Configuration/OracleAdresse").InnerText = True
|
||||
Me.Startzeit = xmldoc.SelectSingleNode("/Configuration/Startzeit").InnerText
|
||||
Me.Laufzeit = xmldoc.SelectSingleNode("/Configuration/RunTimeInStd").InnerText
|
||||
Me.Mailadresse = xmldoc.SelectSingleNode("/Configuration/Mail").InnerText
|
||||
Me.TimerIntevall = xmldoc.SelectSingleNode("/Configuration/TimerIntervallInMinuten").InnerText
|
||||
Me.CheckOffice2010 = UCase(xmldoc.SelectSingleNode("/Configuration/CheckOffice2010").InnerText) = "TRUE"
|
||||
Globals.conn.sConnectionString = Me.connectionstring
|
||||
Globals.connJournale.sConnectionString = Me.connectionstring_Journale
|
||||
End Sub
|
||||
|
||||
Public Function ApplicationPath() As String
|
||||
Return Path.GetDirectoryName([Assembly].GetEntryAssembly().Location) + "\"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
105
EDKB14WS/Backup/EDKB14WS/Klassen/clsImportdata.vb
Normal file
105
EDKB14WS/Backup/EDKB14WS/Klassen/clsImportdata.vb
Normal file
@@ -0,0 +1,105 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.IO
|
||||
|
||||
Public Class clsImportdata
|
||||
#Region "Deklarationen"
|
||||
Dim Importdata As New DataSet
|
||||
|
||||
#End Region
|
||||
|
||||
Dim m_partnernr As Integer
|
||||
Dim m_dokumenttypnr As Integer
|
||||
Dim m_dsrfilename As String
|
||||
Dim m_indexfilename As String
|
||||
Dim m_dokumentid As String
|
||||
Dim m_blkunde As Integer
|
||||
|
||||
Public Function Importdaten_erstellen(ByVal partnernr As Integer, ByVal dokumenttypnr As Integer, ByVal DSRFilename As String, ByVal indexfilename As String, ByVal edkb08dir As String, ByVal dokumentid As String, ByVal blkunde As Boolean) As Boolean
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Importdaten:")
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Partner:" + partnernr.ToString)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Doktype:" + dokumenttypnr.ToString)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "DSRFile:" + DSRFilename)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Indexfile:" + indexfilename)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "EDKB08Dir" + edkb08dir)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Dokumentid:" + dokumentid)
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "BLKunde:" + blkunde.ToString)
|
||||
Try
|
||||
Importdata.Tables.Clear()
|
||||
Importdata.ReadXml(Globals.ApplicationPath + "edkb08struktur.xml")
|
||||
Importdata.Tables(0).Columns.Add("dokumentid")
|
||||
Importdata.Tables(0).Columns.Add("blkunde")
|
||||
|
||||
m_partnernr = partnernr
|
||||
m_dokumenttypnr = dokumenttypnr
|
||||
m_dsrfilename = DSRFilename
|
||||
m_indexfilename = indexfilename
|
||||
m_dokumentid = dokumentid
|
||||
If blkunde = True Then m_blkunde = 1 Else m_blkunde = 0
|
||||
If generate_indexdata() Then
|
||||
Dim filePath As String = DSRFilename
|
||||
Dim slashPosition As Integer = filePath.LastIndexOf("\")
|
||||
Dim filenameOnly As String = filePath.Substring(slashPosition + 1)
|
||||
IO.File.Move(DSRFilename, edkb08dir + filenameOnly)
|
||||
|
||||
filePath = indexfilename
|
||||
slashPosition = filePath.LastIndexOf("\")
|
||||
filenameOnly = filePath.Substring(slashPosition + 1)
|
||||
IO.File.Move(indexfilename, edkb08dir + filenameOnly)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
LogEntry.Writelog(Log.Logtype.Debug, "Importdaten generieren Fehler: " + ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Public Function generate_indexdata()
|
||||
Try
|
||||
Dim dr As DataRow
|
||||
Dim i As Integer = 0
|
||||
|
||||
dr = Importdata.Tables(0).NewRow
|
||||
|
||||
Try
|
||||
While i < 40
|
||||
dr.Item(i) = ""
|
||||
i = i + 1
|
||||
End While
|
||||
Catch
|
||||
|
||||
End Try
|
||||
dr.Item("Funktion") = "ADD"
|
||||
dr.Item("PARTNERNR") = Me.m_partnernr.ToString
|
||||
dr.Item("Dokumenttypnr") = Me.m_dokumenttypnr.ToString
|
||||
|
||||
Dim filePath As String = Me.m_dsrfilename
|
||||
Dim slashPosition = filePath.LastIndexOf("\")
|
||||
Dim filenameOnly = filePath.Substring(slashPosition + 1)
|
||||
|
||||
dr.Item("dateiname") = filenameOnly
|
||||
dr.Item("Dateiformat") = "PDF"
|
||||
dr.Item("Archivdatum") = Now.ToString
|
||||
dr.Item("Ersteller") = "EDKB14"
|
||||
dr.Item("HERKUNFTSAPPLIKATION") = "EDKB14"
|
||||
dr.Item("Dokumentid") = Me.m_dokumentid
|
||||
'dr.Item("Dokumentidbdr") = ""
|
||||
If m_blkunde = 1 Then
|
||||
dr.Item("BLKunde") = "1"
|
||||
Else
|
||||
dr.Item("BLKunde") = "0"
|
||||
End If
|
||||
'dr.Item("Bezeichnung") = ""
|
||||
Importdata.Tables(0).Rows.Add(dr)
|
||||
Importdata.Tables(0).Rows(0).Delete()
|
||||
Importdata.Tables(0).AcceptChanges()
|
||||
Importdata.WriteXml(Me.m_indexfilename)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user