This commit is contained in:
SchreiberM 2020-11-24 15:09:10 +01:00
commit 0ed9c57f4d
23 changed files with 773 additions and 822 deletions

View File

@ -89,6 +89,7 @@ Public Class Form1
Dim args As New WorkerArgs() Dim args As New WorkerArgs()
args = LoadFolderConfig(args) args = LoadFolderConfig(args)
args = LoadPropertyMapFor(args, "DEFAULT") args = LoadPropertyMapFor(args, "DEFAULT")
args.InsertIntoSQLServer = True
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, 1, _mssql) Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, 1, _mssql)

View File

@ -12,8 +12,8 @@ Public Class ClassCommandlineArgs
"start-search" "start-search"
} }
Private CommandLineArgTypeString As String = String.Join("|", CommandLineArgTypes) Private CommandLineArgTypeString As String = String.Join("|", CommandLineArgTypes)
Private CommandLineArgRegex As String = $"(?:-{{2}}(?:({CommandLineArgTypeString})+)=([a-zA-Z0-9~#]+)\s*)+" Private CommandLineArgRegex As String = $"(?:-{{2}}(?:({CommandLineArgTypeString})+)=([a-zA-Z0-9~|]+)\s*)+"
Private CommandLineArgParameterRegex As String = "(?:~{0,1}([\w\d-]+#[\w\d-]+))+" Private CommandLineArgParameterRegex As String = "(?:~{0,1}([\w\d-]+|[\w\d-]+))+"
Public FunctionName As String Public FunctionName As String
Public FunctionArgs As New Dictionary(Of String, String) Public FunctionArgs As New Dictionary(Of String, String)
@ -23,7 +23,7 @@ Public Class ClassCommandlineArgs
Public Sub New(pLogConfig As LogConfig) Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig LogConfig = pLogConfig
Logger = pLogConfig.GetLogger() Logger = LogConfig.GetLogger()
End Sub End Sub
Public Sub Parse(Args As List(Of String)) Public Sub Parse(Args As List(Of String))
@ -48,7 +48,7 @@ Public Class ClassCommandlineArgs
FunctionName = oParamName FunctionName = oParamName
For Each oValue As String In oParamValue.Split("~"c) For Each oValue As String In oParamValue.Split("~"c)
Dim oValueArray = oValue.Split("#"c).ToList Dim oValueArray = oValue.Split("|"c).ToList
FunctionArgs.Add(oValueArray.Item(0), oValueArray.Item(1)) FunctionArgs.Add(oValueArray.Item(0), oValueArray.Item(1))
Next Next
Else Else

View File

@ -13,4 +13,9 @@
Public Const MODULE_CLIPBOARDWATCHER = "CW" Public Const MODULE_CLIPBOARDWATCHER = "CW"
Public Const MODULE_GLOBAL_INDEXER = "GLOBIX" Public Const MODULE_GLOBAL_INDEXER = "GLOBIX"
Public Const MODULE_ZOOFLOW = "ZOOFLOW" Public Const MODULE_ZOOFLOW = "ZOOFLOW"
Public Const ATTR_TYPE_STRING = "VARCHAR"
Public Const ATTR_TYPE_INTEGER = "BIG INTEGER"
Public Const ATTR_TYPE_DATE = "DATE"
Public Const ATTR_TYPE_BOOLEAN = "BIT"
End Class End Class

View File

