Initial commit
This commit is contained in:
100
EDOKA_Toolset/Plugin_FiVo/Utils/DivFnkt.vb
Normal file
100
EDOKA_Toolset/Plugin_FiVo/Utils/DivFnkt.vb
Normal file
@@ -0,0 +1,100 @@
|
||||
Imports UtilityLibrary
|
||||
Imports System.IO
|
||||
Imports C1.Win.C1TrueDBGrid
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.ComponentModel
|
||||
Imports UtilityLibrary.Win32
|
||||
Imports System.Text
|
||||
Imports System.Xml
|
||||
Imports System.Threading
|
||||
|
||||
Namespace EDOKA
|
||||
|
||||
Public Class clsDivFnkt
|
||||
|
||||
Public Function Get_Filename(ByVal fi As String, ByVal partnernr As String) As String
|
||||
Dim s As String
|
||||
Get_Filename = ""
|
||||
s = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("logisches_Laufwerk") & Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_dokumente") + "\"
|
||||
Get_Filename = s + fi
|
||||
End Function
|
||||
|
||||
Public Function ExtractFilename(ByVal x As String) As String
|
||||
Dim splitter
|
||||
Dim i As Integer
|
||||
Dim Y As String
|
||||
splitter = Microsoft.VisualBasic.Split(x, "\")
|
||||
On Error Resume Next
|
||||
Err.Clear()
|
||||
i = -1
|
||||
While Err.Number = 0
|
||||
i = i + 1
|
||||
Y = splitter(i)
|
||||
End While
|
||||
ExtractFilename = Y
|
||||
End Function
|
||||
|
||||
Public Function XML_Param(ByVal Type As String) As String
|
||||
Dim xmldoc As New XmlDocument
|
||||
xmldoc.Load(Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_temporaer_dokumente") + "Office_2010.xml")
|
||||
Select Case UCase(Type)
|
||||
Case "WORD_1"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Word_1").InnerText
|
||||
Case "WORD_2"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Word_2").InnerText
|
||||
Case "WORD_3"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Word_3").InnerText
|
||||
Case "WORD_4"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Word_4").InnerText
|
||||
Case "EXCEL_1"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Excel_1").InnerText
|
||||
Case "EXCEL_2"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Excel_2").InnerText
|
||||
Case "EXCEL_3"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Excel_3").InnerText
|
||||
Case "EXCEL_4"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/Excel_4").InnerText
|
||||
Case "TKBMAKROLIB"
|
||||
Return xmldoc.SelectSingleNode("/Configuration/TKBMakroLib").InnerText
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
xmldoc = Nothing
|
||||
End Function
|
||||
|
||||
Public Sub show_office(ByVal dokumentid As String, ByVal formx As System.Windows.Forms.Form)
|
||||
Dim doc As New edokadb.clsDokument()
|
||||
Dim Dokument As String
|
||||
Dim FileReader As New DocMgmt()
|
||||
doc.cpMainConnectionProvider = conn
|
||||
doc.sDokumentid = New SqlString(CType(dokumentid, String))
|
||||
doc.SelectOne()
|
||||
Try
|
||||
Dokument = DivFnkt.Get_Filename("View_" + Format(Now, "yyyyMMddHHmmss") + "_" + doc.sDokumentname.Value, "")
|
||||
' Dokument = DivFnkt.Get_Filename(doc.sDokumentname.Value, "")
|
||||
If FileReader.Get_From_DB(doc.sDokumentid.Value, Dokument) = False Then
|
||||
doc.Dispose()
|
||||
FileReader = Nothing
|
||||
Exit Sub
|
||||
End If
|
||||
doc.Dispose()
|
||||
FileReader = Nothing
|
||||
|
||||
'Office_2010
|
||||
Process.Start(Dokument)
|
||||
Exit Sub
|
||||
Exit Sub
|
||||
Catch
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user