From 0a5439e413b27cc48019f5fd746e49ceac945e80 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Tue, 12 Jan 2021 17:25:58 +0100 Subject: [PATCH 1/2] MS --- GUIs.ZooFlow/ClassInit.vb | 13 +++ GUIs.ZooFlow/Globix/ClassFilehandle.vb | 4 +- GUIs.ZooFlow/Globix/GlobixControls.vb | 10 +- .../Globix/frmGlobix_Index.Designer.vb | 64 +++++------ GUIs.ZooFlow/Globix/frmGlobix_Index.vb | 100 ++++++++++-------- GUIs.ZooFlow/ModuleHelpers.vb | 3 + GUIs.ZooFlow/MyApplication.vb | 3 + GUIs.ZooFlow/ZooFlow.vbproj | 2 +- GUIs.ZooFlow/modCurrent.vb | 3 + Services.ZUGFeRDService/App.config | 3 + .../My Project/Settings.Designer.vb | 9 ++ .../My Project/Settings.settings | 3 + Services.ZUGFeRDService/ThreadRunner.vb | 1 + Services.ZUGFeRDService/ZUGFeRDService.vb | 2 +- 14 files changed, 129 insertions(+), 91 deletions(-) create mode 100644 GUIs.ZooFlow/modCurrent.vb diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index d8de737f..98397fcc 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -136,8 +136,20 @@ Public Class ClassInit My.Application.Globix.DT_FUNCTION_REGEX = My.Database.GetDatatable(oSql) oSql = "SELECT * FROM TBIDB_COMMON_SQL WHERE ACTIVE = 1" My.DTCOMMON_SQL = My.DatabaseIDB.GetDatatable(oSql) + oSql = "SELECT * FROM TBIDB_CATALOG" + My.DTCATALOG = My.DatabaseIDB.GetDatatable(oSql) + For Each oRow As DataRow In My.DTCATALOG.Rows + 'Console.WriteLine(oRow.Item("CAT_TITLE").ToString) + Select Case oRow.Item("CAT_TITLE").ToString + Case "FILESTORE_ARCHIVE" + My.Filestore_Archive = oRow.Item("CAT_STRING") + Case "FILESTORE_WORK" + My.Filestore_Work = oRow.Item("CAT_STRING") + My.Filestore_Work = "Q:\DigitalData - IDB" + End Select + Next Catch ex As Exception _Logger.Error(ex) Throw New InitException("Error in InitBasicData") @@ -302,6 +314,7 @@ Public Class ClassInit _Logger.Info($"Wrong WorkingMode: {oLine}") End If Next + End Select End Sub End Class diff --git a/GUIs.ZooFlow/Globix/ClassFilehandle.vb b/GUIs.ZooFlow/Globix/ClassFilehandle.vb index c32d573c..e95033cf 100644 --- a/GUIs.ZooFlow/Globix/ClassFilehandle.vb +++ b/GUIs.ZooFlow/Globix/ClassFilehandle.vb @@ -220,7 +220,7 @@ Public Class ClassFilehandle ''' Ersatzzeichen für alle unzulässigen Zeichen ''' im Dateinamen Public Function CleanFilename(ByVal sFilename As String, Optional ByVal REPLACEChar As String = "") As String - _LOGGER.Info(" >> Filename before CleanFilename: '" & sFilename & "'") + _LOGGER.Info(" Filename before CleanFilename: '" & sFilename & "'") If sFilename.Contains(".\") Then sFilename = sFilename.Replace(".\", "\") End If @@ -235,7 +235,7 @@ Public Class ClassFilehandle sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, "[\\/:*?""<>|\r\n]", "", System.Text.RegularExpressions.RegexOptions.Singleline) 'Dim oCleanFileName As String = String.Join(REPLACEChar, sFilename.Split(Path.GetInvalidFileNameChars())) Dim oCleanFileName As New System.IO.FileInfo(System.Text.RegularExpressions.Regex.Replace(sFilename, String.Format("[{0}]", String.Join(String.Empty, Path.GetInvalidFileNameChars)), REPLACEChar)) - _LOGGER.Info(" >> Filename after CleanFilename: '" & sFilename & "'") + _LOGGER.Info("Filename after CleanFilename: '" & sFilename & "'") Return sFilename End Function End Class diff --git a/GUIs.ZooFlow/Globix/GlobixControls.vb b/GUIs.ZooFlow/Globix/GlobixControls.vb index 6743eeb0..a498dbb8 100644 --- a/GUIs.ZooFlow/Globix/GlobixControls.vb +++ b/GUIs.ZooFlow/Globix/GlobixControls.vb @@ -78,7 +78,7 @@ Public Class GlobixControls .IndexType = DataType } } - oControl.Properties.AppearanceFocused.BackColor = Color.Lime + oControl.Properties.AppearanceFocused.BackColor = Color.LightGray If Not String.IsNullOrEmpty(Vorgabe) Then Dim oDefaultValues As New List(Of String) @@ -105,7 +105,7 @@ Public Class GlobixControls _Logger.Debug("Connection String (redacted): [{0}]", oConnectionString.Substring(0, 30)) If Patterns.HasComplexPatterns(oSql) Then - _Logger.Debug(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False) + _Logger.Debug("sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False) Else Dim oDatatable = My.Database.GetDatatableWithConnection(oSql, oConnectionString) oControl.DataSource = oDatatable @@ -157,7 +157,7 @@ Public Class GlobixControls Public Sub OncmbGotFocus(sender As System.Object, e As System.EventArgs) Dim cmb As ComboBox = sender - cmb.BackColor = Color.Lime + cmb.BackColor = Color.LightGray End Sub Public Sub OncmbLostFocus(sender As System.Object, e As System.EventArgs) @@ -333,7 +333,7 @@ Public Class GlobixControls Public Sub OnTextBoxFocus(sender As System.Object, e As System.EventArgs) Dim oTextbox As DevExpress.XtraEditors.TextEdit = sender - oTextbox.BackColor = Color.Lime + oTextbox.BackColor = Color.LightGray oTextbox.SelectAll() End Sub @@ -383,7 +383,7 @@ Public Class GlobixControls oPicker.EditValue = Vorgabe End If - oPicker.Properties.AppearanceFocused.BackColor = Color.Lime + oPicker.Properties.AppearanceFocused.BackColor = Color.LightGray Return oPicker End Function diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb index 3a9c830a..d88c92a4 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.Designer.vb @@ -39,7 +39,6 @@ Partial Class frmGlobix_Index Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() Me.BarHeaderItem1 = New DevExpress.XtraBars.BarHeaderItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() - Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroupMultiIndex = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -49,21 +48,22 @@ Partial Class frmGlobix_Index Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() Me.pnlIndex = New System.Windows.Forms.Panel() Me.Panel3 = New System.Windows.Forms.Panel() + Me.PictureEdit1 = New DevExpress.XtraEditors.PictureEdit() Me.Panel1 = New System.Windows.Forms.Panel() Me.Label1 = New System.Windows.Forms.Label() Me.cmbDoctype = New System.Windows.Forms.ComboBox() Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() - Me.PictureEdit1 = New DevExpress.XtraEditors.PictureEdit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.SuspendLayout() Me.Panel3.SuspendLayout() - Me.Panel1.SuspendLayout() CType(Me.PictureEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + Me.Panel1.SuspendLayout() Me.SuspendLayout() ' 'RibbonControl1 ' + Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified Me.RibbonControl1.ExpandCollapseItem.Id = 0 Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem2, Me.BarButtonItem3, Me.SkipItem, Me.BarButtonItem5, Me.checkItemTopMost, Me.SourceDeleteItem, Me.checkItemPreselection, Me.PreviewItem, Me.labelFilePath, Me.labelError, Me.labelNotice, Me.chkMultiindexing, Me.BarButtonItem1, Me.BarHeaderItem1}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) @@ -71,7 +71,8 @@ Partial Class frmGlobix_Index Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] - Me.RibbonControl1.Size = New System.Drawing.Size(1005, 158) + Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide + Me.RibbonControl1.Size = New System.Drawing.Size(1005, 66) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 ' 'BarButtonItem2 @@ -185,18 +186,10 @@ Partial Class frmGlobix_Index ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3, Me.RibbonPageGroup1, Me.RibbonPageGroupMultiIndex, Me.RibbonPageGroup2}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroupMultiIndex, Me.RibbonPageGroup2}) Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Text = "Start" ' - 'RibbonPageGroup3 - ' - Me.RibbonPageGroup3.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far - Me.RibbonPageGroup3.AllowTextClipping = False - Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem1) - Me.RibbonPageGroup3.Name = "RibbonPageGroup3" - Me.RibbonPageGroup3.Text = "Start" - ' 'RibbonPageGroup1 ' Me.RibbonPageGroup1.ItemLinks.Add(Me.SourceDeleteItem) @@ -224,10 +217,10 @@ Partial Class frmGlobix_Index Me.RibbonStatusBar1.ItemLinks.Add(Me.labelFilePath) Me.RibbonStatusBar1.ItemLinks.Add(Me.labelError) Me.RibbonStatusBar1.ItemLinks.Add(Me.labelNotice) - Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 572) + Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 574) Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 - Me.RibbonStatusBar1.Size = New System.Drawing.Size(1005, 24) + Me.RibbonStatusBar1.Size = New System.Drawing.Size(1005, 22) ' 'RibbonPage2 ' @@ -245,7 +238,7 @@ Partial Class frmGlobix_Index ' Me.SplitContainerControl1.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2 Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 158) + Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 66) Me.SplitContainerControl1.Name = "SplitContainerControl1" Me.SplitContainerControl1.Panel1.Controls.Add(Me.pnlIndex) Me.SplitContainerControl1.Panel1.Controls.Add(Me.Panel3) @@ -253,7 +246,7 @@ Partial Class frmGlobix_Index Me.SplitContainerControl1.Panel1.Text = "Panel1" Me.SplitContainerControl1.Panel2.Controls.Add(Me.DocumentViewer1) Me.SplitContainerControl1.Panel2.Text = "Panel2" - Me.SplitContainerControl1.Size = New System.Drawing.Size(1005, 414) + Me.SplitContainerControl1.Size = New System.Drawing.Size(1005, 508) Me.SplitContainerControl1.SplitterPosition = 591 Me.SplitContainerControl1.TabIndex = 2 ' @@ -262,18 +255,31 @@ Partial Class frmGlobix_Index Me.pnlIndex.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlIndex.Location = New System.Drawing.Point(0, 50) Me.pnlIndex.Name = "pnlIndex" - Me.pnlIndex.Size = New System.Drawing.Size(591, 255) + Me.pnlIndex.Size = New System.Drawing.Size(591, 383) Me.pnlIndex.TabIndex = 3 ' 'Panel3 ' Me.Panel3.Controls.Add(Me.PictureEdit1) Me.Panel3.Dock = System.Windows.Forms.DockStyle.Bottom - Me.Panel3.Location = New System.Drawing.Point(0, 305) + Me.Panel3.Location = New System.Drawing.Point(0, 433) Me.Panel3.Name = "Panel3" - Me.Panel3.Size = New System.Drawing.Size(591, 109) + Me.Panel3.Size = New System.Drawing.Size(591, 75) Me.Panel3.TabIndex = 2 ' + 'PictureEdit1 + ' + Me.PictureEdit1.Dock = System.Windows.Forms.DockStyle.Fill + Me.PictureEdit1.EditValue = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.ZooFlow_25 + Me.PictureEdit1.Location = New System.Drawing.Point(0, 0) + Me.PictureEdit1.MenuManager = Me.RibbonControl1 + Me.PictureEdit1.Name = "PictureEdit1" + Me.PictureEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Office2003 + Me.PictureEdit1.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.[Auto] + Me.PictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom + Me.PictureEdit1.Size = New System.Drawing.Size(591, 75) + Me.PictureEdit1.TabIndex = 0 + ' 'Panel1 ' Me.Panel1.Controls.Add(Me.Label1) @@ -308,23 +314,12 @@ Partial Class frmGlobix_Index 'DocumentViewer1 ' Me.DocumentViewer1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DocumentViewer1.FileLoaded = False Me.DocumentViewer1.Location = New System.Drawing.Point(0, 0) Me.DocumentViewer1.Name = "DocumentViewer1" - Me.DocumentViewer1.Size = New System.Drawing.Size(404, 414) + Me.DocumentViewer1.Size = New System.Drawing.Size(404, 508) Me.DocumentViewer1.TabIndex = 0 ' - 'PictureEdit1 - ' - Me.PictureEdit1.Dock = System.Windows.Forms.DockStyle.Right - Me.PictureEdit1.EditValue = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.ZooFlow_25 - Me.PictureEdit1.Location = New System.Drawing.Point(384, 0) - Me.PictureEdit1.MenuManager = Me.RibbonControl1 - Me.PictureEdit1.Name = "PictureEdit1" - Me.PictureEdit1.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.[Auto] - Me.PictureEdit1.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom - Me.PictureEdit1.Size = New System.Drawing.Size(207, 109) - Me.PictureEdit1.TabIndex = 0 - ' 'frmGlobix_Index ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -341,9 +336,9 @@ Partial Class frmGlobix_Index CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.ResumeLayout(False) Me.Panel3.ResumeLayout(False) + CType(Me.PictureEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() Me.Panel1.ResumeLayout(False) Me.Panel1.PerformLayout() - CType(Me.PictureEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -370,7 +365,6 @@ Partial Class frmGlobix_Index Friend WithEvents chkMultiindexing As DevExpress.XtraBars.BarCheckItem Friend WithEvents RibbonPageGroupMultiIndex As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem - Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl Friend WithEvents Panel1 As Panel Friend WithEvents cmbDoctype As ComboBox diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb index 6442ec86..5971370a 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb @@ -10,11 +10,10 @@ Public Class frmGlobix_Index Public vPathFile As String Private MULTIFILES As Integer Private akttxtbox As TextBox - Dim DT_INDEXEMAN As DataTable Dim DT_DOKART As DataTable Public FormLoaded As Boolean = False Dim DropType As String - + Private DT_INDEXEMAN As DataTable Dim sql_history_INSERT_INTO As String Dim sql_history_Index_Values As String @@ -608,7 +607,7 @@ Public Class frmGlobix_Index End If End Sub - Private Sub BarButtonItem1_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick + Private Sub GlobixFlow() ClearError() ClearNotice() Me.Cursor = Cursors.WaitCursor @@ -676,7 +675,7 @@ Public Class frmGlobix_Index Private Function WORK_FILE() Try - Dim oSQL = $"SELECT * FROM VWDDINDEX_MAN WHERE DOK_ID = {My.Application.Globix.CURRENT_DOCTYPE_ID}" + Dim oSQL = $"SELECT * ,CONVERT(VARCHAR(512),'') As IndexValueGUI,CONVERT(VARCHAR(512),'') As IndexValue_File,CONVERT(Bit,0) as Indexed FROM VWDDINDEX_MAN WHERE DOK_ID = {My.Application.Globix.CURRENT_DOCTYPE_ID}" My.Application.Globix.CURR_DT_MAN_INDEXE = My.Database.GetDatatable(oSQL) _Logger.Debug("Manuelle Indexe geladen") @@ -742,13 +741,10 @@ Public Class frmGlobix_Index Function Name_Generieren() Try _Logger.Debug("#### Name_Generieren ####") - Dim sql As String = "select VERSION_DELIMITER, FILE_DELIMITER FROM TBDD_MODULES WHERE GUID = 1" + My.Application.Globix.FILE_DELIMITER = "~" + My.Application.Globix.VERSION_DELIMITER = "~" Dim oFilesystem As New DigitalData.Modules.Filesystem.File(_LogConfig) - Dim DT1 As DataTable = My.Database.GetDatatable(sql) - For Each row As DataRow In DT1.Rows - My.Application.Globix.FILE_DELIMITER = row.Item("FILE_DELIMITER") - My.Application.Globix.VERSION_DELIMITER = row.Item("VERSION_DELIMITER") - Next + Dim err As Boolean = False Dim folder_Created As Boolean = False @@ -761,8 +757,8 @@ Public Class frmGlobix_Index 'CURR_DOKART_OBJECTTYPE = DT.Rows(0).Item("OBJEKTTYP") My.Application.Globix.CURRENT_WORKFILE_EXTENSION = extension - 'oRAWZielordner = WINDREAM.GetNormalizedPath(My.Application.Globix.CURR_DT_DOCTYPE.Rows(0).Item("ZIEL_PFAD")) - oRAWZielordner = Path.Combine("\\windream\objects", oRAWZielordner) + oRAWZielordner = My.Application.Globix.CURR_DT_DOCTYPE.Rows(0).Item("ZIEL_PFAD") + '#### ' Regulären Ausdruck zum Auslesen der Indexe definieren @@ -1023,6 +1019,7 @@ Public Class frmGlobix_Index Return False End Try End Function + Private Function Private Function Write_Indizes() Try Dim indexierung_erfolgreich As Boolean = False @@ -1031,12 +1028,12 @@ Public Class frmGlobix_Index ' If DTMan.Rows.Count > 0 Then ' Dim Count As Integer = 0 ' For Each row As DataRow In DTMan.Rows - ' Dim idxvalue = row.Item("Indexwert") + ' Dim idxvalue = row.Item("IndexValueGUI") ' Dim indexname = row.Item("WD_INDEX").ToString ' _Logger.Debug($"Write_Indizes - Index [{indexname}]...") ' Dim optional_Index = CBool(row.Item("OPTIONAL")) - ' Dim indexiert = CBool(row.Item("Indexiert")) - ' If indexiert And idxvalue.ToString <> "" And idxvalue <> "EMPTY_OI" Then + ' Dim Indexed = CBool(row.Item("Indexed")) + ' If Indexed And idxvalue.ToString <> "" And idxvalue <> "EMPTY_OI" Then ' If indexname <> String.Empty Then ' If row.Item("SAVE_VALUE") = True Then ' 'Den Indexwert zwischenspeichern @@ -1047,7 +1044,7 @@ Public Class frmGlobix_Index ' If rowTemp.Item("Dokumentart") = row.Item("DOKUMENTART") And rowTemp.Item("Indexname") = row.Item("INDEXNAME") Then ' rowexists = True ' '......überschreiben - ' rowTemp.Item("Value") = row.Item("Indexwert") + ' rowTemp.Item("Value") = row.Item("IndexValueGUI") ' End If ' Next ' '.....ansonsten neu anlegen @@ -1055,7 +1052,7 @@ Public Class frmGlobix_Index ' Dim newRow As DataRow = DTTemp.NewRow() ' newRow("Dokumentart") = row.Item("DOKUMENTART").ToString ' newRow("Indexname") = row.Item("INDEXNAME").ToString - ' newRow("Value") = row.Item("Indexwert") + ' newRow("Value") = row.Item("IndexValueGUI") ' DTTemp.Rows.Add(newRow) ' End If ' End If @@ -1108,10 +1105,10 @@ Public Class frmGlobix_Index ' If DTAut.Rows.Count > 0 Then ' Dim Count As Integer = 0 ' For Each row As DataRow In DTAut.Rows - ' Dim indexiert = CBool(row.Item("Indexiert")) - ' Dim Indexvalue = row.Item("Indexwert").ToString + ' Dim Indexed = CBool(row.Item("Indexed")) + ' Dim Indexvalue = row.Item("IndexValueGUI").ToString ' Dim indexname = row.Item("INDEXNAME").ToString - ' If indexiert = True And Indexvalue <> "" Then + ' If Indexed = True And Indexvalue <> "" Then ' If Indexvalue <> "EMPTY_OI" Then ' _Logger.Info("Auto Indexname: " & indexname.ToString) ' _Logger.Info("Indexvalue: " & Indexvalue.ToString) @@ -1320,8 +1317,8 @@ Public Class frmGlobix_Index For Each oDataRow As DataRow In My.Application.Globix.CURR_DT_MAN_INDEXE.Rows If oDataRow.Item("INDEXNAME").ToString.ToLower = indexname.ToLower Then - Dim oIndexWert = oDataRow.Item("Indexwert") - Dim oIsIndexed = oDataRow.Item("Indexiert") + Dim oIndexWert = oDataRow.Item("IndexValueGUI") + Dim oIsIndexed = oDataRow.Item("Indexed") If oIsIndexed = True Then If oIndexWert.ToString <> String.Empty Then @@ -1355,24 +1352,24 @@ Public Class frmGlobix_Index Function GetManIndex_Value(indexname As String, RequestFor As String, opt As Boolean) Try - For Each DR As DataRow In DT_INDEXEMAN.Rows + For Each DR As DataRow In My.Application.Globix.CURR_DT_MAN_INDEXE.Rows If DR.Item("INDEXNAME").ToString.ToLower = indexname.ToLower Then - If DR.Item("Indexiert") = True Then + If DR.Item("Indexed") = True Then _Logger.Info("## Manueller Index: " & indexname) Select Case RequestFor Case "FILE" - If DR.Item("Indexwert_File").ToString <> String.Empty Then - _Logger.Info(" >>Es liegt ein separater nachbearbeiteter Wert für die Dateibenennung vor: " & DR.Item("Indexwert_File").ToString) - _Logger.Info(" >>Zurückgegebener NachbearbeitungsWert: " & DR.Item("Indexwert_File")) - Return DR.Item("Indexwert_File") + If DR.Item("IndexValue_File").ToString <> String.Empty Then + _Logger.Info("Es liegt ein separater nachbearbeiteter Wert für die Dateibenennung vor: " & DR.Item("IndexValue_File").ToString) + _Logger.Info("Zurückgegebener NachbearbeitungsWert: " & DR.Item("IndexValue_File")) + Return DR.Item("IndexValue_File") Else - If DR.Item("Indexwert").ToString <> String.Empty Then - _Logger.Info("Zurückgegebener manueller Indexwert: " & DR.Item("Indexwert")) - Return DR.Item("Indexwert") + If DR.Item("IndexValueGUI").ToString <> String.Empty Then + _Logger.Info("Zurückgegebener manueller Indexwert: " & DR.Item("IndexValueGUI")) + Return DR.Item("IndexValueGUI") Else If opt = False Then _Logger.Info("Achtung, der Indexwert des manuellen Indexes '" & indexname & "' ist String.empty!") - ShowNotice("Indexiert = True - Der Index: " & DR.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert! - Automatischer Index konnte nicht gesetzt werden!") + ShowNotice("Indexed = True - Der Index: " & DR.Item("INDEXNAME") & " wurde nicht ordnungsgemäss indexiert! - Automatischer Index konnte nicht gesetzt werden!") Return Nothing Else Return "" @@ -1381,9 +1378,9 @@ Public Class frmGlobix_Index End If End If Case Else - If DR.Item("Indexwert").ToString <> String.Empty Then - _Logger.Info(" >>Zurückgegebener manueller Indexwert: " & DR.Item("Indexwert")) - Return DR.Item("Indexwert") + If DR.Item("IndexValueGUI").ToString <> String.Empty Then + _Logger.Info("Zurückgegebener manueller Indexwert: " & DR.Item("IndexValueGUI")) + Return DR.Item("IndexValueGUI") Else If opt = False Then @@ -1602,7 +1599,8 @@ Public Class frmGlobix_Index Function FillIndexe_Autom(dokart_id As Integer) Try - Dim oSQL = $"SELECT * FROM VWDDINDEX_AUTOM WHERE DOK_ID = {My.Application.Globix.CURRENT_DOCTYPE_ID}" + Dim oSQL = $"SELECT * FROM VWDDINDEX_AUTOM WHERE DOCTYPE_ID = {My.Application.Globix.CURRENT_DOCTYPE_ID}" + My.Application.Globix.CURR_DT_AUTO_INDEXE = My.Database.GetDatatable(oSQL) Dim oRegex As New Regex("\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}") @@ -1632,8 +1630,8 @@ Public Class frmGlobix_Index oValue = oPlaceholderResult End If - oAutoIndexRow.Item("Indexiert") = True - oAutoIndexRow.Item("Indexwert") = oValue + oAutoIndexRow.Item("Indexed") = True + oAutoIndexRow.Item("IndexValueGUI") = oValue Continue For End If @@ -1709,14 +1707,14 @@ Public Class frmGlobix_Index If oIsFirstMatch Then Exit For End If - oAutoIndexRow.Item("Indexiert") = True - oAutoIndexRow.Item("Indexwert") = String.Join(ClassConstants.VECTORSEPARATOR, oEndResult.ToArray) + oAutoIndexRow.Item("Indexed") = True + oAutoIndexRow.Item("IndexValueGUI") = String.Join(ClassConstants.VECTORSEPARATOR, oEndResult.ToArray) Next Else Dim oResult = GetAutomaticIndexSQLValue(oSqlResult, oSqlConnectionId, oSqlProvider) _Logger.Info("Got a simple SQLResult: " & oResult.ToString) - oAutoIndexRow.Item("Indexiert") = True - oAutoIndexRow.Item("Indexwert") = oResult + oAutoIndexRow.Item("Indexed") = True + oAutoIndexRow.Item("IndexValueGUI") = oResult End If Next @@ -1772,7 +1770,7 @@ Public Class frmGlobix_Index Dim idxid As Integer = oDataRow.Item("GUID") If idxid > 0 Then ' In jedem Fall schon mal den Wert einfügen - oDataRow.Item("Indexwert") = wert_in + oDataRow.Item("IndexValueGUI") = wert_in 'Die Nachbearbeitungsschritte laden 'FILE AND INDEX 'Zuerst nur die Fälle für die Variante ONLY FILE/FOLDER @@ -1781,8 +1779,8 @@ Public Class frmGlobix_Index If DTNB Is Nothing = False Then If DTNB.Rows.Count > 0 Then value_post = clsPostProcessing.Get_Nachbearbeitung_Wert(wert_in, DTNB) - oDataRow.Item("Indexwert") = wert_in - oDataRow.Item("Indexwert_File") = value_post + oDataRow.Item("IndexValueGUI") = value_post + oDataRow.Item("IndexValue_File") = value_post End If End If 'Jetzt die Fälle für die Variante FILE AND INDEX @@ -1793,11 +1791,11 @@ Public Class frmGlobix_Index If DTNB Is Nothing = False Then If DTNB.Rows.Count > 0 Then value_post = clsPostProcessing.Get_Nachbearbeitung_Wert(wert_in, DTNB) - oDataRow.Item("Indexwert") = value_post + oDataRow.Item("IndexValueGUI") = value_post End If End If End If - oDataRow.Item("Indexiert") = True + oDataRow.Item("Indexed") = True End If Next Catch ex As Exception @@ -1806,4 +1804,12 @@ Public Class frmGlobix_Index MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Indexwert_Postprocessing:") End Try End Sub + + Private Sub PictureEdit1_Click(sender As Object, e As EventArgs) Handles PictureEdit1.Click + GlobixFlow() + End Sub + + Private Sub PictureEdit1_EditValueChanged(sender As Object, e As EventArgs) Handles PictureEdit1.EditValueChanged + + End Sub End Class diff --git a/GUIs.ZooFlow/ModuleHelpers.vb b/GUIs.ZooFlow/ModuleHelpers.vb index b2e1b966..3c5f369e 100644 --- a/GUIs.ZooFlow/ModuleHelpers.vb +++ b/GUIs.ZooFlow/ModuleHelpers.vb @@ -58,6 +58,9 @@ Module ModuleHelpers End Sub Public Function FilterDatatable(myDatatable As DataTable, myFilter As String, mycheckColumn As String, pSortString As String, returnDT As Boolean) As Object Try + If myDatatable.Rows.Count = 0 Then + Return Nothing + End If Dim dv As DataView = myDatatable.DefaultView dv.RowFilter = myFilter If dv.Count = 1 And returnDT = False Then diff --git a/GUIs.ZooFlow/MyApplication.vb b/GUIs.ZooFlow/MyApplication.vb index 7e75cd0d..51d9fd64 100644 --- a/GUIs.ZooFlow/MyApplication.vb +++ b/GUIs.ZooFlow/MyApplication.vb @@ -27,6 +27,7 @@ Namespace My Property DTAttributes As DataTable Property DTCOMMON_SQL As DataTable + Property DTCATALOG As DataTable Property IDB_DT_DOC_DATA As DataTable Property LogConfig As LogConfig Property MainForm As frmAdministrationZooFlow @@ -34,6 +35,8 @@ Namespace My Property Database As MSSQLServer Property DatabaseIDB As MSSQLServer Property Queries As New ClassQueries + Property Filestore_Work As String + Property Filestore_Archive As String End Module ''' diff --git a/GUIs.ZooFlow/ZooFlow.vbproj b/GUIs.ZooFlow/ZooFlow.vbproj index 9dab32b8..706efe9b 100644 --- a/GUIs.ZooFlow/ZooFlow.vbproj +++ b/GUIs.ZooFlow/ZooFlow.vbproj @@ -114,13 +114,13 @@ + frmFlowSearch.vb Form - diff --git a/GUIs.ZooFlow/modCurrent.vb b/GUIs.ZooFlow/modCurrent.vb new file mode 100644 index 00000000..2ceafdb7 --- /dev/null +++ b/GUIs.ZooFlow/modCurrent.vb @@ -0,0 +1,3 @@ +Module modCurrent + +End Module diff --git a/Services.ZUGFeRDService/App.config b/Services.ZUGFeRDService/App.config index 24511ee3..d1dedcb9 100644 --- a/Services.ZUGFeRDService/App.config +++ b/Services.ZUGFeRDService/App.config @@ -43,6 +43,9 @@ 1 + + False + diff --git a/Services.ZUGFeRDService/My Project/Settings.Designer.vb b/Services.ZUGFeRDService/My Project/Settings.Designer.vb index 23e76424..0e2fefa7 100644 --- a/Services.ZUGFeRDService/My Project/Settings.Designer.vb +++ b/Services.ZUGFeRDService/My Project/Settings.Designer.vb @@ -152,6 +152,15 @@ Namespace My Return CType(Me("MSSQLEmailOutAccountID"),Integer) End Get End Property + + _ + Public ReadOnly Property DEBUG() As Boolean + Get + Return CType(Me("DEBUG"),Boolean) + End Get + End Property End Class End Namespace diff --git a/Services.ZUGFeRDService/My Project/Settings.settings b/Services.ZUGFeRDService/My Project/Settings.settings index 15771199..e84ed006 100644 --- a/Services.ZUGFeRDService/My Project/Settings.settings +++ b/Services.ZUGFeRDService/My Project/Settings.settings @@ -35,5 +35,8 @@ 1 + + False + \ No newline at end of file diff --git a/Services.ZUGFeRDService/ThreadRunner.vb b/Services.ZUGFeRDService/ThreadRunner.vb index 30adda68..d91d3e82 100644 --- a/Services.ZUGFeRDService/ThreadRunner.vb +++ b/Services.ZUGFeRDService/ThreadRunner.vb @@ -30,6 +30,7 @@ Public Class ThreadRunner Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing) _logConfig = LogConfig _logger = _logConfig.GetLogger() + _logConfig.Debug = My.Settings.DEBUG _firebird = Firebird _mssql = MSSQL Try diff --git a/Services.ZUGFeRDService/ZUGFeRDService.vb b/Services.ZUGFeRDService/ZUGFeRDService.vb index 70178aa2..23aeff07 100644 --- a/Services.ZUGFeRDService/ZUGFeRDService.vb +++ b/Services.ZUGFeRDService/ZUGFeRDService.vb @@ -13,7 +13,7 @@ Public Class ZUGFeRDService Protected Overrides Sub OnStart(ByVal args() As String) _logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, "Digital Data", "DDZUGFeRDService") - _logConfig.Debug = True + _logConfig.Debug = My.Settings.DEBUG _logger = _logConfig.GetLogger() Try Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory) From f78f3f84b0acf1e43a458351cce9cf463939f5f1 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Wed, 13 Jan 2021 13:23:34 +0100 Subject: [PATCH 2/2] MS INtegration AppServer Init --- GUIs.ZooFlow/ClassDataASorDB.vb | 92 ++++++++++++++++++++++++++ GUIs.ZooFlow/ClassInit.vb | 32 +++++++-- GUIs.ZooFlow/Globix/frmGlobix_Index.vb | 79 +++++++++++++++++++++- GUIs.ZooFlow/ModuleHelpers.vb | 1 + GUIs.ZooFlow/ZooFlow.vbproj | 1 + GUIs.ZooFlow/modCurrent.vb | 6 +- Modules.ZooFlow/State/UserState.vb | 1 + 7 files changed, 204 insertions(+), 8 deletions(-) create mode 100644 GUIs.ZooFlow/ClassDataASorDB.vb diff --git a/GUIs.ZooFlow/ClassDataASorDB.vb b/GUIs.ZooFlow/ClassDataASorDB.vb new file mode 100644 index 00000000..3b548371 --- /dev/null +++ b/GUIs.ZooFlow/ClassDataASorDB.vb @@ -0,0 +1,92 @@ +Imports DigitalData.Modules.EDMI.API.EDMIServiceReference +Imports DigitalData.Modules.Logging + +Public Class ClassDataASorDB + Private _Logger As Logger + Public Sub New(LogConfig As LogConfig) + _Logger = LogConfig.GetLogger + End Sub + Public Function GetDatatable(pDB As String, pSQL As String, pAppServDT As String, pAppServFilter As String, pAppServSort As String, Optional pForce As String = "") As DataTable + Try + Dim oReturnDT As DataTable + If My.Application.Service.IsActive = True And pForce = String.Empty Then + Try + Dim oTableResult As TableResult = _Client.GetDatatableByName(pAppServDT, pAppServFilter, pAppServSort) + oReturnDT = oTableResult.Table + If IsNothing(oReturnDT) Then + _Logger.Warn($"Datatable from ApPServData is nothing [{pAppServDT} - {pAppServFilter}] - Failover via DB") + Return GetDatatable(pDB, pSQL, "", "", "", "DB") + End If + Catch ex As Exception + _Logger.Warn($"Error getting ApPServData [{pAppServDT} - {pAppServFilter}]") + Return GetDatatable(pDB, pSQL, "", "", "", "DB") + End Try + Else + If pDB = "DD_ECM" Then + oReturnDT = My.Database.GetDatatable(pSQL) + ElseIf pDB = "IDB" Then + oReturnDT = My.DatabaseIDB.GetDatatable(pSQL) + End If + + End If + Return oReturnDT + Catch ex As Exception + _Logger.Error(ex) + End Try + End Function + + Public Function CheckModuleData() + Try + Dim oSql = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','CW',{1})", My.Application.User.UserName) + Dim DT_CHECKUSER_MODULE As DataTable + DT_CHECKUSER_MODULE = GetDatatable("DD_ECM", oSql, "TBDD_USER_MODULE", $"USERNAME = '{My.Application.User.UserName.ToLower}' AND MODULE_SHORT = 'CW'", "", "") + + If DT_CHECKUSER_MODULE.Rows.Count = 0 Then + _Logger.Info("DT_CHECKUSER_MODULE.Rows.Count = 0", True) + 'ERROR_STATE = "NO USER" + MsgBox("Sorry - Something went wrong in getting Your rights." & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation) + Return False + End If + If DT_CHECKUSER_MODULE.Rows.Count = 1 Then + _Logger.Info(">> Login Username: " & My.Application.User.UserName, False) + _Logger.Info(">> Login time: " & Now.ToString, False) + My.Application.User.UserId = DT_CHECKUSER_MODULE.Rows(0).Item("USER_ID") + My.Application.User.Surname = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_SURNAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_SURNAME")) + My.Application.User.GivenName = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_PRENAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_PRENAME")) + My.Application.User.ShortName = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_SHORTNAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_SHORTNAME")) + My.Application.User.Email = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_EMAIL")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_EMAIL")) + My.Application.User.Language = DT_CHECKUSER_MODULE.Rows(0).Item("USER_LANGUAGE") + My.Application.User.DateFormat = DT_CHECKUSER_MODULE.Rows(0).Item("USER_DATE_FORMAT") + + My.Application.User.IsAdmin = DT_CHECKUSER_MODULE.Rows(0).Item("IS_ADMIN") + ADDITIONAL_TITLE = DT_CHECKUSER_MODULE.Rows(0).Item("ADDITIONAL_TITLE") + If ADDITIONAL_TITLE = String.Empty Then + ADDITIONAL_TITLE = My.Application.Info.ProductName + End If + + Return True + Else + _Logger.Info(" - User '" & My.Application.User.UserName & "' not listed in Useradministration!", False) + 'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") + 'Me.Close() + Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.") + MsgBox(msg, MsgBoxStyle.Exclamation) + Return False + End If + Catch ex As Exception + _Logger.Error(ex) + Return False + End Try + + End Function + Public Sub Refresh_Connections() + Try + Dim oSql = String.Format("SELECT * FROM TBDD_CONNECTION") + Dim oResult As DataTable + DT_CONNECTIONS = GetDatatable("DD_ECM", oSql, "TBDD_CONNECTION", "", "", "") + Catch ex As Exception + _Logger.Error(ex) + MsgBox("Unexpected Error in Refresh_Connections: " & ex.Message, MsgBoxStyle.Critical) + End Try + End Sub +End Class diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index 98397fcc..708cc0ce 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -8,16 +8,20 @@ Imports DigitalData.GUIs.ZooFlow.ClassInitLoader Imports DigitalData.GUIs.ZooFlow.ClassConstants Imports System.Threading Imports System.Globalization +Imports DigitalData.Modules.EDMI.API Public Class ClassInit Private _MainForm As frmFlowForm Private _Logger As Logger - + Private _LogConfig As LogConfig Public Event Completed As EventHandler + Private _DataASorDB As ClassDataASorDB Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm) _MainForm = ParentForm _Logger = LogConfig.GetLogger() + _LogConfig = LogConfig + _DataASorDB = New ClassDataASorDB(LogConfig) End Sub Public Sub InitializeApplication() @@ -114,7 +118,7 @@ Public Class ClassInit Private Sub Initialize3rdParty(MyApplication As My.MyApplication) Try Dim oSql = "Select LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'" - Dim oDatatable As DataTable = My.Database.GetDatatable(oSql) + Dim oDatatable As DataTable = _DataASorDB.GetDatatable("DD_ECM", oSql, "TBDD_3RD_PARTY_MODULES", "", "") If oDatatable.Rows.Count = 0 Then Throw New InitException("Konfiguration konnte nicht geladen werden!") @@ -133,11 +137,11 @@ Public Class ClassInit Private Sub InitBasicData(MyApplication As My.MyApplication) Try Dim oSql = "SELECT * FROM TBGI_FUNCTION_REGEX" - My.Application.Globix.DT_FUNCTION_REGEX = My.Database.GetDatatable(oSql) + My.Application.Globix.DT_FUNCTION_REGEX = _DataASorDB.GetDatatable("DD_ECM", oSql, "TBGI_FUNCTION_REGEX", "", "") oSql = "SELECT * FROM TBIDB_COMMON_SQL WHERE ACTIVE = 1" - My.DTCOMMON_SQL = My.DatabaseIDB.GetDatatable(oSql) + My.DTCOMMON_SQL = _DataASorDB.GetDatatable("IDB", oSql, "TBIDB_COMMON_SQL", "", "") oSql = "SELECT * FROM TBIDB_CATALOG" - My.DTCATALOG = My.DatabaseIDB.GetDatatable(oSql) + My.DTCATALOG = _DataASorDB.GetDatatable("IDB", oSql, "TBIDB_CATALOG", "", "") For Each oRow As DataRow In My.DTCATALOG.Rows 'Console.WriteLine(oRow.Item("CAT_TITLE").ToString) Select Case oRow.Item("CAT_TITLE").ToString @@ -159,7 +163,23 @@ Public Class ClassInit Private Sub InitializeIDBService(MyApplication As My.MyApplication) Try MyApplication.Service.Address = My.SystemConfig.AppServerConfig - MyApplication.Service.IsActive = True + + Dim oSplit() As String = MyApplication.Service.Address.Split(":") + Dim oAppServerAddress As String = oSplit(0) + Dim oAppServerPort As Integer = 9000 + If oSplit.Length = 2 Then + oAppServerPort = oSplit(1) + End If + _Client = New Client(_LogConfig, oAppServerAddress, oAppServerPort) + If Not IsNothing(_Client) Then + If _Client.Connect() Then + MyApplication.Service.IsActive = True + + End If + End If + + + Catch ex As Exception _Logger.Error(ex) Throw New InitException("Error in InitBasicData") diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb index dbb6166d..de17d234 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb @@ -950,6 +950,8 @@ Public Class frmGlobix_Index Dim oExportSuccessful As Boolean = False 'Variable Folder If DropType = "|DROPFROMFSYSTEM|" Or DropType = "|OUTLOOK_ATTACHMENT|" Or DropType = "|ATTMNTEXTRACTED|" Or DropType = "|FW_SIMPLEINDEXER|" Then + Move_File(My.Application.Globix.CURRENT_WORKFILE, My.Application.Globix.CURRENT_NEWFILENAME, My.Application.Globix.CURRENT_WORKFILE_EXTENSION, My.Application.Globix.FILE_DELIMITER) + ' oExportSuccessful = SINGLEFILE_2_WINDREAM(My.Application.Globix.CURR_D) ElseIf DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Or DropType = "|MSGONLY|" Or DropType = "|FW_OUTLOOK_MESSAGE|" Then ' oExportSuccessful = SINGLEFILE_2_WINDREAM(CURR_DOKART_OBJECTTYPE) @@ -1020,7 +1022,82 @@ Public Class frmGlobix_Index Return False End Try End Function - Private Function + Private Function ImportFile2IDB() As Boolean + Try + If Move_File(My.Application.Globix.CURRENT_WORKFILE, My.Application.Globix.CURRENT_NEWFILENAME, My.Application.Globix.CURRENT_WORKFILE_EXTENSION, My.Application.Globix.VERSION_DELIMITER) = True Then + Dim oEXEC As String = $"EXEC PRIDB_ADD_DOC_FROM_FOLDER '{My.Application.Globix.CURRENT_NEWFILENAME}','{My.Application.User.UserName}'" + Dim oDTRESULT As DataTable = My.DatabaseIDB.GetDatatable(oEXEC) + If IsNothing(oDTRESULT) Then + Return False + Else + If oDTRESULT.Rows.Count = 0 Then + Return False + Else + My.Application.Globix.CURRENT_DOC_ID = oDTRESULT.Rows(0).Item(0) + Return True + End If + End If + End If + + + Catch ex As Exception + _Logger.Error(ex) + End Try + End Function + Function Move_File(Quelle As String, _NewFilename As String, extension As String, _versionTz As String) As Boolean + 'Überprüfen ob File existiert + If File.Exists(_NewFilename) = False Then + My.Application.Globix.CURRENT_NEWFILENAME = _NewFilename + Else + 'Versionieren + Dim version As Integer = 1 + Dim Stammname As String = _NewFilename + Dim neuername As String = _NewFilename + Do While File.Exists(neuername) + version = version + 1 + neuername = Stammname.Replace(extension, "") & _versionTz & version & extension + My.Application.Globix.CURRENT_NEWFILENAME = neuername + Loop + End If + 'Die Datei wird nun verschoben + If My.Application.Globix.CURR_DELETE_ORIGIN = True Then + My.Computer.FileSystem.MoveFile(My.Application.Globix.CURRENT_WORKFILE, My.Application.Globix.CURRENT_NEWFILENAME) + Else + My.Computer.FileSystem.CopyFile(My.Application.Globix.CURRENT_WORKFILE, My.Application.Globix.CURRENT_NEWFILENAME) + End If + + Dim Insert_String As String + Try + Dim tempCur_WF = My.Application.Globix.CURRENT_WORKFILE.Replace("'", "''") + Dim tempCur_New_FN = My.Application.Globix.CURRENT_NEWFILENAME.Replace("'", "''") + Insert_String = sql_history_INSERT_INTO & ",ADDED_WHO,ADDED_WHERE) VALUES ('" & tempCur_WF & "','" & tempCur_New_FN & "'" & sql_history_Index_Values & ",'" & Environment.UserDomainName & "\" & Environment.UserName & "','" & Environment.MachineName & "')" + If My.Database.ExecuteNonQuery(Insert_String) = True Then + If My.Application.Globix.CURRENT_MESSAGEID <> "" Then + Dim oMax As String = "SELECT MAX(GUID) FROM TBGI_HISTORY" + Dim oGUID = My.Database.GetScalarValue(oMax) + Try + If oGUID > 0 Then + Dim oSql As String + If My.Application.Globix.CURRENT_ISATTACHMENT = True Then + oSql = "Update TBGI_HISTORY SET ATTACHMENT = 1, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & oGUID + My.Database.GetScalarValue(oSql) + Else + oSql = "Update TBGI_HISTORY SET ATTACHMENT = 0, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & oGUID + My.Database.GetScalarValue(oSql) + End If + End If + Catch ex As Exception + + End Try + End If + End If + Return True + Catch ex As Exception + _Logger.Error(ex.Message) + _Logger.Warn(" - Unexpected error in Move_Rename - Insert_String: " & Insert_String) + Return False + End Try + End Function Private Function Write_Indizes() Try Dim indexierung_erfolgreich As Boolean = False diff --git a/GUIs.ZooFlow/ModuleHelpers.vb b/GUIs.ZooFlow/ModuleHelpers.vb index 3c5f369e..e266785e 100644 --- a/GUIs.ZooFlow/ModuleHelpers.vb +++ b/GUIs.ZooFlow/ModuleHelpers.vb @@ -2,6 +2,7 @@ Imports System.Text.RegularExpressions Module ModuleHelpers + ''' ''' Überprüft einen Wert auf verschiedene Arten von "Null" und gibt einen Standard-Wert zurück, wenn der Wert "Null" ist. ''' diff --git a/GUIs.ZooFlow/ZooFlow.vbproj b/GUIs.ZooFlow/ZooFlow.vbproj index 013afe23..fee39b72 100644 --- a/GUIs.ZooFlow/ZooFlow.vbproj +++ b/GUIs.ZooFlow/ZooFlow.vbproj @@ -114,6 +114,7 @@ + frmFlowSearch.vb diff --git a/GUIs.ZooFlow/modCurrent.vb b/GUIs.ZooFlow/modCurrent.vb index 2ceafdb7..8e102522 100644 --- a/GUIs.ZooFlow/modCurrent.vb +++ b/GUIs.ZooFlow/modCurrent.vb @@ -1,3 +1,7 @@ -Module modCurrent +Imports DigitalData.Modules.EDMI.API +Module modCurrent + Public _Client As Client + Public ADDITIONAL_TITLE As String + Public DT_CONNECTIONS As DataTable End Module diff --git a/Modules.ZooFlow/State/UserState.vb b/Modules.ZooFlow/State/UserState.vb index cd015f3a..e92f1ae0 100644 --- a/Modules.ZooFlow/State/UserState.vb +++ b/Modules.ZooFlow/State/UserState.vb @@ -14,6 +14,7 @@ Namespace State Public Property MachineName As String Public Property DateFormat As String Public Property Language As String + Public Property IsAdmin As Boolean = False Public Property HideBasicConfig As Boolean = False