@ -1,9 +1,9 @@
Imports DevExpress.XtraEditors Imports DevExpress.XtraEditors
Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Grid Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraTab Imports DevExpress.XtraTab
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Public Class ClassControlCreator Public Class ClassControlCreator
@ -54,41 +54,30 @@ Public Class ClassControlCreator
Public Class ControlMetadata Public Class ControlMetadata
Public Guid As Integer Public Guid As Integer
Public AttrID As Integer Public AttributeID As Integer
Public DependingAttrID As Integer Public DependingAttributeID As Integer
Public Multiselect As Boolean Public Multiselect As Boolean
Public AttrTitle As String Public AttributeTitle As String
Public AttrType As String Public AttributeType As String
Public SourceSQL As String Public SourceSQL As String
Public DTSource As DataTable Public DTSource As DataTable
Public MinValue As String Public MinValue As String
Public MaxValue As String Public MaxValue As String
End Class End Class
Private Shared Function TransformDataRow(row As DataRow, pXPosition As Integer, pYPosition As Integer) As ControlDBProps Private Shared Function TransformDataRow(pRow As DataRow, pXPosition As Integer, pYPosition As Integer) As ControlDBProps
Dim oxPos As Integer = pXPosition Dim oxPos As Integer = pXPosition
Dim oYPos As Integer = pYPosition Dim oYPos As Integer = pYPosition
' Dim style As FontStyle = NotNull(row.Item("FONT_STYLE"), DEFAULT_FONT_STYLE) Dim oGuid As Integer = pRow.Item("GUID")
' Dim size As Single = NotNull(row.Item("FONT_SIZE"), DEFAULT_FONT_SIZE) Dim oName As String = pRow.Item("ATTRIBUTE_TITLE")
' Dim familyString As String = NotNull(row.Item("FONT_FAMILY"), DEFAULT_FONT_FAMILY)
'Dim family As FontFamily = New FontFamily(familyString)
Dim oGuid As Integer = row.Item("GUID")
Dim oName As String = row.Item("ATTRIBUTE_TITLE")
Dim oLocation As New Point(oxPos, oYPos) Dim oLocation As New Point(oxPos, oYPos)
'Dim oFont As New Font(family, size, style, GraphicsUnit.Point)
'Dim oColor As Color = IntToColor(NotNull(row.Item("FONT_COLOR"), DEFAULT_COLOR))
'Dim oReadOnly As Boolean = row.Item("READ_ONLY")
Return New ControlDBProps() With { Return New ControlDBProps() With {
.Guid = oGuid, .Guid = oGuid,
.Name = oName, .Name = oName,
.Location = oLocation} .Location = oLocation
'.Font = oFont, }
'.Color = oColor
End Function End Function
Public Function CreateBaseControl(ctrl As Control, pAttributeRow As DataRow, pXPosition As Integer, pYPosition As Integer) As Control Public Function CreateBaseControl(pControl As Control, pAttributeRow As DataRow, pXPosition As Integer, pYPosition As Integer) As Control
Try Try
Dim props As ControlDBProps = TransformDataRow(pAttributeRow, pXPosition, pYPosition) Dim props As ControlDBProps = TransformDataRow(pAttributeRow, pXPosition, pYPosition)
Dim oSourceSQL As String = pAttributeRow.Item("SOURCE_SQL").ToString Dim oSourceSQL As String = pAttributeRow.Item("SOURCE_SQL").ToString
@ -97,39 +86,38 @@ Public Class ClassControlCreator
oSourceSQL = oSourceSQL.Replace("@RESULT_TITLE", pAttributeRow.Item("ATTRIBUTE_TITLE").ToString) oSourceSQL = oSourceSQL.Replace("@RESULT_TITLE", pAttributeRow.Item("ATTRIBUTE_TITLE").ToString)
Dim oDTSource As DataTable Dim oDTSource As DataTable
'If pAttributeRow.Item("DEPENDING_ATTRIBUTE1") = 0 Then 'If pAttributeRow.Item("DEPENDING_ATTRIBUTE1") = 0 Then
oDTSource = My.DatabaseIDB.GetDatatable(oSourceSQL) If Utils.NotNull(oSourceSQL, String.Empty) <> String.Empty Then
oDTSource = My.DatabaseIDB.GetDatatable(oSourceSQL)
End If
'End If 'End If
Dim oMinValue As String = "" Dim oMinValue As String = ""
Dim oMaxValue As String = "" Dim oMaxValue As String = ""
If Not IsNothing(oDTSource) Then If Not IsNothing(oDTSource) Then
oMinValue = oDTSource.Rows(0).Item(0) oMinValue = oDTSource.Rows(0).Item(0)
oMaxValue = oDTSource.Rows(oDTSource.Rows.Count - 1).Item(0) oMaxValue = oDTSource.Rows(oDTSource.Rows.Count - 1).Item(0)
End If End If
'ctrl.Tag = New ControlMetadata() With {
Dim omyclass = New ControlMetadata() With { Dim oMetadata = New ControlMetadata() With {
.Guid = CType(pAttributeRow.Item("GUID"), Integer), .Guid = CType(pAttributeRow.Item("GUID"), Integer),
.AttrID = CType(pAttributeRow.Item("ATTRIBUTE_ID"), Integer), .AttributeID = CType(pAttributeRow.Item("ATTRIBUTE_ID"), Integer),
.DTSource = CType(oDTSource, DataTable), .DTSource = CType(oDTSource, DataTable),
.AttrTitle = CType(pAttributeRow.Item("ATTRIBUTE_TITLE"), String), .AttributeTitle = CType(pAttributeRow.Item("ATTRIBUTE_TITLE"), String),
.Multiselect = CType(pAttributeRow.Item("MULTISELECT"), Boolean), .Multiselect = CType(pAttributeRow.Item("MULTISELECT"), Boolean),
.SourceSQL = oSourceSQL, .SourceSQL = oSourceSQL,
.MinValue = oMinValue, .MinValue = oMinValue,
.MaxValue = oMaxValue .MaxValue = oMaxValue
} }
' If CInt(pAttributeRow.Item("DEPENDING_ATTRIBUTE1")) <> 0 Then
' omyclass.DTSource = Nothing pControl.Tag = oMetadata
'' Else pControl.Name = props.Name
' omyclass.DTSource = CType(oDTSource, DataTable) pControl.Location = props.Location
' End If pControl.Font = props.Font
ctrl.Tag = omyclass pControl.ForeColor = props.Color
ctrl.Name = props.Name
ctrl.Location = props.Location
ctrl.Font = props.Font
ctrl.ForeColor = props.Color
Return ctrl Return pControl
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
End Try End Try
@ -147,7 +135,7 @@ Public Class ClassControlCreator
oCheckBox.AutoSize = True oCheckBox.AutoSize = True
Try Try
oCheckBox.Text = pAttributeRow.Item("ATTRIBUTE_TITLE") oCheckBox.Text = pAttributeRow.Item("ATTRIBUTE_TITLE").ToString
Catch ex As Exception Catch ex As Exception
oCheckBox.Text = "NO CAPTION AVAILABLE" oCheckBox.Text = "NO CAPTION AVAILABLE"
End Try End Try
@ -163,13 +151,13 @@ Public Class ClassControlCreator
oDateControl.Properties.ShowWeekNumbers = True oDateControl.Properties.ShowWeekNumbers = True
oDateControl.Properties.ShowClear = True oDateControl.Properties.ShowClear = True
Try Try
Dim oMinDate As Date = DirectCast(oDateControl.Tag, ClassControlCreator.ControlMetadata).MinValue Dim oMinDate As Date = DirectCast(oDateControl.Tag, ControlMetadata).MinValue
oDateControl.Properties.MinValue = oMinDate oDateControl.Properties.MinValue = oMinDate
Catch ex As Exception Catch ex As Exception
End Try End Try
Try Try
Dim oMaxDate As Date = DirectCast(oDateControl.Tag, ClassControlCreator.ControlMetadata).MaxValue Dim oMaxDate As Date = DirectCast(oDateControl.Tag, ControlMetadata).MaxValue
oDateControl.Properties.MaxValue = oMaxDate oDateControl.Properties.MaxValue = oMaxDate
Catch ex As Exception Catch ex As Exception
@ -178,187 +166,103 @@ Public Class ClassControlCreator
Return oDateControl Return oDateControl
End Function End Function
Public Function CreateExistingGridControl(pAttributeRow As DataRow, pXPosition As Integer, pYPosition As Integer) As GridControl Public Function CreateExistingGridControl(pAttributeRow As DataRow, pXPosition As Integer, pYPosition As Integer) As GridControl
Dim oWatch1 As New Watch("Creating Base Control")
Dim oMyNewGridControl As GridControl = CreateBaseControl(New GridControl(), pAttributeRow, pXPosition, pYPosition) Dim oMyNewGridControl As GridControl = CreateBaseControl(New GridControl(), pAttributeRow, pXPosition, pYPosition)
Dim oDatatable As New DataTable Dim oDatatable As New DataTable
Dim oView As DevExpress.XtraGrid.Views.Grid.GridView Dim oView As GridView
oWatch1.Stop()
oWatch1 = New Watch("Configuring Grid")
oMyNewGridControl.ForceInitialize() oMyNewGridControl.ForceInitialize()
oMyNewGridControl.ContextMenu = Nothing
oMyNewGridControl.Size = New Size(CInt(pAttributeRow.Item("WIDTH")), DEFAULT_HEIGHT_GRIDVIEW)
'oMyNewGridControl.Size = New Size(CInt(pAttributeRow.Item("WIDTH")), CInt(pAttributeRow.Item("HEIGHT")))
oView = CType(oMyNewGridControl.MainView, GridView) oView = CType(oMyNewGridControl.MainView, GridView)
oView.OptionsView.ShowGroupPanel = False
oMyNewGridControl.ContextMenu = Nothing
oView.Appearance.EvenRow.BackColor = Color.PaleTurquoise oView.Appearance.EvenRow.BackColor = Color.PaleTurquoise
oView.OptionsBehavior.Editable = False oView.OptionsBehavior.Editable = False
oView.OptionsBehavior.ReadOnly = True oView.OptionsBehavior.ReadOnly = True
oView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False
oView.OptionsBehavior.AllowAddRows = False oView.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False
oView.OptionsBehavior.AllowDeleteRows = False
oView.OptionsView.NewItemRowPosition = NewItemRowPosition.None oView.OptionsView.NewItemRowPosition = NewItemRowPosition.None
oView.OptionsView.ShowAutoFilterRow = True oView.OptionsView.ShowAutoFilterRow = True
oView.OptionsView.EnableAppearanceEvenRow = True oView.OptionsView.EnableAppearanceEvenRow = True
oMyNewGridControl.Size = New Size(CInt(pAttributeRow.Item("WIDTH")), CInt(pAttributeRow.Item("HEIGHT"))) oView.OptionsView.ShowGroupPanel = False
If CType(pAttributeRow.Item("MULTISELECT"), Boolean) Then If CType(pAttributeRow.Item("MULTISELECT"), Boolean) Then
oView.OptionsSelection.MultiSelect = True oView.OptionsSelection.MultiSelect = True
oView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CheckBoxRowSelect oView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CheckBoxRowSelect
oView.OptionsSelection.CheckBoxSelectorColumnWidth = 20 oView.OptionsSelection.CheckBoxSelectorColumnWidth = 20
oMyNewGridControl.Size = New Size(CInt(pAttributeRow.Item("WIDTH") + 50), CInt(pAttributeRow.Item("HEIGHT"))) oMyNewGridControl.Size = New Size(CInt(pAttributeRow.Item("WIDTH") + 50), DEFAULT_HEIGHT_GRIDVIEW)
End If End If
'oView.Columns("TERM_ID").Visible = False
' Add and configure navigator to delete rows
oMyNewGridControl.UseEmbeddedNavigator = True
With oMyNewGridControl.EmbeddedNavigator.Buttons
.CancelEdit.Visible = False
.Edit.Visible = False
.EndEdit.Visible = False
.First.Visible = False
.Last.Visible = False
.Next.Visible = False
.NextPage.Visible = False
.PrevPage.Visible = False
.Prev.Visible = False
End With oWatch1.Stop()
oWatch1 = New Watch("Loading Datasource")
' Add and configure navigator to delete rows
'oMyNewGridControl.UseEmbeddedNavigator = True
'With oMyNewGridControl.EmbeddedNavigator.Buttons
' .CancelEdit.Visible = False
' .Edit.Visible = False
' .EndEdit.Visible = False
' .First.Visible = False
' .Last.Visible = False
' .Next.Visible = False
' .NextPage.Visible = False
' .PrevPage.Visible = False
' .Prev.Visible = False
'End With
GridTables.Clear() GridTables.Clear()
Dim oDTSource As DataTable = DirectCast(oMyNewGridControl.Tag, ControlMetadata).DTSource
'Dim oColumn = New DataColumn() With {
' .DataType = GetType(String),
' .ColumnName = pAttributeRow.Item("ATTRIBUTE_TITLE").ToString,
' .Caption = pAttributeRow.Item("ATTRIBUTE_TITLE").ToString,
' .ReadOnly = False
' }
'oDatatable.Columns.Add(oColumn)
'For Each oRow As DataRow In DT_MY_COLUMNS.Rows
' ' Create Columns in Datatable
' Dim oColumn = New DataColumn() With {
' .DataType = GetType(String),
' .ColumnName = pAttributeRow.Item("ATTRIBUTE_TITLE").ToString,
' .Caption = pAttributeRow.Item("ATTRIBUTE_TITLE").ToString,
' .ReadOnly = False
' }
' oDatatable.Columns.Add(oColumn)
' ' Fetch and cache Combobox results
' Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
' Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
' If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
' If oConnectionId > 0 And oSqlCommand <> "" Then
' Try
' Dim oComboboxDataTable As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
' GridTables.Add(oRow.Item("SPALTENNAME"), oComboboxDataTable)
' Catch ex As Exception
' Logger.Warn("Could not load data for column {0} in control {1}", oRow.Item("SPALTENNAME"), oControl.Name)
' Logger.Error(ex)
' End Try
' End If
' End If
'Next
Dim oDTSource As DataTable = DirectCast(oMyNewGridControl.Tag, ClassControlCreator.ControlMetadata).DTSource
oMyNewGridControl.DataSource = oDTSource oMyNewGridControl.DataSource = oDTSource
oView.PopulateColumns() oView.PopulateColumns()
oMyNewGridControl.RefreshDataSource() oMyNewGridControl.RefreshDataSource()
oMyNewGridControl.ForceInitialize() oMyNewGridControl.ForceInitialize()
'Try
' oView.Columns(0).Caption = "Existierende Werte"
'Catch ex As Exception
'End Try oWatch1.Stop()
'AddHandler oView.CustomRowCellEdit, Sub(sender As Object, e As CustomRowCellEditEventArgs)
' For Each oRow As DataRow In DT_MY_COLUMNS.Rows
' If oRow.Item("SPALTENNAME") = e.Column.FieldName Then
' If GridTables.ContainsKey(e.Column.FieldName) Then
' Dim oComboboxDataTable As DataTable = GridTables.Item(e.Column.FieldName)
' Dim oEditor As New RepositoryItemComboBox()
' Dim oItems As New List(Of String)
' AddHandler oEditor.Validating, Sub(_sender As ComboBoxEdit, _e As CancelEventArgs)
' If oItems.Contains(_sender.EditValue) Then
' _e.Cancel = False
' Else
' _e.Cancel = True
' End If
' End Sub
' For Each oRow2 As DataRow In oComboboxDataTable.Rows
' Dim oValue = oRow2.Item(0)
' Try
' oValue &= $" | {oRow2.Item(1)}"
' Catch ex As Exception
' End Try
' oEditor.Items.Add(oValue)
' oItems.Add(oValue)
' Next
' e.RepositoryItem = oEditor
' End If
' End If
' Next
' End Sub
'AddHandler oView.CellValueChanged, Sub(sender As Object, e As CellValueChangedEventArgs)
' Dim oValue = e.Value.ToString()
' Dim oView2 As GridView = TryCast(sender, GridView)
' If oValue.Contains(" | ") Then
' oValue = oValue.Split(" | ").ToList().Item(0)
' oView2.SetRowCellValue(e.RowHandle, e.Column, oValue)
' End If
' End Sub
Return oMyNewGridControl Return oMyNewGridControl
End Function End Function
Public Function AddCheckBox(indexname As String, y As Integer, vorbelegung As String, caption As String) Public Function AddCheckBox(pIndexname As String, y As Integer, pVorbelegung As String, pCaption As String) As CheckBox
Try Try
Dim value As Boolean = False Dim oValue As Boolean = False
Dim chk As New CheckBox Dim oCheckbox As New CheckBox With {
chk.Name = "chk" & indexname .Name = "chk" & pIndexname,
chk.Size = New Size(100, 27) .Size = New Size(100, 27),
chk.Location = New Point(11, y) .Location = New Point(11, y),
chk.Tag = New ControlMeta() With { .Tag = New ControlMeta() With {
.IndexName = indexname, .IndexName = pIndexname,
.IndexType = "BOOLEAN" .IndexType = "BOOLEAN"
}
} }
If caption <> "" Then If pCaption <> "" Then
chk.Text = caption oCheckbox.Text = pCaption
chk.Size = New Size(CInt(caption.Length * 15), 27) oCheckbox.Size = New Size(CInt(pCaption.Length * 15), 27)
End If End If
If Boolean.TryParse(vorbelegung, value) = False Then If Boolean.TryParse(pVorbelegung, oValue) = False Then
If vorbelegung = "1" Or vorbelegung = "0" Then If pVorbelegung = "1" Or pVorbelegung = "0" Then
chk.Checked = CBool(vorbelegung) oCheckbox.Checked = CBool(pVorbelegung)
Else Else
chk.Checked = False oCheckbox.Checked = False
End If End If
Else Else
chk.Checked = value oCheckbox.Checked = oValue
End If End If
AddHandler chk.CheckedChanged, AddressOf Checkbox_CheckedChanged AddHandler oCheckbox.CheckedChanged, AddressOf Checkbox_CheckedChanged
Return chk Return oCheckbox
Catch ex As Exception Catch ex As Exception
Logger.Info("Unhandled Exception in AddCheckBox: " & ex.Message) Logger.Info("Unhandled Exception in AddCheckBox: " & ex.Message)
Logger.Error(ex.Message) Logger.Error(ex.Message)
@ -370,107 +274,32 @@ Public Class ClassControlCreator
'PrepareDependingControl(sender) 'PrepareDependingControl(sender)
End Sub End Sub
'Public Function AddVorschlag_ComboBox(indexname As String, y As Integer, conid As Integer, sql_Vorschlag As String, Multiselect As Boolean, DataType As String, Optional Vorgabe As String = "", Optional AddNewValues As Boolean = False, Optional PreventDuplicateValues As Boolean = False, Optional SQLSuggestion As Boolean = False) As Control Function AddCombobox(indexname As String, y As Integer) As ComboBoxEdit
' Try Dim oCombobox As New ComboBoxEdit
' Dim oSql As String = sql_Vorschlag oCombobox.Name = "cmb" & indexname
' Dim oConnectionString As String oCombobox.AutoSize = True
' Dim oControl As New DigitalData.Controls.LookupGrid.LookupControl2 With { oCombobox.Size = New Size(300, 27)
' .Multiselect = Multiselect, oCombobox.Location = New Point(11, y)
' .AllowAddNewValues = AddNewValues,
' .PreventDuplicates = PreventDuplicateValues,
' .Location = New Point(11, y),
' .Size = New Size(300, 27),
' .Name = "cmbMulti" & indexname,
' .Tag = New ControlMeta() With {
' .IndexName = indexname,
' .IndexType = DataType
' }
' }
' oControl.Properties.AppearanceFocused.BackColor = Color.Lime
' If Not String.IsNullOrEmpty(Vorgabe) Then oCombobox.Tag = New ControlMeta() With {
' Dim oDefaultValues As New List(Of String)
' If Vorgabe.Contains(",") Then
' oDefaultValues = Vorgabe.
' Split(",").ToList().
' Select(Function(item) item.Trim()).
' ToList()
' Else
' oDefaultValues = Vorgabe.
' Split(ClassConstants.VECTORSEPARATOR).ToList().
' Select(Function(item) item.Trim()).
' ToList()
' End If
' oControl.SelectedValues = oDefaultValues
' End If
' AddHandler oControl.SelectedValuesChanged, AddressOf Lookup_SelectedValuesChanged
' oConnectionString = ClassFormFunctions.GetConnectionString(conid)
' If oConnectionString IsNot Nothing And oSql.Length > 0 And SQLSuggestion = True Then
' Logger.Debug("Connection String (redacted): [{0}]", oConnectionString.Substring(0, 30))
' If ClassPatterns.HasComplexPatterns(oSql) Then
' Logger.Debug(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False)
' Else
' Dim oDatatable = ClassDatabase.Return_Datatable_Combined(oSql, oConnectionString, False)
' oControl.DataSource = oDatatable
' End If
' Else
' Logger.Warn("Connection String for control [{0}] is empty!", oControl.Name)
' End If
' Return oControl
' Catch ex As Exception
' Logger.Info(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & indexname & " - Fehler: " & vbNewLine & ex.Message)
' Logger.Error(ex.Message)
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in AddVorschlag_ComboBox:")
' Return Nothing
' End Try
'End Function
'Private Sub Lookup_SelectedValuesChanged(sender As LookupControl2, SelectedValues As List(Of String))
' PrepareDependingControl(sender)
'End Sub
Function AddCombobox(indexname As String, y As Integer)
Dim cmb As New ComboBox
cmb.Name = "cmb" & indexname
cmb.AutoSize = True
cmb.Size = New Size(300, 27)
cmb.Location = New Point(11, y)
cmb.Tag = New ControlMeta() With {
.IndexName = indexname .IndexName = indexname
} }
AddHandler cmb.SelectedIndexChanged, AddressOf OncmbSIndexChanged AddHandler oCombobox.SelectedIndexChanged, AddressOf OncmbSIndexChanged
AddHandler cmb.GotFocus, AddressOf OncmbGotFocus AddHandler oCombobox.GotFocus, AddressOf OncmbGotFocus
AddHandler cmb.LostFocus, AddressOf OncmbLostFocus AddHandler oCombobox.LostFocus, AddressOf OncmbLostFocus
'AddHandler cmb.KeyDown, AddressOf OncmbKeyDown Return oCombobox
Return cmb
End Function End Function
'Public Sub OncmbKeyDown(sender As System.Object, e As System.EventArgs) Public Sub OncmbGotFocus(sender As Object, e As System.EventArgs)
' Dim cmb As ComboBox = sender Dim oCombobox As ComboBoxEdit = CType(sender, ComboBoxEdit)
oCombobox.BackColor = Color.Lime
' ' Verhindert, dass Auswahlliste und Autocompleteliste übereinander liegen
' If cmb.DroppedDown = True Then
' cmb.DroppedDown = False
' End If
'End Sub
Public Sub OncmbGotFocus(sender As System.Object, e As System.EventArgs)
Dim cmb As ComboBox = sender
cmb.BackColor = Color.Lime
End Sub End Sub
Public Sub OncmbLostFocus(sender As System.Object, e As System.EventArgs) Public Sub OncmbLostFocus(sender As Object, e As System.EventArgs)
Dim cmb As ComboBox = sender Dim oCombobox As ComboBoxEdit = CType(sender, ComboBoxEdit)
cmb.BackColor = Color.White oCombobox.BackColor = Color.White
End Sub End Sub
Public Sub OncmbSIndexChanged(sender As System.Object, e As System.EventArgs) Public Sub OncmbSIndexChanged(sender As System.Object, e As System.EventArgs)
@ -478,139 +307,20 @@ Public Class ClassControlCreator
Exit Sub Exit Sub
End If End If
Dim cmb As ComboBox = sender Dim oCombobox As ComboBoxEdit = CType(sender, ComboBoxEdit)
If cmb.SelectedIndex <> -1 Then If oCombobox.SelectedIndex <> -1 Then
If cmb.Text.Length > 15 Then If oCombobox.Text.Length > 15 Then
Dim g As Graphics = cmb.CreateGraphics Dim g As Graphics = oCombobox.CreateGraphics
cmb.Width = g.MeasureString(cmb.Text, cmb.Font).Width + 30 oCombobox.Width = CInt(g.MeasureString(oCombobox.Text, oCombobox.Font).Width + 30)
g.Dispose() g.Dispose()
End If End If
' Get_NextComboBoxResults(cmb)
SendKeys.Send("{TAB}") SendKeys.Send("{TAB}")
End If End If
End Sub End Sub
'Private Sub Get_NextComboBoxResults(cmb As ComboBox)
' Try
' Dim indexname = cmb.Name.Replace("cmb", "")
' Dim sql = "SELECT GUID,NAME,SQL_RESULT FROM TBDD_INDEX_MAN where SUGGESTION = 1 AND SQL_RESULT like '%@" & indexname & "%' and DOK_ID = " & CURRENT_DOKART_ID & " ORDER BY SEQUENCE"
' Dim DT As DataTable = ClassDatabase.Return_Datatable(sql, True)
' If Not IsNothing(DT) Then
' If DT.Rows.Count > 0 Then
' Dim cmbname = "cmb" & DT.Rows(0).Item("NAME")
' Renew_ComboboxResults(DT.Rows(0).Item("GUID"), indexname, cmb.Text)
' End If
' End If
' Catch ex As Exception
' MsgBox("Error in Get_NextComboBoxResults:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
' End Try
'End Sub
'Private Sub Renew_ComboboxResults(INDEX_GUID As Integer, SearchString As String, Resultvalue As String)
' Try
' Dim connectionString As String
' Dim sqlCnn As SqlConnection
' Dim sqlCmd As SqlCommand
' Dim adapter As New SqlDataAdapter
' Dim oracleConn As OracleConnection
' Dim oracleCmd As OracleCommand
' Dim oracleadapter As New OracleDataAdapter
' Dim NewDataset As New DataSet
' Dim i As Integer
' Dim DT_INDEX As DataTable = ClassDatabase.Return_Datatable("select * FROM TBDD_INDEX_MAN WHERE GUID = " & INDEX_GUID, True)
' If IsNothing(DT_INDEX) Then
' Exit Sub
' End If
' Dim conid = DT_INDEX.Rows(0).Item("CONNECTION_ID")
' Dim sql_result = DT_INDEX.Rows(0).Item("SQL_RESULT")
' Dim NAME = DT_INDEX.Rows(0).Item("NAME")
' If Not IsNothing(conid) And Not IsNothing(sql_result) And Not IsNothing(NAME) Then
' For Each ctrl As Control In Me.Panel.Controls
' If ctrl.Name = "cmb" & NAME.ToString Then
' Dim cmb As ComboBox = ctrl
' Dim sql As String = sql_result.ToString.ToUpper.Replace("@" & SearchString.ToUpper, Resultvalue)
' connectionString = ClassFormFunctions.GetConnectionString(conid)
' If connectionString Is Nothing = False Then
' 'SQL Befehl füllt die Auswahlliste
' If connectionString.Contains("Initial Catalog=") Then
' sqlCnn = New SqlConnection(connectionString)
' sqlCnn.Open()
' sqlCmd = New SqlCommand(sql, sqlCnn)
' adapter.SelectCommand = sqlCmd
' adapter.Fill(NewDataset)
' ElseIf connectionString.StartsWith("Data Source=") And connectionString.Contains("SERVICE_NAME") Then
' oracleConn = New OracleConnection(connectionString)
' ' Try
' oracleConn.Open()
' oracleCmd = New OracleCommand(sql, oracleConn)
' oracleadapter.SelectCommand = oracleCmd
' oracleadapter.Fill(NewDataset)
' End If
' If NewDataset.Tables(0).Rows.Count > 0 Then
' cmb.Items.Clear()
' 'Die Standargrösse definieren
' Dim newWidth As Integer = 300
' For i = 0 To NewDataset.Tables(0).Rows.Count - 1
' 'MsgBox(NewDataset.Tables(0).Rows(i).Item(0))
' cmb.Items.Add(NewDataset.Tables(0).Rows(i).Item(0))
' Try
' Dim text As String = NewDataset.Tables(0).Rows(i).Item(0)
' If text.Length > 15 Then
' Dim g As Graphics = cmb.CreateGraphics
' If g.MeasureString(text, cmb.Font).Width + 30 > newWidth Then
' newWidth = g.MeasureString(text, cmb.Font).Width + 30
' End If
' g.Dispose()
' End If
' Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Anpassung Breite ComboBox:")
' End Try
' Next
' cmb.Size = New Size(newWidth, 27)
' cmb.AutoCompleteSource = AutoCompleteSource.ListItems
' cmb.AutoCompleteMode = AutoCompleteMode.Suggest
' End If
' If connectionString.Contains("Initial Catalog=") Then
' Try
' adapter.Dispose()
' sqlCmd.Dispose()
' sqlCnn.Close()
' Catch ex As Exception
' End Try
' Else
' Try
' oracleadapter.Dispose()
' oracleCmd.Dispose()
' oracleConn.Close()
' Catch ex As Exception
' End Try
' End If
' End If
' End If
' Next
' End If
' Catch ex As Exception
' Logger.Info(" - Unvorhergesehener Unexpected error in Renew_ComboboxResults - Fehler: " & vbNewLine & ex.Message)
' Logger.Error(ex.Message)
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Renew_ComboboxResults:")
' End Try
'End Sub
Public Function AddTextBox(pAttrName As String, y As Integer, text As String, pAttrDataType As String) As DevExpress.XtraEditors.TextEdit Public Function AddTextBox(pAttrName As String, y As Integer, text As String, pAttrDataType As String) As DevExpress.XtraEditors.TextEdit
Dim oEdit As New DevExpress.XtraEditors.TextEdit With { Dim oEdit As New TextEdit With {
.Name = "txt" & pAttrName, .Name = "txt" & pAttrName,
.Size = New Size(260, 27), .Size = New Size(260, 27),
.Location = New Point(11, y), .Location = New Point(11, y),
@ -622,7 +332,7 @@ Public Class ClassControlCreator
Select Case pAttrDataType Select Case pAttrDataType
Case "INTEGER" Case "INTEGER"
oEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric oEdit.Properties.Mask.MaskType = Mask.MaskType.Numeric
oEdit.Properties.Mask.EditMask = "d" oEdit.Properties.Mask.EditMask = "d"
Console.WriteLine() Console.WriteLine()
End Select End Select
@ -640,26 +350,26 @@ Public Class ClassControlCreator
Return oEdit Return oEdit
End Function End Function
Public Sub OnTextBoxFocus(sender As System.Object, e As System.EventArgs) Public Sub OnTextBoxFocus(sender As Object, e As EventArgs)
Dim oTextbox As DevExpress.XtraEditors.TextEdit = sender Dim oTextbox As TextEdit = CType(sender, TextEdit)
oTextbox.BackColor = Color.Lime oTextbox.BackColor = Color.Lime
oTextbox.SelectAll() oTextbox.SelectAll()
End Sub End Sub
Public Sub OnTextBoxTextChanged(sender As System.Object, e As System.EventArgs) Public Sub OnTextBoxTextChanged(sender As Object, e As EventArgs)
Dim oTextbox As DevExpress.XtraEditors.TextEdit = sender Dim oTextbox As TextEdit = CType(sender, TextEdit)
Using oGraphics As Graphics = oTextbox.CreateGraphics() Using oGraphics As Graphics = oTextbox.CreateGraphics()
oTextbox.Width = oGraphics.MeasureString(oTextbox.Text, oTextbox.Font).Width + 15 oTextbox.Width = CInt(oGraphics.MeasureString(oTextbox.Text, oTextbox.Font).Width + 15)
End Using End Using
End Sub End Sub
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs) Public Sub OnTextBoxLostFocus(sender As Object, e As EventArgs)
Dim oTextbox As DevExpress.XtraEditors.TextEdit = sender Dim oTextbox As TextEdit = CType(sender, TextEdit)
oTextbox.BackColor = Color.White oTextbox.BackColor = Color.White
End Sub End Sub
Public Sub OnTextBoxKeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Public Sub OnTextBoxKeyUp(sender As Object, e As KeyEventArgs)
Dim oTextbox As DevExpress.XtraEditors.TextEdit = sender Dim oTextbox As TextEdit = CType(sender, TextEdit)
If oTextbox.Text = String.Empty Then If oTextbox.Text = String.Empty Then
Exit Sub Exit Sub
@ -675,8 +385,8 @@ Public Class ClassControlCreator
End Sub End Sub
Public Function AddDateTimePicker(indexname As String, y As Integer, DataType As String) As DevExpress.XtraEditors.DateEdit Public Function AddDateTimePicker(indexname As String, y As Integer, DataType As String) As DateEdit
Dim oPicker As New DevExpress.XtraEditors.DateEdit With { Dim oPicker As New DateEdit With {
.Name = "dtp" & indexname, .Name = "dtp" & indexname,
.Size = New Size(260, 27), .Size = New Size(260, 27),
.Location = New Point(11, y), .Location = New Point(11, y),
@ -689,105 +399,4 @@ Public Class ClassControlCreator
Return oPicker Return oPicker
End Function End Function
Sub OndtpChanged()
'offen was hier zu tun ist
End Sub
'Private Sub PrepareDependingControl(Control As Control)
' If TypeOf Control Is Label Then
' Exit Sub
' End If
' Try
' Dim oMeta = DirectCast(Control.Tag, ClassControls.ControlMeta)
' Dim oIndexName As String = oMeta.IndexName
' Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%'"
' Dim oDatatable As DataTable = ClassDatabase.Return_Datatable(oSQL)
' If Not IsNothing(oDatatable) Then
' Logger.Debug("Found [{0}] depending controls for [{1}]", oDatatable.Rows.Count, Control.Name)
' For Each oRow As DataRow In oDatatable.Rows
' Dim oControlName As String = NotNull(oRow.Item("NAME"), "")
' Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), -1)
' Dim oControlSql As String = NotNull(oRow.Item("SQL_RESULT"), "")
' If oConnectionId = -1 Or oControlSql = String.Empty Then
' Logger.Warn("Missing SQL Query or ConnectionId for Control [{0}]! Continuing.", oControlName)
' Continue For
' End If
' oControlSql = ClassPatterns.ReplaceUserValues(oControlSql, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_DOKART_ID)
' oControlSql = ClassPatterns.ReplaceInternalValues(oControlSql)
' oControlSql = ClassPatterns.ReplaceControlValues(oControlSql, Panel)
' Logger.Debug("SQL After Preparing: [{0}]", oControlSql)
' Logger.Debug("Setting new value for [{0}]", oControlName)
' SetDependingControlResult(oControlName, oControlSql, oConnectionId)
' Next
' End If
' Catch ex As Exception
' Logger.Error(ex)
' End Try
'End Sub
'Private Sub SetDependingControlResult(IndexName As String, SqlCommand As String, SqlConnectionId As Integer)
' Try
' If SqlCommand Is Nothing OrElse SqlCommand = String.Empty Then
' Logger.Warn("New Value for Index [{0}] could not be set. Supplied SQL is empty.")
' Exit Sub
' End If
' Dim oConnectionString = ClassFormFunctions.GetConnectionString(SqlConnectionId)
' Dim oDatatable As DataTable = ClassDatabase.Return_Datatable_CS(SqlCommand, oConnectionString)
' Dim oFoundControl As Control = Nothing
' For Each oControl As Control In Panel.Controls
' If TypeOf oControl Is Label Then
' Continue For
' End If
' Dim oMeta = DirectCast(oControl.Tag, ClassControls.ControlMeta)
' Dim oIndex As String = oMeta.IndexName
' If oIndex = IndexName Then
' oFoundControl = oControl
' Exit For
' End If
' Next
' If oFoundControl Is Nothing Then
' Logger.Warn("Depending Control for Index [{0}] not found!", IndexName)
' End If
' If oDatatable Is Nothing Then
' Logger.Warn("Error in SQL Command: {0}", SqlCommand)
' End If
' Select Case oFoundControl.GetType.Name
' Case GetType(DevExpress.XtraEditors.TextEdit).Name
' If oDatatable.Rows.Count > 0 Then
' Dim oFirstRow As DataRow = oDatatable.Rows.Item(0)
' If oFirstRow.ItemArray.Length > 0 Then
' Dim oValue = oFirstRow.Item(0).ToString()
' Logger.Debug("Setting Value for TextEdit [{0}]: [{1}]", oFoundControl.Name, oValue)
' DirectCast(oFoundControl, DevExpress.XtraEditors.TextEdit).Text = oValue
' End If
' End If
' Case GetType(LookupControl2).Name
' Logger.Debug("Setting Value for LookupControl [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
' DirectCast(oFoundControl, LookupControl2).DataSource = oDatatable
' Case GetType(ComboBox).Name
' Logger.Debug("Setting Value for Combobox [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
' DirectCast(oFoundControl, ComboBox).DataSource = oDatatable
' Case Else
' Logger.Debug("Could not set depending control result for [{0}]", oFoundControl.GetType.Name)
' End Select
' Catch ex As Exception
' Logger.Error(ex)
' End Try
'End Sub
End Class End Class

View File

@ -6,6 +6,8 @@ Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.GUIs.ZooFlow.ClassInitLoader Imports DigitalData.GUIs.ZooFlow.ClassInitLoader
Imports DigitalData.GUIs.ZooFlow.ClassConstants Imports DigitalData.GUIs.ZooFlow.ClassConstants
Imports System.Threading
Imports System.Globalization
Public Class ClassInit Public Class ClassInit
Private _MainForm As frmFlowForm Private _MainForm As frmFlowForm
@ -36,8 +38,9 @@ Public Class ClassInit
oInit.AddStep("Checking connectivity..", AddressOf CheckConnectivity, True) oInit.AddStep("Checking connectivity..", AddressOf CheckConnectivity, True)
oInit.AddStep("Initializing User..", AddressOf InitializeUser, True) oInit.AddStep("Initializing User..", AddressOf InitializeUser, True)
oInit.AddStep("Initializing IDB..", AddressOf InitializeIDB, True) oInit.AddStep("Initializing IDB..", AddressOf InitializeIDB, True)
oInit.AddStep("Loading 3rd-party licenses", AddressOf Initialize3rdParty, False) oInit.AddStep("Initializing Language..", AddressOf InitializeLanguage, False)
oInit.AddStep("Loading basic Configs", AddressOf InitBasicData, False) oInit.AddStep("Loading 3rd-party licenses..", AddressOf Initialize3rdParty, False)
oInit.AddStep("Loading Basic Configs..", AddressOf InitBasicData, False)
' === Init Schritte definieren ' === Init Schritte definieren
AddHandler oInit.ProgressChanged, AddressOf ProgressChanged AddHandler oInit.ProgressChanged, AddressOf ProgressChanged
@ -47,6 +50,17 @@ Public Class ClassInit
End If End If
End Sub End Sub
Private Sub InitializeLanguage(MyApplication As My.MyApplication)
Dim oLanguage = MyApplication.User.Language
Dim oDateFormat = MyApplication.User.DateFormat
Dim oCultureInfo As New CultureInfo(oLanguage)
oCultureInfo.DateTimeFormat.ShortDatePattern = oDateFormat
Thread.CurrentThread.CurrentCulture = oCultureInfo
Thread.CurrentThread.CurrentUICulture = oCultureInfo
CultureInfo.DefaultThreadCurrentCulture = oCultureInfo
CultureInfo.DefaultThreadCurrentUICulture = oCultureInfo
End Sub
Private Function SetupDatabase() As Boolean Private Function SetupDatabase() As Boolean
If My.SystemConfig.ConnectionString = String.Empty Then If My.SystemConfig.ConnectionString = String.Empty Then
Dim oResult = frmConfigDatabase.ShowDialog() Dim oResult = frmConfigDatabase.ShowDialog()

View File

@ -0,0 +1,217 @@
Imports DigitalData.Modules.Logging
Public Class frmGlobix_Index
#Region "+++++ Variablen ++++++"
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 Shared WDDirect As Boolean = False
Dim sql_history_INSERT_INTO As String
Dim sql_history_Index_Values As String
Private NewFileString As String
Private CancelAttempts As Integer = 0
Private Const MaxCancelAttempts = 2
Private Property ViewerString As String
Private Const TEXT_MISSING_INPUT = "Bitte vervollständigen Sie die Eingaben!"
Private _LogConfig As LogConfig
Private _Logger As Logger
Private clswindowLocation As ClassWindowLocation
#End Region
Public Sub New(LogConfig As LogConfig)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
_Logger = LogConfig.GetLogger()
_LogConfig = LogConfig
clswindowLocation = New ClassWindowLocation(_LogConfig)
End Sub
Private Sub frmGlobix_Index_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Abbruchzähler zurücksetzen
CancelAttempts = 0
My.Application.Globix.INDEXING_ACTIVE = True
Try
My.Application.Globix.CURRENT_ISATTACHMENT = False
DropType = My.Database.GetScalarValue("SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = " & My.Application.Globix.CURRENT_WORKFILE_GUID).ToString
My.Application.Globix.CURR_DELETE_ORIGIN = My.UIConfig.Globix.DeleteOriginalFile
SourceDeleteItem.Enabled = True
SourceDeleteItem.Checked = My.UIConfig.Globix.DeleteOriginalFile
My.Application.GDPictureLicense = My.Database.GetScalarValue("SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'")
DocumentViewer1.Init(_LogConfig, My.Application.GDPictureLicense)
If DropType Is Nothing Then
_Logger.Debug("File with Id [{0}] was not found in TBGI_FILES_USER. Exiting.", My.Application.Globix.CURRENT_WORKFILE_GUID)
CancelAttempts = MaxCancelAttempts
Close()
Else
My.Application.Globix.CURRENT_DROPTYPE = DropType.Replace("|", "")
If DropType.StartsWith("|FW") Then
' Eine Datei aus FolderWatch wird IMMER gelöscht, egal wie die Einstellung in der Config lautet
My.Application.Globix.CURR_DELETE_ORIGIN = True
SourceDeleteItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
ElseIf DropType.Contains("|OUTLOOK_MESSAGE|") Then
' Eine (DragDrop)-Outlook Nachricht wird NIE gelöscht, egal wie die Einstellung in der Config lautet
My.Application.Globix.CURR_DELETE_ORIGIN = False
SourceDeleteItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
Else
SourceDeleteItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
End If
If DropType = "|DROPFROMFSYSTEM|" Then
If My.Application.User.Language <> "de-DE" Then
Me.Text = "Indexing of dropped file"
Else
Me.Text = "Indexierung der gedroppten Datei"
End If
ElseIf DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Then
Select Case DropType
Case "|FW_MSGONLY|"
_Logger.Info(".msg-file from folderwatch")
If My.Application.User.Language <> "de-DE" Then
Me.Text = "Indexing of msg-File (without Attachments) - from Folderwatch"
Else
Me.Text = "Indexierung der msg-Datei (ohne Anhang) - aus Folderwatch"
End If
Case "|OUTLOOK_MESSAGE|"
_Logger.Info(".msg-file through dragdrop")
If My.Application.User.Language <> "de-DE" Then
Me.Text = "Indexing of msg-File (without Attachments)"
Else
Me.Text = "Indexierung der msg-Datei (ohne Anhang)"
End If
End Select
ElseIf DropType = "|MSGONLY|" Then
If My.Application.User.Language = "de-DE" Then
Me.Text = "Indexierung der msg-Datei (ohne Anhang)"
Else
Me.Text = "Indexing of msg-File (without Attachments)"
End If
ElseIf DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then
My.Application.Globix.CURRENT_ISATTACHMENT = True
If My.Application.User.Language = "de-DE" Then
Me.Text = "Indexierung eines Email-Attachments"
Else
Me.Text = "Indexing of email-Attachment"
End If
ElseIf DropType = "|FW_SIMPLEINDEXER|" Then
If My.Application.User.Language = "de-DE" Then
Me.Text = "Indexierung einer Folderwatch-Datei"
Else
Me.Text = "Indexing of Folderwatch-File"
End If
End If
labelFilePath.Caption = My.Application.Globix.CURRENT_WORKFILE
clswindowLocation.LoadFormLocationSize(Me)
SetFilePreview(My.UIConfig.Globix.FilePreview)
SplitContainerControl1.SplitterPosition = My.UIConfig.Globix.SplitterDistanceViewer
My.Application.Globix.DTTBGI_REGEX_DOCTYPE = My.Database.GetDatatable("SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID")
MULTIFILES = My.Database.GetScalarValue("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
My.Application.Globix.MULTIINDEXING_ACTIVE = False
If MULTIFILES > 0 Then
If My.Application.User.Language = "de-DE" Then
RibbonPageGroupMultiIndex.Text = "Alle nachfolgenden Dateien (" & MULTIFILES & ") identisch indexieren"
Else
RibbonPageGroupMultiIndex.Text = "All following files (" & MULTIFILES & ") will be indexed identically"
End If
chkMultiindexing.Checked = False
chkMultiindexing.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
Else
chkMultiindexing.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
End If
Catch ex As Exception
_Logger.Warn(" - Unexpected error in Öffnen des Formulares - Fehler: " & vbNewLine & ex.Message)
_Logger.Error(ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Öffnen des Formulares:")
End Try
End Sub
Private Sub SetFilePreview(ShowPreview As Boolean)
If ShowPreview Then
SplitContainerControl1.Collapsed = False
PreviewFile()
PreviewItem.Checked = True
Else
SplitContainerControl1.Collapsed = True
PreviewItem.Checked = False
End If
End Sub
Sub PreviewFile()
Try
DocumentViewer1.LoadFile(My.Application.Globix.CURRENT_WORKFILE)
Catch ex As Exception
_Logger.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in PreviewFile:")
End Try
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SourceDeleteItem.ItemClick
If SourceDeleteItem.Visibility <> DevExpress.XtraBars.BarItemVisibility.Never Then
My.Application.Globix.CURR_DELETE_ORIGIN = SourceDeleteItem.Checked
My.UIConfig.Globix.DeleteOriginalFile = SourceDeleteItem.Checked
My.SystemConfigManager.Save()
End If
End Sub
Private Sub BarCheckItem5_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles PreviewItem.CheckedChanged
End Sub
Private Sub SourceDeleteItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SourceDeleteItem.CheckedChanged
End Sub
Private Sub SaveProfileItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SaveProfileItem.CheckedChanged
My.UIConfig.Globix.ProfilePreselection = SaveProfileItem.Checked
My.SystemConfigManager.Save()
End Sub
Private Sub SkipItem_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SkipItem.ItemClick
My.Database.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CURRENT_WORKFILE_GUID}")
CancelAttempts = 2
Close()
End Sub
Private Sub BarCheckItem3_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles chkMultiindexing.CheckedChanged
If chkMultiindexing.Checked Then
chkMultiindexing.Caption = "Active"
Else
chkMultiindexing.Caption = "Inactive"
End If
End Sub
End Class

View File

@ -1,5 +1,5 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmGlobixIndexFileList Partial Class frmGlobix_IndexFileList
Inherits DevExpress.XtraBars.Ribbon.RibbonForm Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
@ -22,7 +22,7 @@ Partial Class frmGlobixIndexFileList
'Das Bearbeiten mit dem Code-Editor ist nicht möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmGlobixIndexFileList)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmGlobix_IndexFileList))
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
@ -121,7 +121,7 @@ Partial Class frmGlobixIndexFileList
Me.CheckedListBox1.Size = New System.Drawing.Size(617, 216) Me.CheckedListBox1.Size = New System.Drawing.Size(617, 216)
Me.CheckedListBox1.TabIndex = 2 Me.CheckedListBox1.TabIndex = 2
' '
'frmGlobixIndexFileList 'frmGlobix_IndexFileList
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
@ -129,9 +129,10 @@ Partial Class frmGlobixIndexFileList
Me.Controls.Add(Me.CheckedListBox1) Me.Controls.Add(Me.CheckedListBox1)
Me.Controls.Add(Me.RibbonStatusBar1) Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1) Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = CType(resources.GetObject("frmGlobix_IndexFileList.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
Me.Name = "frmGlobixIndexFileList" Me.Name = "frmGlobix_IndexFileList"
Me.Ribbon = Me.RibbonControl1 Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1 Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "Zu indexierende Dateien:" Me.Text = "Zu indexierende Dateien:"

View File

@ -201,6 +201,51 @@
MC40LTAuNCwxLTAuNCwxLjQsMEwxNiwxNGw1LjctNS43YzAuNC0wLjQsMS0wLjQsMS40LDBsMC42LDAu MC40LTAuNCwxLTAuNCwxLjQsMEwxNiwxNGw1LjctNS43YzAuNC0wLjQsMS0wLjQsMS40LDBsMC42LDAu
NmMwLjQsMC40LDAuNCwxLDAsMS40TDE4LDE2TDIzLjcsMjEuN3oiIGNsYXNzPSJSZWQiIC8+DQogIDwv NmMwLjQsMC40LDAuNCwxLDAsMS40TDE4LDE2TDIzLjcsMjEuN3oiIGNsYXNzPSJSZWQiIC8+DQogIDwv
Zz4NCjwvc3ZnPgs= Zz4NCjwvc3ZnPgs=
</value>
</data>
<data name="frmGlobix_IndexFileList.IconOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANYIAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGlzdE51bWJlcnMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcg
MCAwIDMyIDMyIj4NCiAgPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5SZWR7ZmlsbDojRDExQzFDO30K
CS5CbGFja3tmaWxsOiM3MjcyNzI7fQo8L3N0eWxlPg0KICA8cGF0aCBkPSJNMzAsOEgxMlY2aDE4Vjh6
IE0zMCwxOEgxMnYtMmgxOFYxOHogTTMwLDI4SDEydi0yaDE4VjI4eiIgY2xhc3M9IkJsYWNrIiAvPg0K
ICA8cGF0aCBkPSJNNiwydjhINFY1LjNsLTIsMFYzLjdsMC4yLDBjMC4yLDAsMC41LDAsMC43LTAuMWMw
LjMsMCwwLjUtMC4xLDAuNy0wLjNjMC4yLTAuMSwwLjQtMC4zLDAuNS0wLjUgIGMwLjEtMC4yLDAuMi0w
LjQsMC4zLTAuN2wwLTAuMUg2eiBNOCwyMHYtMS42SDQuNkM0LjcsMTguMiw0LjksMTguMSw1LDE4YzAu
Mi0wLjIsMC41LTAuNCwwLjctMC41YzAuMy0wLjIsMC41LTAuMywwLjgtMC41ICBjMC4zLTAuMiwwLjUt
MC40LDAuNy0wLjZjMC4yLTAuMiwwLjQtMC41LDAuNS0wLjhjMC4xLTAuMywwLjItMC42LDAuMi0xYzAt
MC40LTAuMS0wLjctMC4yLTEuMWMtMC4xLTAuMy0wLjQtMC42LTAuNi0wLjggIGMtMC4zLTAuMi0wLjUt
MC40LTAuOS0wLjVjLTAuMy0wLjEtMC43LTAuMi0xLTAuMmMtMC41LDAtMC45LDAuMS0xLjMsMC4yYy0w
LjQsMC4yLTAuNywwLjQtMC45LDAuN2MtMC4yLDAuMy0wLjQsMC42LTAuNSwxICBjLTAuMSwwLjQtMC4y
LDAuOC0wLjIsMS4zbDAsMC4xaDEuOHYtMC4xYzAtMC4yLDAtMC40LDAuMS0wLjZjMC0wLjIsMC4xLTAu
NCwwLjItMC41YzAuMS0wLjEsMC4yLTAuMywwLjMtMC40ICBjMC4xLTAuMSwwLjMtMC4xLDAuNS0wLjFj
MC4zLDAsMC41LDAuMSwwLjcsMC4zYzAuMiwwLjIsMC4zLDAuNCwwLjMsMC44YzAsMC4yLDAsMC40LTAu
MSwwLjVjLTAuMSwwLjItMC4yLDAuMy0wLjQsMC41ICBjLTAuMSwwLjEtMC4zLDAuMy0wLjUsMC40Yy0w
LjIsMC4xLTAuNCwwLjItMC41LDAuNEM0LjMsMTYuNiw0LDE2LjgsMy43LDE3Yy0wLjMsMC4yLTAuNiww
LjUtMC44LDAuN2MtMC4yLDAuMy0wLjQsMC42LTAuNSwwLjkgIGMtMC4xLDAuMy0wLjIsMC43LTAuMiwx
LjJWMjBIOHogTTYuMSwyOS44YzAuMy0wLjEsMC43LTAuMywwLjktMC41YzAuMy0wLjIsMC41LTAuNSww
LjYtMC44QzcuOSwyOC4yLDgsMjcuOCw4LDI3LjQgIGMwLTAuNS0wLjEtMC45LTAuNC0xLjJjLTAuMi0w
LjItMC40LTAuNC0wLjctMC41YzAuMi0wLjEsMC40LTAuMywwLjUtMC41YzAuMi0wLjMsMC4zLTAuNiww
LjMtMWMwLTAuNC0wLjEtMC43LTAuMi0xICBjLTAuMi0wLjMtMC40LTAuNS0wLjYtMC43Yy0wLjItMC4y
LTAuNS0wLjMtMC44LTAuNEM1LjcsMjIsNS40LDIyLDUuMSwyMmMtMC40LDAtMC44LDAuMS0xLjEsMC4y
Yy0wLjMsMC4xLTAuNiwwLjMtMC45LDAuNiAgYy0wLjIsMC4yLTAuNCwwLjUtMC42LDAuOWMtMC4xLDAu
My0wLjIsMC43LTAuMiwxLjFsMCwwLjFoMS43bDAtMC4xYzAtMC4zLDAuMS0wLjYsMC4zLTAuOWMwLjIt
MC4yLDAuNC0wLjMsMC44LTAuMyAgYzAuMiwwLDAuNSwwLjEsMC42LDAuMkM1LjksMjMuOSw2LDI0LjEs
NiwyNC40YzAsMC4yLDAsMC4zLTAuMSwwLjRDNS44LDI0LjksNS42LDI1LDUuNSwyNWMtMC4xLDAuMS0w
LjMsMC4xLTAuNSwwLjEgIGMtMC4xLDAtMC4yLDAtMC4zLDBjLTAuMSwwLTAuMiwwLTAuMiwwbC0wLjIs
MHYxLjRoMC4xYzAuMiwwLDAuNCwwLDAuNiwwYzAuMiwwLDAuNCwwLDAuNSwwLjFjMC4xLDAuMSwwLjMs
MC4xLDAuNCwwLjMgIGMwLjEsMC4xLDAuMSwwLjMsMC4xLDAuNmMwLDAuMy0wLjEsMC42LTAuMywwLjdj
LTAuMiwwLjItMC41LDAuMy0wLjgsMC4zYy0wLjIsMC0wLjQsMC0wLjUtMC4xYy0wLjEtMC4xLTAuMy0w
LjItMC40LTAuMyAgQzQuMSwyOCw0LDI3LjgsNCwyNy43Yy0wLjEtMC4yLTAuMS0wLjMtMC4xLTAuNWww
LTAuMUgyLjJsMCwwLjFjMCwwLjQsMC4xLDAuOSwwLjIsMS4yYzAuMSwwLjQsMC4zLDAuNywwLjYsMC45
ICBjMC4zLDAuMiwwLjYsMC40LDAuOSwwLjZDNC4yLDI5LjksNC42LDMwLDUuMSwzMEM1LjQsMzAsNS44
LDI5LjksNi4xLDI5Ljh6IiBjbGFzcz0iUmVkIiAvPg0KPC9zdmc+Cw==
</value> </value>
</data> </data>
</root> </root>

View File

@ -1,4 +1,4 @@
Public Class frmGlobixIndexFileList Public Class frmGlobix_IndexFileList
Private Sub frmGlobixIndexFileList_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmGlobixIndexFileList_Load(sender As Object, e As EventArgs) Handles Me.Load
Try Try
Dim oSQL = $"Select * From TBGI_FILES_USER Where WORKED = 0 And (UPPER([USER@WORK]) = UPPER('{My.Application.User.UserName}'))" Dim oSQL = $"Select * From TBGI_FILES_USER Where WORKED = 0 And (UPPER([USER@WORK]) = UPPER('{My.Application.User.UserName}'))"
@ -13,4 +13,5 @@
MsgBox("Unexpected error while loading data: " & ex.Message, vbCritical) MsgBox("Unexpected error while loading data: " & ex.Message, vbCritical)
End Try End Try
End Sub End Sub
End Class End Class

View File

@ -0,0 +1,35 @@
Public Class SearchFilter
Public Shared Property DefaultFilters As New List(Of FilterTimeframe) From {
New FilterTimeframe() With {.Name = "Kein", .DisableFilter = True, .[To] = Nothing},
New FilterTimeframe() With {.Name = "Eigener", .CustomFilter = True, .[To] = Date.Now, .From = Date.Now},
New FilterTimeframe() With {
.Name = "letzte 7 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(7))
},
New FilterTimeframe() With {
.Name = "letzte 14 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(14))
},
New FilterTimeframe() With {
.Name = "letzte 30 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(30))
},
New FilterTimeframe() With {
.Name = "aktueller Monat",
.From = New Date(Now.Year, Now.Month, 1)
}
}
Public Class FilterTimeframe
Public Property Name As String
Public Property From As Date
Public Property [To] As Date = Date.Now
Public Property DisableFilter As Boolean = False
Public Property CustomFilter As Boolean = False
Public Overrides Function ToString() As String
Return Name.ToString
End Function
End Class
End Class

View File

@ -141,16 +141,16 @@
<Compile Include="frmFlowForm.vb"> <Compile Include="frmFlowForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmGlobixIndexFileList.Designer.vb"> <Compile Include="Globix\frmGlobix_IndexFileList.Designer.vb">
<DependentUpon>frmGlobixIndexFileList.vb</DependentUpon> <DependentUpon>frmGlobix_IndexFileList.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="frmGlobixIndexFileList.vb"> <Compile Include="Globix\frmGlobix_IndexFileList.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmGlobix_Index.Designer.vb"> <Compile Include="Globix\frmGlobix_Index.Designer.vb">
<DependentUpon>frmGlobix_Index.vb</DependentUpon> <DependentUpon>frmGlobix_Index.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="frmGlobix_Index.vb"> <Compile Include="Globix\frmGlobix_Index.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmSearchPredefined.Designer.vb"> <Compile Include="frmSearchPredefined.Designer.vb">
@ -207,6 +207,7 @@
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="MyApplication.vb" /> <Compile Include="MyApplication.vb" />
<Compile Include="Queries\ClassQueries.vb" /> <Compile Include="Queries\ClassQueries.vb" />
<Compile Include="Search\SearchFilter.vb" />
<EmbeddedResource Include="frmAdministrationZooFlow.resx"> <EmbeddedResource Include="frmAdministrationZooFlow.resx">
<DependentUpon>frmAdministrationZooFlow.vb</DependentUpon> <DependentUpon>frmAdministrationZooFlow.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -216,10 +217,10 @@
<EmbeddedResource Include="frmFlowForm.resx"> <EmbeddedResource Include="frmFlowForm.resx">
<DependentUpon>frmFlowForm.vb</DependentUpon> <DependentUpon>frmFlowForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmGlobixIndexFileList.resx"> <EmbeddedResource Include="Globix\frmGlobix_IndexFileList.resx">
<DependentUpon>frmGlobixIndexFileList.vb</DependentUpon> <DependentUpon>frmGlobix_IndexFileList.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmGlobix_Index.resx"> <EmbeddedResource Include="Globix\frmGlobix_Index.resx">
<DependentUpon>frmGlobix_Index.vb</DependentUpon> <DependentUpon>frmGlobix_Index.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmSearchPredefined.resx"> <EmbeddedResource Include="frmSearchPredefined.resx">

View File

@ -350,7 +350,7 @@ Public Class frmFlowForm
Next Next
If My.Application.Globix.DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then If My.Application.Globix.DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then
frmGlobixIndexFileList.ShowDialog() frmGlobix_IndexFileList.ShowDialog()
My.Application.Globix.DTACTUAL_FILES = Nothing My.Application.Globix.DTACTUAL_FILES = Nothing
My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql) My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql)
End If End If

View File

@ -26,6 +26,7 @@ Partial Class frmSearchStart
Dim SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager = New DevExpress.XtraSplashScreen.SplashScreenManager(Me, Nothing, true, true) Dim SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager = New DevExpress.XtraSplashScreen.SplashScreenManager(Me, Nothing, true, true)
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSearchStart)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSearchStart))
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonNewSearch = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonNewSearch = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonSaveSearch = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonSaveSearch = New DevExpress.XtraBars.BarButtonItem()
Me.BarHeaderItem1 = New DevExpress.XtraBars.BarHeaderItem() Me.BarHeaderItem1 = New DevExpress.XtraBars.BarHeaderItem()
@ -45,11 +46,12 @@ Partial Class frmSearchStart
Me.cmbFilterTimeframe = New DevExpress.XtraBars.BarEditItem() Me.cmbFilterTimeframe = New DevExpress.XtraBars.BarEditItem()
Me.RepositoryItemComboBox2 = New DevExpress.XtraEditors.Repository.RepositoryItemComboBox() Me.RepositoryItemComboBox2 = New DevExpress.XtraEditors.Repository.RepositoryItemComboBox()
Me.BarCheckboxOpenSearchInSameWindow = New DevExpress.XtraBars.BarCheckItem() Me.BarCheckboxOpenSearchInSameWindow = New DevExpress.XtraBars.BarCheckItem()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroupFunctions = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroupProfiles = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroupProfiles = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroupFilter = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroupFilter = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroupSettings = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit()
Me.RepositoryItemTimeSpanEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTimeSpanEdit() Me.RepositoryItemTimeSpanEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTimeSpanEdit()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
@ -98,17 +100,28 @@ Partial Class frmSearchStart
'RibbonControl1 'RibbonControl1
' '
Me.RibbonControl1.AutoSizeItems = True Me.RibbonControl1.AutoSizeItems = True
Me.RibbonControl1.CaptionBarItemLinks.Add(Me.BarButtonItem2)
Me.RibbonControl1.ExpandCollapseItem.Id = 0 Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonNewSearch, Me.BarButtonSaveSearch, Me.BarHeaderItem1, Me.BarEditItem1, Me.BarButtonClearSearch, Me.BarButtonItem3, Me.BarEditItem2, Me.BarStaticItemInfo, Me.BarButtonStartSearch, Me.BarStaticItem1, Me.txtFilterFrom, Me.txtFilterTo, Me.cmbFilterTimeframe, Me.BarCheckboxOpenSearchInSameWindow}) Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.BarButtonItem2, Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonNewSearch, Me.BarButtonSaveSearch, Me.BarHeaderItem1, Me.BarEditItem1, Me.BarButtonClearSearch, Me.BarButtonItem3, Me.BarEditItem2, Me.BarStaticItemInfo, Me.BarButtonStartSearch, Me.BarStaticItem1, Me.txtFilterFrom, Me.txtFilterTo, Me.cmbFilterTimeframe, Me.BarCheckboxOpenSearchInSameWindow, Me.BarButtonItem1})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 22 Me.RibbonControl1.MaxItemId = 24
Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemRadioGroup1, Me.RepositoryItemComboBox1, Me.RepositoryItemTextEdit1, Me.RepositoryItemDateEdit1, Me.RepositoryItemDateEdit2, Me.RepositoryItemComboBox2, Me.RepositoryItemTimeSpanEdit1}) Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemRadioGroup1, Me.RepositoryItemComboBox1, Me.RepositoryItemTextEdit1, Me.RepositoryItemDateEdit1, Me.RepositoryItemDateEdit2, Me.RepositoryItemComboBox2, Me.RepositoryItemTimeSpanEdit1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.Size = New System.Drawing.Size(1070, 158) Me.RibbonControl1.ShowItemCaptionsInCaptionBar = True
Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide
Me.RibbonControl1.Size = New System.Drawing.Size(1020, 131)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
' '
'BarButtonItem2
'
Me.BarButtonItem2.Caption = "Fenster wiederherstellen"
Me.BarButtonItem2.Id = 23
Me.BarButtonItem2.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem2.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem2.Name = "BarButtonItem2"
Me.BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
'
'BarButtonNewSearch 'BarButtonNewSearch
' '
Me.BarButtonNewSearch.Caption = "Neue Suche" Me.BarButtonNewSearch.Caption = "Neue Suche"
@ -234,31 +247,32 @@ Partial Class frmSearchStart
' '
'BarCheckboxOpenSearchInSameWindow 'BarCheckboxOpenSearchInSameWindow
' '
Me.BarCheckboxOpenSearchInSameWindow.Caption = "Suche in gleichem Fenster öffnen" Me.BarCheckboxOpenSearchInSameWindow.Caption = "Ergebnis in gleichem Fenster öffnen"
Me.BarCheckboxOpenSearchInSameWindow.Id = 21 Me.BarCheckboxOpenSearchInSameWindow.Id = 21
Me.BarCheckboxOpenSearchInSameWindow.ImageOptions.SvgImage = CType(resources.GetObject("BarCheckItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.BarCheckboxOpenSearchInSameWindow.ImageOptions.SvgImage = CType(resources.GetObject("BarCheckboxOpenSearchInSameWindow.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarCheckboxOpenSearchInSameWindow.Name = "BarCheckboxOpenSearchInSameWindow" Me.BarCheckboxOpenSearchInSameWindow.Name = "BarCheckboxOpenSearchInSameWindow"
' '
'BarButtonItem1
'
Me.BarButtonItem1.Caption = "Fenster wiederherstellen"
Me.BarButtonItem1.Id = 22
Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem1.Name = "BarButtonItem1"
'
'RibbonPage1 'RibbonPage1
' '
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2, Me.RibbonPageGroupProfiles, Me.RibbonPageGroupFilter}) Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroupFunctions, Me.RibbonPageGroupProfiles, Me.RibbonPageGroupFilter, Me.RibbonPageGroupSettings})
Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "Start" Me.RibbonPage1.Text = "Start"
' '
'RibbonPageGroup1 'RibbonPageGroupFunctions
' '
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonStartSearch) Me.RibbonPageGroupFunctions.ItemLinks.Add(Me.BarButtonStartSearch)
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonClearSearch) Me.RibbonPageGroupFunctions.ItemLinks.Add(Me.BarButtonNewSearch)
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonNewSearch) Me.RibbonPageGroupFunctions.ItemLinks.Add(Me.BarButtonClearSearch)
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonSaveSearch) Me.RibbonPageGroupFunctions.ItemLinks.Add(Me.BarButtonSaveSearch)
Me.RibbonPageGroup1.Name = "RibbonPageGroup1" Me.RibbonPageGroupFunctions.Name = "RibbonPageGroupFunctions"
Me.RibbonPageGroup1.Text = "Suchfunktionen" Me.RibbonPageGroupFunctions.Text = "Suchfunktionen"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarCheckboxOpenSearchInSameWindow)
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "Sucheinstellungen"
' '
'RibbonPageGroupProfiles 'RibbonPageGroupProfiles
' '
@ -275,6 +289,12 @@ Partial Class frmSearchStart
Me.RibbonPageGroupFilter.Name = "RibbonPageGroupFilter" Me.RibbonPageGroupFilter.Name = "RibbonPageGroupFilter"
Me.RibbonPageGroupFilter.Text = "Filter" Me.RibbonPageGroupFilter.Text = "Filter"
' '
'RibbonPageGroupSettings
'
Me.RibbonPageGroupSettings.ItemLinks.Add(Me.BarCheckboxOpenSearchInSameWindow)
Me.RibbonPageGroupSettings.Name = "RibbonPageGroupSettings"
Me.RibbonPageGroupSettings.Text = "Sucheinstellungen"
'
'RepositoryItemTextEdit1 'RepositoryItemTextEdit1
' '
Me.RepositoryItemTextEdit1.AutoHeight = False Me.RepositoryItemTextEdit1.AutoHeight = False
@ -289,10 +309,10 @@ Partial Class frmSearchStart
'RibbonStatusBar1 'RibbonStatusBar1
' '
Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItemInfo) Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItemInfo)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 577) Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 455)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1070, 24) Me.RibbonStatusBar1.Size = New System.Drawing.Size(1020, 22)
' '
'pnlProfileChoose 'pnlProfileChoose
' '
@ -301,10 +321,10 @@ Partial Class frmSearchStart
Me.pnlProfileChoose.Controls.Add(Me.Label1) Me.pnlProfileChoose.Controls.Add(Me.Label1)
Me.pnlProfileChoose.Dock = System.Windows.Forms.DockStyle.Top Me.pnlProfileChoose.Dock = System.Windows.Forms.DockStyle.Top
Me.pnlProfileChoose.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.pnlProfileChoose.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.pnlProfileChoose.Location = New System.Drawing.Point(0, 158) Me.pnlProfileChoose.Location = New System.Drawing.Point(0, 131)
Me.pnlProfileChoose.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.pnlProfileChoose.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3)
Me.pnlProfileChoose.Name = "pnlProfileChoose" Me.pnlProfileChoose.Name = "pnlProfileChoose"
Me.pnlProfileChoose.Size = New System.Drawing.Size(1070, 57) Me.pnlProfileChoose.Size = New System.Drawing.Size(1020, 57)
Me.pnlProfileChoose.TabIndex = 5 Me.pnlProfileChoose.TabIndex = 5
' '
'cmbProfile 'cmbProfile
@ -315,7 +335,7 @@ Partial Class frmSearchStart
Me.cmbProfile.FormattingEnabled = True Me.cmbProfile.FormattingEnabled = True
Me.cmbProfile.Location = New System.Drawing.Point(3, 23) Me.cmbProfile.Location = New System.Drawing.Point(3, 23)
Me.cmbProfile.Name = "cmbProfile" Me.cmbProfile.Name = "cmbProfile"
Me.cmbProfile.Size = New System.Drawing.Size(1065, 21) Me.cmbProfile.Size = New System.Drawing.Size(1015, 21)
Me.cmbProfile.TabIndex = 2 Me.cmbProfile.TabIndex = 2
Me.cmbProfile.ValueMember = "DOKART_ID" Me.cmbProfile.ValueMember = "DOKART_ID"
' '
@ -337,68 +357,68 @@ Partial Class frmSearchStart
Me.XtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.[False] Me.XtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.[False]
Me.XtraTabControl1.Name = "XtraTabControl1" Me.XtraTabControl1.Name = "XtraTabControl1"
Me.XtraTabControl1.SelectedTabPage = Me.XtraTabPage1 Me.XtraTabControl1.SelectedTabPage = Me.XtraTabPage1
Me.XtraTabControl1.Size = New System.Drawing.Size(1070, 362) Me.XtraTabControl1.Size = New System.Drawing.Size(1020, 267)
Me.XtraTabControl1.TabIndex = 12 Me.XtraTabControl1.TabIndex = 12
Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2, Me.XtraTabPage3, Me.XtraTabPage4, Me.XtraTabPage5, Me.XtraTabPage6, Me.XtraTabPage7, Me.XtraTabPage8, Me.XtraTabPage9, Me.XtraTabPage10}) Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2, Me.XtraTabPage3, Me.XtraTabPage4, Me.XtraTabPage5, Me.XtraTabPage6, Me.XtraTabPage7, Me.XtraTabPage8, Me.XtraTabPage9, Me.XtraTabPage10})
' '
'XtraTabPage1 'XtraTabPage1
' '
Me.XtraTabPage1.Name = "XtraTabPage1" Me.XtraTabPage1.Name = "XtraTabPage1"
Me.XtraTabPage1.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage1.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage1.Text = "Search#1" Me.XtraTabPage1.Text = "Search#1"
' '
'XtraTabPage2 'XtraTabPage2
' '
Me.XtraTabPage2.Name = "XtraTabPage2" Me.XtraTabPage2.Name = "XtraTabPage2"
Me.XtraTabPage2.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage2.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage2.Text = "Search#2" Me.XtraTabPage2.Text = "Search#2"
' '
'XtraTabPage3 'XtraTabPage3
' '
Me.XtraTabPage3.Name = "XtraTabPage3" Me.XtraTabPage3.Name = "XtraTabPage3"
Me.XtraTabPage3.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage3.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage3.Text = "Search#3" Me.XtraTabPage3.Text = "Search#3"
' '
'XtraTabPage4 'XtraTabPage4
' '
Me.XtraTabPage4.Name = "XtraTabPage4" Me.XtraTabPage4.Name = "XtraTabPage4"
Me.XtraTabPage4.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage4.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage4.Text = "Search#4" Me.XtraTabPage4.Text = "Search#4"
' '
'XtraTabPage5 'XtraTabPage5
' '
Me.XtraTabPage5.Name = "XtraTabPage5" Me.XtraTabPage5.Name = "XtraTabPage5"
Me.XtraTabPage5.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage5.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage5.Text = "Search#5" Me.XtraTabPage5.Text = "Search#5"
' '
'XtraTabPage6 'XtraTabPage6
' '
Me.XtraTabPage6.Name = "XtraTabPage6" Me.XtraTabPage6.Name = "XtraTabPage6"
Me.XtraTabPage6.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage6.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage6.Text = "Search#6" Me.XtraTabPage6.Text = "Search#6"
' '
'XtraTabPage7 'XtraTabPage7
' '
Me.XtraTabPage7.Name = "XtraTabPage7" Me.XtraTabPage7.Name = "XtraTabPage7"
Me.XtraTabPage7.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage7.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage7.Text = "Search#7" Me.XtraTabPage7.Text = "Search#7"
' '
'XtraTabPage8 'XtraTabPage8
' '
Me.XtraTabPage8.Name = "XtraTabPage8" Me.XtraTabPage8.Name = "XtraTabPage8"
Me.XtraTabPage8.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage8.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage8.Text = "Search#8" Me.XtraTabPage8.Text = "Search#8"
' '
'XtraTabPage9 'XtraTabPage9
' '
Me.XtraTabPage9.Name = "XtraTabPage9" Me.XtraTabPage9.Name = "XtraTabPage9"
Me.XtraTabPage9.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage9.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage9.Text = "Search#9" Me.XtraTabPage9.Text = "Search#9"
' '
'XtraTabPage10 'XtraTabPage10
' '
Me.XtraTabPage10.Name = "XtraTabPage10" Me.XtraTabPage10.Name = "XtraTabPage10"
Me.XtraTabPage10.Size = New System.Drawing.Size(1068, 337) Me.XtraTabPage10.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage10.Text = "Search#10" Me.XtraTabPage10.Text = "Search#10"
' '
'ContextMenuStripSearchTerms 'ContextMenuStripSearchTerms
@ -437,13 +457,13 @@ Partial Class frmSearchStart
Me.SplitContainerControlSearch.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2 Me.SplitContainerControlSearch.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2
Me.SplitContainerControlSearch.Dock = System.Windows.Forms.DockStyle.Fill Me.SplitContainerControlSearch.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControlSearch.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2 Me.SplitContainerControlSearch.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2
Me.SplitContainerControlSearch.Location = New System.Drawing.Point(0, 215) Me.SplitContainerControlSearch.Location = New System.Drawing.Point(0, 188)
Me.SplitContainerControlSearch.Name = "SplitContainerControlSearch" Me.SplitContainerControlSearch.Name = "SplitContainerControlSearch"
Me.SplitContainerControlSearch.Panel1.Controls.Add(Me.XtraTabControl1) Me.SplitContainerControlSearch.Panel1.Controls.Add(Me.XtraTabControl1)
Me.SplitContainerControlSearch.Panel1.Text = "Panel1" Me.SplitContainerControlSearch.Panel1.Text = "Panel1"
Me.SplitContainerControlSearch.Panel2.Text = "Panel2" Me.SplitContainerControlSearch.Panel2.Text = "Panel2"
Me.SplitContainerControlSearch.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1 Me.SplitContainerControlSearch.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
Me.SplitContainerControlSearch.Size = New System.Drawing.Size(1070, 362) Me.SplitContainerControlSearch.Size = New System.Drawing.Size(1020, 267)
Me.SplitContainerControlSearch.SplitterPosition = 310 Me.SplitContainerControlSearch.SplitterPosition = 310
Me.SplitContainerControlSearch.TabIndex = 16 Me.SplitContainerControlSearch.TabIndex = 16
' '
@ -453,13 +473,14 @@ Partial Class frmSearchStart
Me.Appearance.Options.UseFont = True Me.Appearance.Options.UseFont = True
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1070, 601) Me.ClientSize = New System.Drawing.Size(1020, 477)
Me.Controls.Add(Me.SplitContainerControlSearch) Me.Controls.Add(Me.SplitContainerControlSearch)
Me.Controls.Add(Me.pnlProfileChoose) Me.Controls.Add(Me.pnlProfileChoose)
Me.Controls.Add(Me.RibbonStatusBar1) Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1) Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.Icon = CType(resources.GetObject("frmSearchStart.IconOptions.Icon"), System.Drawing.Icon) Me.IconOptions.Icon = CType(resources.GetObject("frmSearchStart.IconOptions.Icon"), System.Drawing.Icon)
Me.IconOptions.SvgImage = CType(resources.GetObject("frmSearchStart.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.IconOptions.SvgImage = CType(resources.GetObject("frmSearchStart.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.IconOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.Full
Me.KeyPreview = True Me.KeyPreview = True
Me.Name = "frmSearchStart" Me.Name = "frmSearchStart"
Me.Ribbon = Me.RibbonControl1 Me.Ribbon = Me.RibbonControl1
@ -489,7 +510,7 @@ End Sub
Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroupFunctions As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents pnlProfileChoose As Panel Friend WithEvents pnlProfileChoose As Panel
Friend WithEvents cmbProfile As ComboBox Friend WithEvents cmbProfile As ComboBox
@ -534,5 +555,7 @@ End Sub
Friend WithEvents RepositoryItemComboBox2 As DevExpress.XtraEditors.Repository.RepositoryItemComboBox Friend WithEvents RepositoryItemComboBox2 As DevExpress.XtraEditors.Repository.RepositoryItemComboBox
Friend WithEvents RepositoryItemTimeSpanEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemTimeSpanEdit Friend WithEvents RepositoryItemTimeSpanEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemTimeSpanEdit
Friend WithEvents BarCheckboxOpenSearchInSameWindow As DevExpress.XtraBars.BarCheckItem Friend WithEvents BarCheckboxOpenSearchInSameWindow As DevExpress.XtraBars.BarCheckItem
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroupSettings As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
End Class End Class

View File

@ -118,6 +118,23 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="DevExpress.Data.v19.2" name="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <assembly alias="DevExpress.Data.v19.2" name="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="BarButtonItem2.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAACECAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iRmlsbF9Eb3duIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAg
MCAzMiAzMiI+DQogIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJ
LkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgkuc3Qwe29wYWNpdHk6MC41O30KPC9zdHlsZT4NCiAgPGcgY2xh
c3M9InN0MCI+DQogICAgPHBhdGggZD0iTTI4LDEwdjIwSDJWMTBoMTB2Nkg3LjNMMTUsMjcuNkwyMi43
LDE2SDE4di02SDI4eiIgY2xhc3M9IkJsYWNrIiAvPg0KICA8L2c+DQogIDxwYXRoIGQ9Ik0yOCw4SDJW
MmgyNlY4eiBNMTQsMTB2OGgtM2w0LDZsNC02aC0zdi04SDE0eiIgY2xhc3M9IkJsdWUiIC8+DQo8L3N2
Zz4L
</value>
</data>
<data name="BarButtonNewSearch.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="BarButtonNewSearch.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
@ -209,7 +226,7 @@
LDI2LDI0LDI2eiIgY2xhc3M9IkJsYWNrIiAvPg0KPC9zdmc+Cw== LDI2LDI0LDI2eiIgY2xhc3M9IkJsYWNrIiAvPg0KPC9zdmc+Cw==
</value> </value>
</data> </data>
<data name="BarCheckItem1.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="BarCheckboxOpenSearchInSameWindow.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
@ -233,6 +250,23 @@
MCwxNnYtNWMwLTAuNSwwLjUtMSwxLTFoMThjMC41LDAsMSwwLjUsMSwxdjVIMHogTTI4LDhWM2MwLTAu MCwxNnYtNWMwLTAuNSwwLjUtMSwxLTFoMThjMC41LDAsMSwwLjUsMSwxdjVIMHogTTI4LDhWM2MwLTAu
NS0wLjUtMS0xLTFIOUM4LjUsMiw4LDIuNSw4LDN2NUgyOHoiIGNsYXNzPSJCbHVlIiAvPg0KICA8L2c+ NS0wLjUtMS0xLTFIOUM4LjUsMiw4LDIuNSw4LDN2NUgyOHoiIGNsYXNzPSJCbHVlIiAvPg0KICA8L2c+
DQo8L3N2Zz4L DQo8L3N2Zz4L
</value>
</data>
<data name="BarButtonItem1.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAACECAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iRmlsbF9Eb3duIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAg
MCAzMiAzMiI+DQogIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJ
LkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgkuc3Qwe29wYWNpdHk6MC41O30KPC9zdHlsZT4NCiAgPGcgY2xh
c3M9InN0MCI+DQogICAgPHBhdGggZD0iTTI4LDEwdjIwSDJWMTBoMTB2Nkg3LjNMMTUsMjcuNkwyMi43
LDE2SDE4di02SDI4eiIgY2xhc3M9IkJsYWNrIiAvPg0KICA8L2c+DQogIDxwYXRoIGQ9Ik0yOCw4SDJW
MmgyNlY4eiBNMTQsMTB2OGgtM2w0LDZsNC02aC0zdi04SDE0eiIgY2xhc3M9IkJsdWUiIC8+DQo8L3N2
Zz4L
</value> </value>
</data> </data>
<metadata name="ContextMenuStripSearchTerms.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="ContextMenuStripSearchTerms.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@ -1,22 +1,29 @@
Option Explicit On Option Explicit On
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Imports DevExpress.XtraTab Imports DevExpress.XtraTab
Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraEditors Imports DevExpress.XtraEditors
Imports DevExpress.XtraSplashScreen Imports DevExpress.XtraSplashScreen
Imports DigitalData.GUIs.Common Imports DigitalData.GUIs.Common
Imports DigitalData.GUIs.ZooFlow.ClassConstants
Imports DigitalData.GUIs.ZooFlow.SearchFilter
Imports System.Threading.Tasks Imports System.Threading.Tasks
Public Class frmSearchStart Public Class frmSearchStart
Private Logger As Logger Private Logger As Logger
' Constants
Private Const DEFAULT_X As Integer = 10 Private Const DEFAULT_X As Integer = 10
Private Const DEFAULT_Y As Integer = 10 Private Const DEFAULT_Y As Integer = 10
' Runtime Variables
Private SelectedTabIndex As Integer Private SelectedTabIndex As Integer
Private SelectedTab As XtraTabPage Private SelectedTab As XtraTabPage
Private HeightBeforeMinimizing As Integer = 600
Private SEARCH_ID As Integer = 0 Private SEARCH_ID As Integer = 0
Private SEARCH_SQL As String Private SEARCH_SQL As String
@ -31,11 +38,15 @@ Public Class frmSearchStart
Private LastSearchForm As frmDocumentResultList Private LastSearchForm As frmDocumentResultList
Private ChangedDateControls As List(Of String) Private ChangedDateControls As List(Of String)
Private StopWatch As Watch
Public Sub New(ByVal pDTSearchProfiles As DataTable, Optional ByVal pRunSearch As Boolean = False) Public Sub New(ByVal pDTSearchProfiles As DataTable, Optional ByVal pRunSearch As Boolean = False)
' Dieser Aufruf ist für den Designer erforderlich. ' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent() InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
StopWatch = New Watch(Name)
DatatableSearchProfiles = pDTSearchProfiles DatatableSearchProfiles = pDTSearchProfiles
Logger = My.LogConfig.GetLogger() Logger = My.LogConfig.GetLogger()
Dim oSearchTerms As New DataTable Dim oSearchTerms As New DataTable
@ -48,6 +59,7 @@ Public Class frmSearchStart
oSearchTerms.Columns.Add("SearchTerm", GetType(String)) oSearchTerms.Columns.Add("SearchTerm", GetType(String))
oSearchTerms.Columns.Add("BracketRight", GetType(String)) oSearchTerms.Columns.Add("BracketRight", GetType(String))
oSearchTerms.Columns.Add("Operator", GetType(String)) oSearchTerms.Columns.Add("Operator", GetType(String))
End Sub End Sub
Private Async Sub frmSearchStart_Load(sender As Object, e As EventArgs) Handles Me.Load Private Async Sub frmSearchStart_Load(sender As Object, e As EventArgs) Handles Me.Load
@ -56,30 +68,14 @@ Public Class frmSearchStart
Try Try
oHandle = SplashScreenManager.ShowOverlayForm(Me) oHandle = SplashScreenManager.ShowOverlayForm(Me)
Dim oWatch As New Watch("Setting up Form")
pnlProfileChoose.Visible = False pnlProfileChoose.Visible = False
For Each oTab As XtraTabPage In XtraTabControl1.TabPages For Each oTab As XtraTabPage In XtraTabControl1.TabPages
oTab.PageVisible = False oTab.PageVisible = False
Next Next
RepositoryItemComboBox2.Items.AddRange(New List(Of FilterTimeframe) From { RepositoryItemComboBox2.Items.AddRange(DefaultFilters)
New FilterTimeframe() With {.Name = "Kein", .DisableFilter = True},
New FilterTimeframe() With {.Name = "Eigener", .CustomFilter = True},
New FilterTimeframe() With {
.Name = "letzte 7 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(7)),
.[To] = Date.Now
},
New FilterTimeframe() With {
.Name = "letzte 14 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(14)),
.[To] = Date.Now
},
New FilterTimeframe() With {
.Name = "letzte 30 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(30)),
.[To] = Date.Now
}
})
BarCheckboxOpenSearchInSameWindow.Checked = My.UIConfig.SearchForm.OpenSearchInSameWindow BarCheckboxOpenSearchInSameWindow.Checked = My.UIConfig.SearchForm.OpenSearchInSameWindow
@ -96,6 +92,8 @@ Public Class frmSearchStart
For Each oRow As DataRow In DatatableSearchProfiles.Rows For Each oRow As DataRow In DatatableSearchProfiles.Rows
RepositoryItemComboBox1.Items.Add(oRow.Item("TITLE")) RepositoryItemComboBox1.Items.Add(oRow.Item("TITLE"))
Next Next
oWatch.Stop()
Else Else
pnlProfileChoose.Visible = False pnlProfileChoose.Visible = False
RibbonPageGroupProfiles.Visible = False RibbonPageGroupProfiles.Visible = False
@ -108,7 +106,10 @@ Public Class frmSearchStart
SEARCH_SQL = DatatableSearchProfiles.Rows(0).Item("RESULT_SQL") SEARCH_SQL = DatatableSearchProfiles.Rows(0).Item("RESULT_SQL")
SEARCH_TITLE = DatatableSearchProfiles.Rows(0).Item("TITLE") SEARCH_TITLE = DatatableSearchProfiles.Rows(0).Item("TITLE")
oWatch.Stop()
oWatch = New Watch("Loading Attributes")
Await Load_Search_Attributes() Await Load_Search_Attributes()
oWatch.Stop()
BarButtonNewSearch.Visibility = DevExpress.XtraBars.BarItemVisibility.Never BarButtonNewSearch.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If End If
SEARCH_COUNT = DatatableSearchProfiles.Rows.Count SEARCH_COUNT = DatatableSearchProfiles.Rows.Count
@ -127,37 +128,50 @@ Public Class frmSearchStart
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error while loading ProfileSearches:") MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error while loading ProfileSearches:")
Finally Finally
SplashScreenManager.CloseOverlayForm(oHandle) SplashScreenManager.CloseOverlayForm(oHandle)
StopWatch.Stop()
End Try End Try
End Sub End Sub
Async Function Load_Search_Attributes() As Task Async Function Load_Search_Attributes() As Task
Try Try
DataLoaded = False DataLoaded = False
Dim oWatch1 As New Watch("Getting data from Database")
Dim oSQL = $"SELECT * FROM VWIDB_SEARCH_PROFILE_ATTRIBUTES WHERE SEARCH_PROFIL_ID = {SEARCH_ID} ORDER BY [SEQUENCE]" Dim oSQL = $"SELECT * FROM VWIDB_SEARCH_PROFILE_ATTRIBUTES WHERE SEARCH_PROFIL_ID = {SEARCH_ID} ORDER BY [SEQUENCE]"
Dim oDT As DataTable = Await My.DatabaseIDB.GetDatatableAsync(oSQL) Dim oDT As DataTable = Await My.DatabaseIDB.GetDatatableAsync(oSQL)
oWatch1.Stop()
Dim oWatch2 As New Watch("Procesing Dataset")
DatatableAttributes = Nothing DatatableAttributes = Nothing
DatatableAttributes = oDT.Clone() DatatableAttributes = oDT.Clone()
oDT.Select("", "SEQUENCE").CopyToDataTable(DatatableAttributes, LoadOption.PreserveChanges) oDT.Select("", "SEQUENCE").CopyToDataTable(DatatableAttributes, LoadOption.PreserveChanges)
oWatch2.Stop()
Dim oControlCount As Integer = 1 Dim oControlCount As Integer = 1
Dim oControlRow As Integer = 0 Dim oControlRow As Integer = 0
Dim oControls As New ClassControlCreator(SelectedTab, Me) Dim oControls As New ClassControlCreator(SelectedTab, Me)
Dim YMax As Integer = 0
Dim YActControlHeight As Integer = 0 Dim YActControlHeight As Integer = 0
Dim XActControlWidth As Integer = 0 Dim XActControlWidth As Integer = 0
Dim iList As New List(Of Integer) From {2, 3, 5, 6, 8, 9}
For Each oAttributeRow As DataRow In oDT.Rows For Each oAttributeRow As DataRow In oDT.Rows
Dim oXPosition As Integer Dim oXPosition As Integer
Dim oYPositionControl As Integer Dim oYPositionControl As Integer
Dim oYPositionLabel As Integer Dim oYPositionLabel As Integer
Dim oMyLastGridView As GridView Dim oMyLastGridView As GridView
Dim oSingleResult As Boolean = False Dim oSingleResult As Boolean = False
Dim oAttriTitle As String = oAttributeRow.Item("ATTRIBUTE_TITLE").ToString Dim oAttributeTitle As String = oAttributeRow.Item("ATTRIBUTE_TITLE").ToString
Dim oAttriID As Integer = CInt(oAttributeRow.Item("ATTRIBUTE_ID")) Dim oAttriID As Integer = CInt(oAttributeRow.Item("ATTRIBUTE_ID"))
Dim oAttributeType As String = oAttributeRow.Item("ATTRIBUTE_TYPE").ToString Dim oAttributeType As String = oAttributeRow.Item("ATTRIBUTE_TYPE").ToString
Dim oWatch3 As New Watch($"Loading Attribute: {oAttributeTitle}")
Dim oWatch4 As New Watch($"Calculating Position")
If oControlCount = 1 Or oControlCount = 5 Or oControlCount = 9 Then If oControlCount = 1 Or oControlCount = 5 Or oControlCount = 9 Then
oControlRow += 1 oControlRow += 1
End If End If
If oControlRow = 1 Then If oControlRow = 1 Then
If oControlCount = 1 Then If oControlCount = 1 Then
oXPosition = 10 oXPosition = 10
@ -177,30 +191,39 @@ Public Class frmSearchStart
End If End If
End If End If
Dim oControlHeight As Integer = CInt(oAttributeRow.Item("HEIGHT")) oWatch4.Stop()
oWatch4 = New Watch("Creating Label")
'Dim oControlHeight As Integer = CInt(oAttributeRow.Item("HEIGHT"))
Dim oControlHeight As Integer = 150
Dim oControlWidth As Integer = CInt(oAttributeRow.Item("WIDTH")) Dim oControlWidth As Integer = CInt(oAttributeRow.Item("WIDTH"))
'Dim oControlWidth As Integer = 150
If CBool(oAttributeRow.Item("MULTISELECT")) = True Then If CBool(oAttributeRow.Item("MULTISELECT")) = True Then
oControlWidth += 50 oControlWidth += 50
End If End If
addLabel(oAttriTitle, oXPosition, oYPositionLabel) addLabel(oAttributeTitle, oXPosition, oYPositionLabel)
'Nun das Control mit dem entsprechenden Abstand und der Größe 'Nun das Control mit dem entsprechenden Abstand und der Größe
Dim oCalcHeight As Integer Dim oCalcHeight As Integer
Dim oCalcWidth As Integer Dim oCalcWidth As Integer
If oAttributeType = "VARCHAR" Or oAttributeType = "BIG INTEGER" Then If oAttributeType = ATTR_TYPE_STRING Or oAttributeType = ATTR_TYPE_INTEGER Then
oCalcHeight = oControlHeight + oYPositionControl oCalcHeight = oControlHeight + oYPositionControl
oCalcWidth = oControlWidth oCalcWidth = oControlWidth
ElseIf (oAttributeType = "DATE" Or oAttributeType = "BIT") Then ElseIf (oAttributeType = ATTR_TYPE_DATE Or oAttributeType = ATTR_TYPE_BOOLEAN) Then
oCalcHeight = 20 + oYPositionControl oCalcHeight = 20 + oYPositionControl
oCalcWidth = 100 oCalcWidth = 100
End If End If
If oCalcHeight > YActControlHeight Then If oCalcHeight > YActControlHeight Then
YActControlHeight = oCalcHeight YActControlHeight = oCalcHeight
End If End If
oWatch4.Stop()
oWatch4 = New Watch("Creating Control")
Dim oMyControl As Control = Nothing Dim oMyControl As Control = Nothing
If oAttributeType = "VARCHAR" Or oAttributeType = "BIG INTEGER" Then If oAttributeType = ATTR_TYPE_STRING Or oAttributeType = ATTR_TYPE_INTEGER Then
oMyControl = oControls.CreateExistingGridControl(oAttributeRow, oXPosition, oYPositionControl) oMyControl = oControls.CreateExistingGridControl(oAttributeRow, oXPosition, oYPositionControl)
Dim myDGV As GridControl = CType(oMyControl, GridControl) Dim myDGV As GridControl = CType(oMyControl, GridControl)
@ -212,7 +235,7 @@ Public Class frmSearchStart
End If End If
End If End If
Dim oView As DevExpress.XtraGrid.Views.Grid.GridView Dim oView As GridView
oView = CType(myDGV.MainView, GridView) oView = CType(myDGV.MainView, GridView)
oMyLastGridView = oView oMyLastGridView = oView
If CBool(oAttributeRow.Item("MULTISELECT")) = True Then If CBool(oAttributeRow.Item("MULTISELECT")) = True Then
@ -223,28 +246,30 @@ Public Class frmSearchStart
End If End If
oView.FocusInvalidRow() oView.FocusInvalidRow()
ElseIf oAttributeType = "DATE" Then ElseIf oAttributeType = ATTR_TYPE_DATE Then
oMyControl = oControls.CreateExistingDatepicker(oAttributeRow, oXPosition, oYPositionControl) oMyControl = oControls.CreateExistingDatepicker(oAttributeRow, oXPosition, oYPositionControl)
Dim myDTP As DateEdit = CType(oMyControl, DateEdit) Dim myDTP As DateEdit = CType(oMyControl, DateEdit)
AddHandler myDTP.DisableCalendarDate, AddressOf DisableCalendarDate AddHandler myDTP.DisableCalendarDate, AddressOf DisableCalendarDate
AddHandler myDTP.DateTimeChanged, AddressOf CalendarChanged 'CalendarChanged AddHandler myDTP.DateTimeChanged, AddressOf CalendarChanged 'CalendarChanged
ElseIf oAttributeType = "BIT" Then ElseIf oAttributeType = ATTR_TYPE_BOOLEAN Then
oMyControl = oControls.CreateExistingCheckbox(oAttributeRow, oXPosition, oYPositionControl) oMyControl = oControls.CreateExistingCheckbox(oAttributeRow, oXPosition, oYPositionControl)
Dim myCheckBox As CheckBox = CType(oMyControl, CheckBox) Dim myCheckBox As CheckBox = CType(oMyControl, CheckBox)
AddHandler myCheckBox.CheckedChanged, AddressOf CheckBox_CheckedChanged AddHandler myCheckBox.CheckedChanged, AddressOf CheckBox_CheckedChanged
End If End If
oWatch4.Stop()
oWatch4 = New Watch("Adding Control to Panel")
oControlCount += 1 oControlCount += 1
If oMyControl IsNot Nothing Then If oMyControl IsNot Nothing Then
SelectedTab.Controls.Add(oMyControl) SelectedTab.Controls.Add(oMyControl)
End If End If
If oAttributeType = "VARCHAR" Or oAttributeType = "BIG INTEGER" Then
oMyLastGridView.FocusInvalidRow()
End If
oXPosition += oControlWidth + 20 oXPosition += oControlWidth + 20
oWatch4.Stop()
oWatch3.Stop()
Next Next
Catch ex As Exception Catch ex As Exception
Logger.Warn("Unexpected error in Load_Search_Attributes - Error: " & ex.Message) Logger.Warn("Unexpected error in Load_Search_Attributes - Error: " & ex.Message)
@ -252,7 +277,6 @@ Public Class frmSearchStart
Finally Finally
DataLoaded = True DataLoaded = True
End Try End Try
End Function End Function
Sub addLabel(pAttrName As String, pXPos As Integer, ylbl As Integer) Sub addLabel(pAttrName As String, pXPos As Integer, ylbl As Integer)
Dim lbl As New Label With { Dim lbl As New Label With {
@ -296,8 +320,8 @@ Public Class frmSearchStart
Continue For Continue For
End If End If
oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrID oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeID
oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
For Each oRowHandle As Integer In oSelectedRows For Each oRowHandle As Integer In oSelectedRows
Dim oResult = oMyGridView.GetRowCellValue(oRowHandle, oMyGridView.Columns(0).FieldName) Dim oResult = oMyGridView.GetRowCellValue(oRowHandle, oMyGridView.Columns(0).FieldName)
Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{oResult}','{My.Application.User.UserName}'" Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{oResult}','{My.Application.User.UserName}'"
@ -315,8 +339,8 @@ Public Class frmSearchStart
For Each oName As String In ChangedDateControls For Each oName As String In ChangedDateControls
If oDateEdit.Name = oName Then If oDateEdit.Name = oName Then
If Not IsNothing(oDateEdit.EditValue) Then If Not IsNothing(oDateEdit.EditValue) Then
oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrID oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeID
oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
Dim oldValue As Date Dim oldValue As Date
Dim validDate As Boolean = False Dim validDate As Boolean = False
Dim oDateValue As Date = DirectCast(oDateEdit.EditValue, Date) Dim oDateValue As Date = DirectCast(oDateEdit.EditValue, Date)
@ -344,8 +368,8 @@ Public Class frmSearchStart
Case "System.Windows.Forms.CheckBox" Case "System.Windows.Forms.CheckBox"
Dim myCheckBox As CheckBox = CType(oControl, CheckBox) Dim myCheckBox As CheckBox = CType(oControl, CheckBox)
If myCheckBox.CheckState <> CheckState.Indeterminate Then If myCheckBox.CheckState <> CheckState.Indeterminate Then
oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrID oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeID
oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle oAttrTitle = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{myCheckBox.Checked.ToString}','{My.Application.User.UserName}'" Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{myCheckBox.Checked.ToString}','{My.Application.User.UserName}'"
My.DatabaseIDB.ExecuteNonQuery(oInsert) My.DatabaseIDB.ExecuteNonQuery(oInsert)
End If End If
@ -363,8 +387,8 @@ Public Class frmSearchStart
If IsNothing(oRowView) = False Then If IsNothing(oRowView) = False Then
Dim oResult As String = CType(oRowView.Item(0), String) Dim oResult As String = CType(oRowView.Item(0), String)
Dim oAttrID = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrID Dim oAttrID = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttributeID
Dim oAttrTitle = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle Dim oAttrTitle = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
' RenewSearchAttributes() ' RenewSearchAttributes()
' AddSearchAttribute(oAttrID, oAttrTitle, oResult) ' AddSearchAttribute(oAttrID, oAttrTitle, oResult)
@ -375,8 +399,8 @@ Public Class frmSearchStart
If DataLoaded = False Then Exit Sub If DataLoaded = False Then Exit Sub
Dim oCurrentCB As CheckBox = DirectCast(sender, CheckBox) Dim oCurrentCB As CheckBox = DirectCast(sender, CheckBox)
Dim oChecked = oCurrentCB.Checked Dim oChecked = oCurrentCB.Checked
Dim oAttrID = DirectCast(oCurrentCB.Tag, ClassControlCreator.ControlMetadata).AttrID Dim oAttrID = DirectCast(oCurrentCB.Tag, ClassControlCreator.ControlMetadata).AttributeID
Dim oAttrTitle = DirectCast(oCurrentCB.Tag, ClassControlCreator.ControlMetadata).AttrTitle Dim oAttrTitle = DirectCast(oCurrentCB.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
'RenewSearchAttributes() 'RenewSearchAttributes()
' AddSearchAttribute(oAttrID, oAttrTitle, oChecked.ToString) ' AddSearchAttribute(oAttrID, oAttrTitle, oChecked.ToString)
End Sub End Sub
@ -497,8 +521,8 @@ Public Class frmSearchStart
If IsNothing(oRowView) = False Then If IsNothing(oRowView) = False Then
Dim oResult As String = CType(oRowView.Item(0), String) Dim oResult As String = CType(oRowView.Item(0), String)
Dim oAttrID = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrID Dim oAttrID = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttributeID
Dim oAttrTitle = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle Dim oAttrTitle = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttributeTitle
End If End If
End Sub End Sub
@ -544,10 +568,19 @@ Public Class frmSearchStart
Private Sub BarButtonStartSearch_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonStartSearch.ItemClick Private Sub BarButtonStartSearch_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonStartSearch.ItemClick
RenewSearchAttributes() RenewSearchAttributes()
Start_Search()
' Minimize the search form, but only if results were found
If Start_Search() Then
MinimizeSearchForm()
' Position Result Window below this window
LastSearchForm.Location = GetResultFormLocation()
LastSearchForm.Size = GetResultFormSize()
End If
End Sub End Sub
Private Sub Start_Search() Private Function Start_Search() As Boolean
Dim oHandle As IOverlaySplashScreenHandle = Nothing Dim oHandle As IOverlaySplashScreenHandle = Nothing
Dim oItemsFound As Boolean = False
Try Try
oHandle = SplashScreenManager.ShowOverlayForm(Me) oHandle = SplashScreenManager.ShowOverlayForm(Me)
@ -587,16 +620,14 @@ Public Class frmSearchStart
Dim oForm As New frmDocumentResultList(My.LogConfig, oEnvironment, oParams) Dim oForm As New frmDocumentResultList(My.LogConfig, oEnvironment, oParams)
oForm.Show() oForm.Show()
' Position Result Window below this window
oForm.Location = GetResultFormLocation()
oForm.Size = GetResultFormSize()
AddHandler oForm.FormClosed, Sub() AddHandler oForm.FormClosed, Sub()
LastSearchForm = Nothing LastSearchForm = Nothing
End Sub End Sub
LastSearchForm = oForm LastSearchForm = oForm
End If End If
oItemsFound = True
Else Else
Display_InfoItem("No results for this searchcombination!", Color.OrangeRed, Color.White) Display_InfoItem("No results for this searchcombination!", Color.OrangeRed, Color.White)
End If End If
@ -605,7 +636,9 @@ Public Class frmSearchStart
Finally Finally
SplashScreenManager.CloseOverlayForm(oHandle) SplashScreenManager.CloseOverlayForm(oHandle)
End Try End Try
End Sub
Return oItemsFound
End Function
Private Function GetResultFormLocation() As Point Private Function GetResultFormLocation() As Point
Dim oX = Location.X Dim oX = Location.X
@ -628,17 +661,24 @@ Public Class frmSearchStart
End If End If
End Sub End Sub
Private Class FilterTimeframe Private Sub MinimizeSearchForm()
Public Property Name As String HeightBeforeMinimizing = Height
Public Property From As Date Height = 200
Public Property [To] As Date
Public Property DisableFilter As Boolean = False BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
Public Property CustomFilter As Boolean = False End Sub
Private Sub RestoreSearchForm()
Height = HeightBeforeMinimizing
If LastSearchForm IsNot Nothing Then
LastSearchForm.Location = GetResultFormLocation()
End If
BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End Sub
Public Overrides Function ToString() As String
Return Name.ToString
End Function
End Class
Private Sub cmbFilterTimeframe_EditValueChanged(sender As Object, e As EventArgs) Handles cmbFilterTimeframe.EditValueChanged Private Sub cmbFilterTimeframe_EditValueChanged(sender As Object, e As EventArgs) Handles cmbFilterTimeframe.EditValueChanged
Dim oTimeframe As FilterTimeframe = DirectCast(cmbFilterTimeframe.EditValue, FilterTimeframe) Dim oTimeframe As FilterTimeframe = DirectCast(cmbFilterTimeframe.EditValue, FilterTimeframe)
@ -668,4 +708,16 @@ Public Class frmSearchStart
My.UIConfig.SearchForm.Size = Size My.UIConfig.SearchForm.Size = Size
My.UIConfigManager.Save() My.UIConfigManager.Save()
End Sub End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
RestoreSearchForm()
End Sub
Private Sub BarButtonItem2_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
RestoreSearchForm()
End Sub
Private Sub RibbonControl1_MinimizedRibbonHiding(sender As Object, e As DevExpress.XtraBars.Ribbon.MinimizedRibbonEventArgs) Handles RibbonControl1.MinimizedRibbonHiding
End Sub
End Class End Class

View File

@ -63,14 +63,26 @@ Public Class ImportZUGFeRDFiles
Private Function MoveAndRenameEmailToRejected(Args As WorkerArgs, MessageId As String) As EmailData Private Function MoveAndRenameEmailToRejected(Args As WorkerArgs, MessageId As String) As EmailData
Dim oEmailData = _email.GetEmailDataForMessageId(MessageId) Dim oEmailData = _email.GetEmailDataForMessageId(MessageId)
Dim oSource = _email.GetOriginalEmailPath(Args.OriginalEmailDirectory, MessageId) Dim oSource = _email.GetOriginalEmailPath(Args.OriginalEmailDirectory, MessageId)
Dim oDateSubDirectoryName As String = Now.ToString("yyyy-MM-dd")
Dim oDestination As String Dim oDestination As String
Dim oRejectedDirectory As String = Path.Combine(Args.RejectedEmailDirectory, oDateSubDirectoryName)
' Create the destination directory if it does not exist
If Not Directory.Exists(oRejectedDirectory) Then
Try
Directory.CreateDirectory(oRejectedDirectory)
Catch ex As Exception
_logger.Error(ex)
End Try
End If
' If oEmailData is Nothing, TBEDM_EMAIL_PROFILER_HISTORY for MessageId was not found. ' If oEmailData is Nothing, TBEDM_EMAIL_PROFILER_HISTORY for MessageId was not found.
' This only should happen when testing and db-tables are deleted frequently ' This only should happen when testing and db-tables are deleted frequently
If oEmailData Is Nothing Then If oEmailData Is Nothing Then
oDestination = _email.GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, MessageId) oDestination = _email.GetEmailPathWithSubjectAsName(oRejectedDirectory, MessageId)
Else Else
oDestination = _email.GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, oEmailData.Subject) oDestination = _email.GetEmailPathWithSubjectAsName(oRejectedDirectory, oEmailData.Subject)
End If End If
_logger.Debug("Destination for eml file is {0}", oDestination) _logger.Debug("Destination for eml file is {0}", oDestination)
@ -100,7 +112,7 @@ Public Class ImportZUGFeRDFiles
Private Sub AddRejectedState(oMessageID As String, oTitle As String, oTitle1 As String, oComment As String) Private Sub AddRejectedState(oMessageID As String, oTitle As String, oTitle1 As String, oComment As String)
Try Try
'PRCUST_ADD_HISTORY_STATE: @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250) 'PRCUST_ADD_HISTORY_STATE: @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250)
Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment}'" Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment.Replace("'", "''")}'"
_mssql.ExecuteNonQuery(oSQL) _mssql.ExecuteNonQuery(oSQL)
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
@ -150,7 +162,11 @@ Public Class ImportZUGFeRDFiles
' Count the amount of ZUGFeRD files ' Count the amount of ZUGFeRD files
Dim oZUGFeRDCount As Integer = 0 Dim oZUGFeRDCount As Integer = 0
' Set the default Move Directory ' Set the default Move Directory
Dim oMoveDirectory As String = oArgs.SuccessDirectory Dim oMoveDirectory As String = oArgs.ErrorDirectory
' Flag to save if the whole process was a success.
' Will be set only at the end of the function if no error occurred.
Dim oIsSuccess As Boolean = False
' Create file lists ' Create file lists
Dim oFileGroupFiles As List(Of FileInfo) = oFileGroup.Value Dim oFileGroupFiles As List(Of FileInfo) = oFileGroup.Value
Dim oEmailAttachmentFiles As New List(Of FileInfo) Dim oEmailAttachmentFiles As New List(Of FileInfo)
@ -244,174 +260,7 @@ Public Class ImportZUGFeRDFiles
' Since extraction went well, increase the amount of ZUGFeRD files ' Since extraction went well, increase the amount of ZUGFeRD files
oZUGFeRDCount += 1 oZUGFeRDCount += 1
#Region "Check Property Values"
' --- BEGIN Check Property Values
'' PropertyMap items with `IsGrouped = False` are handled normally
'Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = oArgs.PropertyMap.
' Where(Function(Item) Item.Value.IsGrouped = True).
' ToDictionary(Function(Item) Item.Key,
' Function(Item) Item.Value)
'_logger.Debug("Found {0} default properties.", oDefaultProperties.Count)
'' PropertyMap items with `IsGrouped = True` are grouped by group scope
'Dim oGroupedProperties = oArgs.PropertyMap.
' Where(Function(Item) Item.Value.IsGrouped = True).
' ToLookup(Function(Item) Item.Value.GroupScope, ' Lookup key is group scope
' Function(Item) Item)
'_logger.Debug("Found {0} properties grouped in {1} group(s)", oArgs.PropertyMap.Count - oDefaultProperties.Count, oGroupedProperties.Count)
'' Iterate through groups to get group scope and group items
'For Each oGroup In oGroupedProperties
' Dim oGroupScope As String = oGroup.Key
' Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object))
' Dim oRowCount = 0
' _logger.Debug("Fetching Property values for group {0}.", oGroupScope)
' ' get properties as a nested object, see `oPropertyList`
' For Each oProperty As KeyValuePair(Of String, XmlItemProperty) In oGroup
' Dim oPropertyValues As List(Of Object)
' Try
' oPropertyValues = oPropertyExtractor.GetPropValue(oDocument, oProperty.Key)
' Catch ex As Exception
' _logger.Warn("Unknown error occurred while fetching property [{0}] in group [{1}]:", oProperty.Value.Description, oGroupScope)
' _logger.Error(ex)
' oPropertyValues = New List(Of Object)
' End Try
' ' Flatten result value
' oPropertyValues = oPropertyExtractor.GetFinalPropValue(oPropertyValues)
' ' Add to list
' oPropertyList.Add(oProperty.Value, oPropertyValues)
' ' check the first batch of values to determine the row count
' If oRowCount = 0 Then
' oRowCount = oPropertyValues.Count
' End If
' Next
' ' Structure of oPropertyList
' ' [ # Propertyname # Row 1 # Row 2
' ' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...],
' ' PositionsSteuersatz: [ApplicablePercent1, ApplicablePercent2, ...],
' ' ...
' ' ]
' For oRowIndex = 0 To oRowCount - 1
' _logger.Debug("Processing row {0}", oRowIndex)
' For Each oColumn As KeyValuePair(Of XmlItemProperty, List(Of Object)) In oPropertyList
' Dim oTableName As String = oColumn.Key.TableName
' Dim oPropertyDescription As String = oColumn.Key.Description
' Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1
' ' Returns nothing if oColumn.Value contains an empty list
' Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex)
' _logger.Debug("Processing property {0}.", oPropertyDescription)
' If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
' If oColumn.Key.IsRequired Then
' _logger.Warn("Property [{0}] is empty or not found but is required. Continuing with Empty String.", oPropertyDescription)
' oMissingProperties.Add(oPropertyDescription)
' Else
' _logger.Debug("Property [{0}] is empty or not found. Continuing with Empty String.", oPropertyDescription)
' End If
' oPropertyValue = String.Empty
' End If
' _logger.Debug("Property {0} has value '{1}'", oPropertyDescription, oPropertyValue)
' Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}', {oRowCounter})"
' _logger.Debug("Mapping Property {0} to value {1}. Will be inserted into table {2} with RowCounter {3}", oPropertyDescription, oPropertyValue, oTableName, oRowCounter)
' ' Insert into SQL Server
' If oArgs.InsertIntoSQLServer = True Then
' Dim oResult = _mssql.NewExecutenonQuery(oCommand)
' If oResult = False Then
' _logger.Warn("SQL Command was not successful. Check the log.")
' End If
' End If
' ' Insert into Firebird
' _firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
' Next
' Next
' oGlobalGroupCounter += oRowCount
'Next
'' Iterate through default properties
'For Each Item As KeyValuePair(Of String, XmlItemProperty) In oDefaultProperties
' Dim oPropertyValueList As List(Of Object)
' Dim oPropertyDescription As String = Item.Value.Description
' Dim oPropertyValue As Object = Nothing
' Try
' oPropertyValueList = oPropertyExtractor.GetPropValue(oDocument, Item.Key)
' Catch ex As Exception
' _logger.Warn("Unknown error occurred while fetching property {0} in group {1}:", oPropertyDescription, Item.Value.GroupScope)
' _logger.Error(ex)
' oPropertyValueList = New List(Of Object)
' End Try
' Try
' If IsNothing(oPropertyValueList) Then
' oPropertyValue = Nothing
' ElseIf TypeOf oPropertyValueList Is List(Of Object) Then
' Select Case oPropertyValueList.Count
' Case 0
' oPropertyValue = Nothing
' Case Else
' Dim oList As List(Of Object) = DirectCast(oPropertyValueList, List(Of Object))
' oPropertyValue = oList.Item(0)
' ' This should hopefully show config errors
' If TypeOf oPropertyValue Is List(Of Object) Then
' _logger.Warn("Property with Description {0} may be configured incorrectly", oPropertyDescription)
' oPropertyValue = Nothing
' End If
' End Select
' End If
' Catch ex As Exception
' _logger.Warn("Unknown error occurred while processing property {0}:", oPropertyDescription)
' _logger.Error(ex)
' oPropertyValue = Nothing
' End Try
' If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
' If Item.Value.IsRequired Then
' _logger.Warn("Property {0} is empty but marked as required! Skipping.", oPropertyDescription)
' oMissingProperties.Add(oPropertyDescription)
' Continue For
' Else
' _logger.Debug("Property [{0}] is empty or not found. Skipping.", oPropertyDescription)
' Continue For
' End If
' End If
' Dim oTableName = Item.Value.TableName
' Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}')"
' _logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oPropertyDescription, oPropertyValue, oTableName)
' ' Insert into SQL Server
' If oArgs.InsertIntoSQLServer = True Then
' Dim oResult = _mssql.NewExecutenonQuery(oCommand)
' If oResult = False Then
' _logger.Warn("SQL Command was not successful. Check the log.")
' End If
' End If
' ' Insert into Firebird
' _firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
'Next
'--- END Check Property Values
#End Region
' Check the document against the configured property map and return: ' Check the document against the configured property map and return:
' - a List of valid properties ' - a List of valid properties
' - a List of missing properties ' - a List of missing properties
@ -424,7 +273,7 @@ Public Class ImportZUGFeRDFiles
Dim oStep As String Dim oStep As String
Try Try
oStep = "Firebird TBEDMI_ITEM_VALUE Delete messageID Items" oStep = "Firebird TBEDMI_ITEM_VALUE Delete messageID Items"
_firebird.ExecuteNonQueryWithConnection(oDelSQL, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction) _firebird.ExecuteNonQueryWithConnection(oDelSQL, oConnection, Firebird.TransactionMode.WithTransaction)
If oArgs.InsertIntoSQLServer = True Then If oArgs.InsertIntoSQLServer = True Then
oStep = "MSSQL TBEDMI_ITEM_VALUE Delete messageID Items" oStep = "MSSQL TBEDMI_ITEM_VALUE Delete messageID Items"
_mssql.ExecuteNonQuery(oDelSQL) _mssql.ExecuteNonQuery(oDelSQL)
@ -478,9 +327,13 @@ Public Class ImportZUGFeRDFiles
End Try End Try
End If End If
oIsSuccess = True
oMoveDirectory = oArgs.SuccessDirectory
Catch ex As MD5HashException Catch ex As MD5HashException
_logger.Error(ex) _logger.Error(ex)
oMoveDirectory = oArgs.ErrorDirectory oTransaction.Rollback()
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Already processed (MD5Hash)' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Already processed (MD5Hash)' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
@ -488,40 +341,47 @@ Public Class ImportZUGFeRDFiles
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException", _EmailOutAccountId) _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException", _EmailOutAccountId)
AddRejectedState(oMessageId, "MD5HashException", "Die gesendete Rechnung wurde bereits verarbeitet!", "") AddRejectedState(oMessageId, "MD5HashException", "Die gesendete Rechnung wurde bereits verarbeitet!", "")
Catch ex As InvalidFerdException Catch ex As InvalidFerdException
_logger.Error(ex) _logger.Error(ex)
oTransaction.Rollback()
oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - ZUGFeRD yes but incorrect format' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - ZUGFeRD yes but incorrect format' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EmailStrings.EMAIL_INVALID_DOCUMENT Dim oBody = EmailStrings.EMAIL_INVALID_DOCUMENT
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException", _EmailOutAccountId) _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException", _EmailOutAccountId)
AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "") AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "")
Catch ex As TooMuchFerdsException Catch ex As TooMuchFerdsException
_logger.Error(ex) _logger.Error(ex)
oTransaction.Rollback()
oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - More than one ZUGFeRD-document in email' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - More than one ZUGFeRD-document in email' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EmailStrings.EMAIL_TOO_MUCH_FERDS Dim oBody = EmailStrings.EMAIL_TOO_MUCH_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException", _EmailOutAccountId) _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException", _EmailOutAccountId)
AddRejectedState(oMessageId, "TooMuchFerdsException", "Email enthielt mehr als ein ZUGFeRD-Dokument", "") AddRejectedState(oMessageId, "TooMuchFerdsException", "Email enthielt mehr als ein ZUGFeRD-Dokument", "")
Catch ex As NoFerdsException Catch ex As NoFerdsException
_logger.Error(ex) _logger.Error(ex)
oTransaction.Rollback()
oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - no ZUGFeRD-Document in email' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - no ZUGFeRD-Document in email' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EmailStrings.EMAIL_NO_FERDS Dim oBody = EmailStrings.EMAIL_NO_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException", _EmailOutAccountId) _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException", _EmailOutAccountId)
AddRejectedState(oMessageId, "NoFerdsException", " Email enthielt keine ZUGFeRD-Dokumente", "") AddRejectedState(oMessageId, "NoFerdsException", " Email enthielt keine ZUGFeRD-Dokumente", "")
Catch ex As MissingValueException Catch ex As MissingValueException
_logger.Error(ex) _logger.Error(ex)
oTransaction.Rollback()
oMoveDirectory = oArgs.ErrorDirectory
Dim oMessage As String = "" Dim oMessage As String = ""
For Each prop In oMissingProperties For Each prop In oMissingProperties
oMessage &= $"- {prop}" oMessage &= $"- {prop}"
@ -534,19 +394,34 @@ Public Class ImportZUGFeRDFiles
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException", _EmailOutAccountId) _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException", _EmailOutAccountId)
AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage) AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage)
Catch ex As OutOfMemoryException
_logger.Warn("OutOfMemory Error occurred: {0}", ex.Message)
_logger.Error(ex)
oTransaction.Rollback()
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Out of memory' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL)
AddRejectedState(oMessageId, "OutOfMemoryException", "", ex.Message)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Unknown Error occurred: {0}", ex.Message) _logger.Warn("Unknown Error occurred: {0}", ex.Message)
_logger.Error(ex) _logger.Error(ex)
oTransaction.Rollback()
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Unknown error occured' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Unknown error occured' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
oMoveDirectory = oArgs.ErrorDirectory oMoveDirectory = oArgs.ErrorDirectory
AddRejectedState(oMessageId, "UnexpectedException", "", ex.Message) AddRejectedState(oMessageId, "UnexpectedException", "", ex.Message)
Finally Finally
oConnection.Close() oConnection.Close()
' Move all files of the current group ' Move all files of the current group
Try Try
MoveFiles(oArgs, oMessageId, oFileGroupFiles, oEmailAttachmentFiles, oEmbeddedAttachmentFiles, oMoveDirectory) MoveFiles(oArgs, oMessageId, oFileGroupFiles, oEmailAttachmentFiles, oEmbeddedAttachmentFiles, oMoveDirectory, oIsSuccess)
_logger.Info("Finished processing file group {0}", oMessageId) _logger.Info("Finished processing file group {0}", oMessageId)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Could not move files!") _logger.Warn("Could not move files!")
@ -567,9 +442,23 @@ Public Class ImportZUGFeRDFiles
End Try End Try
End Sub End Sub
Private Sub MoveFiles(Args As WorkerArgs, MessageId As String, Files As List(Of FileInfo), AttachmentFiles As List(Of FileInfo), EmbeddedAttachments As List(Of PDFAttachments.AttachmentResult), MoveDirectory As String) Private Sub MoveFiles(
Args As WorkerArgs,
MessageId As String,
Files As List(Of FileInfo),
AttachmentFiles As List(Of FileInfo),
EmbeddedAttachments As List(Of PDFAttachments.AttachmentResult),
MoveDirectory As String,
IsSuccess As Boolean)
Dim oFinalMoveDirectory As String = MoveDirectory Dim oFinalMoveDirectory As String = MoveDirectory
Dim oAttachmentDirectory As String = Path.Combine(MoveDirectory, Args.AttachmentsSubDirectory) Dim oDateSubDirectoryName As String = Now.ToString("yyyy-MM-dd")
Dim oAttachmentDirectory As String = Path.Combine(MoveDirectory, Args.AttachmentsSubDirectory, oDateSubDirectoryName)
' Files will be moved to a subfolder for the current day if they are rejected
If Not IsSuccess Then
oFinalMoveDirectory = Path.Combine(oFinalMoveDirectory, oDateSubDirectoryName)
End If
' Create directories if they don't exist ' Create directories if they don't exist
If Not Directory.Exists(oFinalMoveDirectory) Then If Not Directory.Exists(oFinalMoveDirectory) Then

