This commit is contained in:
SchreiberM
2016-07-18 14:29:33 +02:00
parent b9388d045a
commit b089c68613
37 changed files with 5975 additions and 2701 deletions

View File

@@ -104,21 +104,52 @@ Public Class ClassHelper
Return System.Text.RegularExpressions.Regex.Replace( _
sFilename, "[?*^""<>|]", REPLACEChar)
End Function
Public Shared Sub File_open(ByVal RESULT_DOC_PATH)
If RESULT_DOC_PATH <> Nothing Then
Try
Dim Proc As New System.Diagnostics.Process
Dim psi As New ProcessStartInfo(RESULT_DOC_PATH)
Proc.EnableRaisingEvents = True
Proc.StartInfo = psi
Proc.Start()
Catch ex As Exception
MsgBox("Unexpected Error in Open file:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Error in Open_File: " & ex.Message, True)
End Try
End If
End Sub
Public Shared Sub File_open(RESULT_DOC_PATH As Object, DocID As String)
Try
If RESULT_DOC_PATH <> Nothing Then
Dim EXT = Path.GetExtension(RESULT_DOC_PATH)
EXT = EXT.Replace(".", "")
Dim sql = String.Format("SELECT VIEWER FROM TBPMO_DOC_USER_VIEW WHERE USER_ID = {0} AND UPPER(FILE_EXTENSION) = UPPER('{1}')", USER_GUID, EXT)
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql)
If DT.Rows.Count = 1 Then
Select Case DT.Rows(0).Item("VIEWER")
Case "DOC_VIEW"
Try
Dim DocView
DocView = Nothing
DocView = CreateObject("WMPViewXNG.Viewer")
' open the viewer
Dim viewer_string = RESULT_DOC_PATH.Substring(2)
DocView.ViewFile(viewer_string)
CURRENT_DOCVIEW_PATH = viewer_string
CURRENT_DOCVIEW = DocView
Catch ex As Exception
MsgBox("Unexpected Error in DocView Open:" & vbNewLine & ex.Message & vbNewLine & RESULT_DOC_PATH & vbNewLine & "DocID: " & DocID, MsgBoxStyle.Critical)
ClassLogger.Add("Error in DocView Open: " & ex.Message & vbNewLine & " - Path: " & RESULT_DOC_PATH & " - DocID: " & DocID, True)
File_SYSOPEN(RESULT_DOC_PATH, DocID)
End Try
End Select
Else
File_SYSOPEN(RESULT_DOC_PATH, DocID)
End If
End If
Catch ex As Exception
MsgBox("Unexpected Error in File_open:" & vbNewLine & ex.Message & vbNewLine & RESULT_DOC_PATH & vbNewLine & "DocID: " & DocID, MsgBoxStyle.Critical)
ClassLogger.Add("Error in File_open: " & ex.Message & vbNewLine & " - Path: " & RESULT_DOC_PATH & " - DocID: " & DocID, True)
End Try
End Sub
Private Shared Sub File_SYSOPEN(RESULT_DOC_PATH As Object, DocID As String)
Try
If RESULT_DOC_PATH <> Nothing Then
End If
Catch ex As Exception
MsgBox("Unexpected Error in File_SYSOPEN:" & vbNewLine & ex.Message & vbNewLine & RESULT_DOC_PATH & vbNewLine & "DocID: " & DocID, MsgBoxStyle.Critical)
ClassLogger.Add("Error in File_SYSOPEN: " & ex.Message & vbNewLine & " - Path: " & RESULT_DOC_PATH & " - DocID: " & DocID, True)
End Try
End Sub
Shared Function Convert_Date_2_Form_Format(p1 As Date) As Date
Throw New NotImplementedException
End Function