MS V2.7 .Net Logger etc
This commit is contained in:
@@ -1,10 +1,35 @@
|
||||
Imports DevExpress.Utils
|
||||
Imports System.Text
|
||||
Imports System.IO
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Public Class frmGlobalSearch
|
||||
|
||||
Inherits Form
|
||||
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)>
|
||||
Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
|
||||
End Function
|
||||
Public Structure SHELLEXECUTEINFO
|
||||
Public cbSize As Integer
|
||||
Public fMask As Integer
|
||||
Public hwnd As IntPtr
|
||||
<MarshalAs(UnmanagedType.LPTStr)> Public lpVerb As String
|
||||
<MarshalAs(UnmanagedType.LPTStr)> Public lpFile As String
|
||||
<MarshalAs(UnmanagedType.LPTStr)> Public lpParameters As String
|
||||
<MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String
|
||||
Dim nShow As Integer
|
||||
Dim hInstApp As IntPtr
|
||||
Dim lpIDList As IntPtr
|
||||
<MarshalAs(UnmanagedType.LPTStr)> Public lpClass As String
|
||||
Public hkeyClass As IntPtr
|
||||
Public dwHotKey As Integer
|
||||
Public hIcon As IntPtr
|
||||
Public hProcess As IntPtr
|
||||
End Structure
|
||||
Private Const SEE_MASK_INVOKEIDLIST = &HC
|
||||
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
|
||||
Private Const SEE_MASK_FLAG_NO_UI = &H400
|
||||
Public Const SW_SHOW As Short = 5
|
||||
Private _Helper As ClassHelper
|
||||
Dim sel_Records, sel_FT As String
|
||||
Private Sub tsbtnRefresh_Click(sender As Object, e As EventArgs) Handles tsbtnRefresh.Click
|
||||
@@ -52,10 +77,10 @@ Public Class frmGlobalSearch
|
||||
Sub PREPARE_FT_SQL()
|
||||
Dim sqlft = SQL_FULLTEXT
|
||||
sqlft = sqlft.Replace("@FULLTEXT", txtSearch.Text)
|
||||
Dim selDoc = String.Format("SELECT [DocID],[FULL_FILENAME],[Filename],[DISPLAY_NAME],[Doctype],[Creation_DateTime] As CreatedWhen,[Change_DateTime] as ChangedWhen,[IN_WORK] as [InWork?] " &
|
||||
"FROM VWPMO_DOC_SEARCH where DocID in " & vbNewLine &
|
||||
"({0}) " & vbNewLine &
|
||||
"AND DocID IN (SELECT dwObjectID FROM VWPMO_WD_OBJECT_RIGHTS WHERE dwUserOrGroupID = {1})", sqlft, USERID_FK_INT_ECM)
|
||||
Dim selDoc = String.Format("SELECT T.[DocID],T.[FULL_FILENAME],T.[Filename],T.[DISPLAY_NAME],T.[Doctype],T.[Creation_DateTime] As CreatedWhen,T.[Change_DateTime] as ChangedWhen,T.[IN_WORK] as [InWork?] " &
|
||||
"FROM VWPMO_DOC_SEARCH T INNER JOIN ( " & vbNewLine &
|
||||
"{0}) Y ON T.DocID = Y.dwDocID " & vbNewLine &
|
||||
"INNER JOIN VWPMO_WD_OBJECT_RIGHTS TRIGHT ON T.DocID = TRIGHT.dwObjectID WHERE TRIGHT.dwUserOrGroupID = {1}", sqlft, USERID_FK_INT_ECM)
|
||||
sel_FT = selDoc
|
||||
|
||||
End Sub
|
||||
@@ -183,20 +208,7 @@ Public Class frmGlobalSearch
|
||||
End Sub
|
||||
|
||||
Private Sub GridControlFiles_DoubleClick(sender As Object, e As EventArgs) Handles GridControlFiles.DoubleClick
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
|
||||
For Each row In GridViewFiles.GetSelectedRows
|
||||
Dim SELECTED_DOC_PATH = _Helper.FORMAT_WM_PATH(GridViewFiles.GetRowCellValue(row, "FULL_FILENAME"))
|
||||
Dim SELECTED_DOC_ID = GridViewFiles.GetRowCellValue(row, "DocID")
|
||||
If IsNothing(SELECTED_DOC_PATH) Then
|
||||
MsgBox("Could not read File Parameters!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ClassHelper.File_open(SELECTED_DOC_PATH, SELECTED_DOC_ID)
|
||||
|
||||
Next
|
||||
Me.Cursor = Cursors.Default
|
||||
File_open()
|
||||
End Sub
|
||||
Sub Save_DocGrid_Layout()
|
||||
Try
|
||||
@@ -256,4 +268,83 @@ Public Class frmGlobalSearch
|
||||
Load_DocGrid_Layout()
|
||||
Load_RecordGrid_Layout()
|
||||
End Sub
|
||||
Sub Show_File_Properties()
|
||||
Try
|
||||
For Each row In GridViewFiles.GetSelectedRows
|
||||
Dim SELECTED_DOC_PATH = _Helper.FORMAT_WM_PATH(GridViewFiles.GetRowCellValue(row, "FULL_FILENAME"))
|
||||
Dim SELECTED_DOC_ID = GridViewFiles.GetRowCellValue(row, "DocID")
|
||||
|
||||
Cursor = Cursors.WaitCursor
|
||||
Dim sei As New SHELLEXECUTEINFO
|
||||
sei.cbSize = Marshal.SizeOf(sei)
|
||||
sei.lpVerb = "properties"
|
||||
sei.lpFile = SELECTED_DOC_PATH
|
||||
sei.nShow = SW_SHOW
|
||||
sei.fMask = SEE_MASK_INVOKEIDLIST
|
||||
If Not ShellExecuteEx(sei) Then
|
||||
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
|
||||
ClassHelper.MSGBOX_Handler("ERROR", "Unexpected Error", "Error in Open file propertys:", ex.Message)
|
||||
End If
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Sub Open_folder()
|
||||
Try
|
||||
For Each row In GridViewFiles.GetSelectedRows
|
||||
Dim SELECTED_DOC_PATH = _Helper.FORMAT_WM_PATH(GridViewFiles.GetRowCellValue(row, "FULL_FILENAME"))
|
||||
Dim SELECTED_DOC_ID = GridViewFiles.GetRowCellValue(row, "DocID")
|
||||
ClassHelper.Open_Folder(SELECTED_DOC_PATH, SELECTED_DOC_ID)
|
||||
|
||||
ClassHelper.File_open(SELECTED_DOC_PATH, SELECTED_DOC_ID)
|
||||
|
||||
Next
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GridControlRecords_DoubleClick(sender As Object, e As EventArgs) Handles GridControlRecords.DoubleClick
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
|
||||
File_open()
|
||||
End Sub
|
||||
|
||||
Private Sub OrdnerÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OrdnerÖffnenToolStripMenuItem.Click
|
||||
Open_folder()
|
||||
End Sub
|
||||
|
||||
Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenToolStripMenuItem.Click
|
||||
Show_File_Properties()
|
||||
End Sub
|
||||
|
||||
Sub File_open()
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
|
||||
For Each row In GridViewFiles.GetSelectedRows
|
||||
Dim SELECTED_DOC_PATH = _Helper.FORMAT_WM_PATH(GridViewFiles.GetRowCellValue(row, "FULL_FILENAME"))
|
||||
Dim SELECTED_DOC_ID = GridViewFiles.GetRowCellValue(row, "DocID")
|
||||
If IsNothing(SELECTED_DOC_PATH) Then
|
||||
MsgBox("Could not read File Parameters!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ClassHelper.File_open(SELECTED_DOC_PATH, SELECTED_DOC_ID)
|
||||
|
||||
Next
|
||||
Me.Cursor = Cursors.Default
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user