View File

@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")> <Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Digital Data")> <Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("Modules.Jobs")> <Assembly: AssemblyProduct("Modules.Jobs")>
<Assembly: AssemblyCopyright("Copyright © 2018")> <Assembly: AssemblyCopyright("Copyright © 2020")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern ' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
<Assembly: AssemblyVersion("1.3.0.5")> <Assembly: AssemblyVersion("1.3.0.8")>
<Assembly: AssemblyFileVersion("1.3.0.5")> <Assembly: AssemblyFileVersion("1.3.0.8")>

View File

@ -90,6 +90,7 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Compile Include="Watch.vb" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx"> <EmbeddedResource Include="My Project\Resources.resx">

View File

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

23
Modules.Language/Watch.vb Normal file
View File

@ -0,0 +1,23 @@
Public Class Watch
Private ReadOnly _StopWatch As Stopwatch
Private ReadOnly _Name As String
Public Sub New(pName As String)
_StopWatch = New Stopwatch()
_StopWatch.Start()
_Name = pName
Debug.WriteLine($"Starting [{pName}].")
End Sub
Public Sub Restart()
_StopWatch.Restart()
Debug.WriteLine($"Starting [{_Name}].")
End Sub
Public Sub [Stop]()
_StopWatch.Stop()
Debug.WriteLine($"Stopped [{_Name}] after {_StopWatch.Elapsed.TotalSeconds} seconds.")
End Sub
End Class

View File

@ -32,4 +32,4 @@ Imports System.Runtime.InteropServices
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.0.2.0")> <Assembly: AssemblyVersion("2.0.2.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("2.0.2.0")>