MS ExportFiles SelectedPath and PRPM_GETFILENAME_EXPORT

This commit is contained in:
SchreiberM 2021-09-21 15:17:34 +02:00
parent 49840b12f7
commit c3c7ff5b38
4 changed files with 33 additions and 13 deletions

View File

@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.2.18.0")>
<Assembly: AssemblyVersion("2.2.19.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -136,11 +136,14 @@ Public Class clsPatterns
End While
While ContainsPatternAndValue(result, PATTERN_USER, VALUE_PROFILE_ID)
If IsNothing(CURRENT_CLICKED_PROFILE_ID) Then
CURRENT_CLICKED_PROFILE_ID = 0
End If
result = ReplacePattern(result, PATTERN_USER, CURRENT_CLICKED_PROFILE_ID)
End While
While ContainsPatternAndValue(result, PATTERN_USER, VALUE_PROFILE_TITLE)
If CURRENT_CLICKED_PROFILE_TITLE Is Nothing Then
CURRENT_CLICKED_PROFILE_TITLE = "EXCEPTIONTitleNothing"
CURRENT_CLICKED_PROFILE_TITLE = "NONE_TITLE"
End If
result = ReplacePattern(result, PATTERN_USER, CURRENT_CLICKED_PROFILE_TITLE)
End While

View File

@ -719,7 +719,9 @@ Public Class frmMain
Await Load_single_Profile(True)
GridView_Docs.HideLoadingPanel()
TimerRefresh.Start()
Else
CURRENT_CLICKED_PROFILE_TITLE = Nothing
CURRENT_CLICKED_PROFILE_ID = Nothing
End If
End If
ElseIf _tag = "OVERVIEW" Then
@ -1463,20 +1465,18 @@ Public Class frmMain
If oHitProfilID > 0 Then
CURRENT_CLICKED_PROFILE_ID = oHitProfilID
End If
End If
If Not IsNothing(CURRENT_CLICKED_PROFILE_ID) And IsNumeric(CURRENT_CLICKED_PROFILE_ID) Then
LOGGER.Debug($"Item_Scope: Not IsNothing(PROFIL_ID) And IsNumeric(PROFIL_ID)")
Dim expression As String
expression = "PROFILE_ID = " & CURRENT_CLICKED_PROFILE_ID
Dim oExpression As String
oExpression = "PROFILE_ID = " & CURRENT_CLICKED_PROFILE_ID
If hitInfo.InGroupRow Or (startedFrom = "CMGROUP" And hitInfo.InDataRow) Then
CURRENT_JUMP_DOC_GUID = 0
CURRENT_DOC_GUID = 0
CURRENT_ProfilGUID = CURRENT_CLICKED_PROFILE_ID
LOGGER.Debug($"Item_Scope: hitInfo.InGroupRow...oHitProfilID [{CURRENT_CLICKED_PROFILE_ID}]")
Load_Profil_from_Grid(CURRENT_CLICKED_PROFILE_ID)
ElseIf hitInfo.InDataRow Then
LOGGER.Debug($"Item_Scope: hitInfo.InDataRow...")
Dim oFocusedDocGUID
@ -1515,7 +1515,7 @@ Public Class frmMain
DOC_PATH = DOC_PATH.Replace("W:\", "\\windream\objects\")
DOC_PATH = DOC_PATH.Replace("K:\", "\\windream\objects\")
'Checking if table really contains one record with profile-id and docid
expression = expression & " AND DocID = " & oFocusedDocID
oExpression = oExpression & " AND DocID = " & oFocusedDocID
'Dim TEMP_TABLE = CURR_DT_OVERVIEW
'Dim foundRows() As DataRow
'foundRows = TEMP_TABLE.Select(expression)

View File

@ -3684,7 +3684,7 @@ Public Class frmValidator
Try
If ButtonExport2Folder_RootFolder <> "" Then
If Directory.Exists(ButtonExport2Folder_RootFolder) Then
FolderBrowserDialog1.RootFolder = ButtonExport2Folder_RootFolder
FolderBrowserDialog1.SelectedPath = ButtonExport2Folder_RootFolder
Else
LOGGER.Warn($"### Dis/Enabale Export2Path - RootFolder {ButtonExport2Folder_RootFolder} not existing or accessible!###")
End If
@ -5644,21 +5644,38 @@ Public Class frmValidator
Private Sub barbtnitmExport_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles barbtnitmExport.ItemClick
If File.Exists(WMDocPathWindows) Then
Try
d
Dim oFilenameOnly As String
Dim oExtension As String
Dim oTargetPath As String
If FolderBrowserDialog1.ShowDialog = DialogResult.OK Then
Dim oCount As Integer = 0
oFilenameOnly = Path.GetFileName(WMDocPathWindows)
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oFilenameOnly
oExtension = Path.GetExtension(WMDocPathWindows)
Dim oSQLGetFilename As String
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbNewLine &
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbNewLine &
"SELECT Filename"
Dim oExportFilename = Database_ECM.GetScalarValue(oSQLGetFilename)
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
File.Copy(WMDocPathWindows, oTargetPath)
oCount += 1
Dim oFileCount As Integer = 1
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")
Dim oDocID = oFileRecord.Item("DocID")
If File.Exists(oFromFilename) Then
oFilenameOnly = Path.GetFileName(oFromFilename)
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oFilenameOnly
oFileCount += 1
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbNewLine &
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbNewLine &
"SELECT Filename"
oExportFilename = Database_ECM.GetScalarValue(oSQLGetFilename)
oExtension = Path.GetExtension(oFromFilename)
'oFilenameOnly = Path.GetFileName(oFromFilename)
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
File.Copy(oFromFilename, oTargetPath)
oCount += 1
End If