This commit is contained in:
2020-10-27 14:04:36 +01:00
parent 7051a71e01
commit d38efc1cbe
58 changed files with 4073 additions and 3737 deletions

View File

@@ -3,6 +3,8 @@ Imports DevExpress.XtraTab
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.Common
Imports System.Random
Public Class frmSearchStart
Private Logger As Logger
@@ -19,6 +21,7 @@ Public Class frmSearchStart
Private DTSearchTerms As DataTable
Private oDTAttributes As DataTable
Private SEARCH_COUNT As Integer = 0
Private _Environment As Environment
Public Sub New(pDTSearchProfiles As DataTable)
' Dieser Aufruf ist für den Designer erforderlich.
@@ -155,11 +158,11 @@ Public Class frmSearchStart
oDTAttributes = Nothing
oDTAttributes = oDT.Clone()
oDT.Select("", "SEQUENCE").CopyToDataTable(oDTAttributes, LoadOption.PreserveChanges)
oDTAttributes.Columns.Add("MULTISELECT", GetType(Boolean))
oDTAttributes.AcceptChanges()
For Each oAttributeRow As DataRow In oDTAttributes.Rows
oAttributeRow.Item("MULTISELECT") = False
Next
'oDTAttributes.Columns.Add("MULTISELECT", GetType(Boolean))
'oDTAttributes.AcceptChanges()
'For Each oAttributeRow As DataRow In oDTAttributes.Rows
' oAttributeRow.Item("MULTISELECT") = False
'Next
Dim oControlCount As Integer = 1
Dim oControlRow As Integer = 0
Dim oControls As New ClassControlCreator(TabSelected, Me)
@@ -180,7 +183,8 @@ Public Class frmSearchStart
Dim oSingleResult As Boolean = False
Dim oAttriTitle As String = oAttributeRow.Item("ATTRIBUTE_TITLE").ToString
Dim oAttriID As String = oAttributeRow.Item("ATTRIBUTE_ID").ToString
Dim oAttriID As Integer = CInt(oAttributeRow.Item("ATTRIBUTE_ID"))
' Dim oDepAttriID1 As String = oAttributeRow.Item("DEPENDING_ATTRIBUTE1").ToString
Dim oAttriTYPE As String = oAttributeRow.Item("ATTRIBUTE_TYPE").ToString
If oControlCount = 1 Or oControlCount = 5 Or oControlCount = 9 Then
oControlRow += 1
@@ -207,7 +211,9 @@ Public Class frmSearchStart
Dim oControlHeight As Integer = CInt(oAttributeRow.Item("HEIGHT"))
Dim oControlWidth As Integer = CInt(oAttributeRow.Item("WIDTH"))
If CBool(oAttributeRow.Item("MULTISELECT")) = True Then
oControlWidth += 50
End If
'Erst mal das Label hinzufügen
'If oAttriTYPE <> "BIT" Then
addLabel(oAttriTitle, oXPosition, oYPositionLabel)
@@ -236,13 +242,17 @@ Public Class frmSearchStart
Dim myDGV As GridControl = CType(oMyControl, GridControl)
myDGV.ContextMenuStrip = ContextMenuStripMultiselect
Dim omyDTSource As DataTable = CType(myDGV.DataSource, DataTable)
If Not IsNothing(omyDTSource) Then
If omyDTSource.Rows.Count = 1 Then
oSingleResult = True
AddSearchAttribute(oAttriID, oAttriTitle, omyDTSource.Rows(0).Item(oAttriTitle).ToString)
End If
End If
Dim oView As DevExpress.XtraGrid.Views.Grid.GridView
oView = CType(myDGV.MainView, GridView)
AddHandler oView.FocusedRowChanged, AddressOf FocusedRowChanged
If omyDTSource.Rows.Count = 1 Then
oSingleResult = True
AddSearchAttribute(oAttriID, oAttriTitle, omyDTSource.Rows(0).Item(oAttriTitle).ToString)
End If
ElseIf oAttriTYPE = "DATE" Then
oMyControl = oControls.CreateExistingDatepicker(oAttributeRow, oXPosition, oYPositionControl)
Dim myDTP As DateEdit = CType(oMyControl, DateEdit)
@@ -307,6 +317,19 @@ Public Class frmSearchStart
Dim oAttrID = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrID
Dim oAttrTitle = DirectCast(oCurrentControl.Tag, ClassControlCreator.ControlMetadata).AttrTitle
AddSearchAttribute(oAttrID, oAttrTitle, oResult)
'For Each oAttributeRow1 As DataRow In oDTAttributes.Rows
' If CInt(oAttributeRow1.Item("DEPENDING_ATTRIBUTE1")) = oAttrID Then
' Logger.Debug($"Another Attribute [{oAttrID}]is depending to this [{oAttrID}] one..")
' Dim oSourceSQL As String = oAttributeRow1.Item("SOURCE_SQL").ToString
' oSourceSQL = oSourceSQL.Replace("@DEPENDING_IDB_OBJECT", My.Application.User.Language)
' oSourceSQL = oSourceSQL.Replace("@USER_LANGUAGE", My.Application.User.Language)
' oSourceSQL = oSourceSQL.Replace("@pUSER_ID", My.Application.User.UserId)
' oSourceSQL = oSourceSQL.Replace("@RESULT_TITLE", oAttributeRow1.Item("ATTRIBUTE_TITLE").ToString)
' Dim oDTSource As DataTable
' oDTSource = My.Database_IDB.GetDatatable(oSourceSQL)
' End If
'Next
' Return oResult
'Else : Return Nothing
@@ -590,7 +613,53 @@ Public Class frmSearchStart
Next
End If
End Sub
Private Sub BracketLeftToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BracketLeftToolStripMenuItem.Click
Dim rowView As DataRowView = GridViewSearchTerms.GetFocusedRow()
If IsNothing(rowView) = False Then
Dim oAttrID As String = rowView.Item("AttrID")
Dim oSearchTerm As String = rowView.Item("SearchTerm")
For Each oRow As DataRow In DTSearchTerms.Rows
If oRow.Item("AttrID") = oAttrID And oRow.Item("SearchTerm") = oSearchTerm Then
oRow.Item("BracketLeft") = "("
DTSearchTerms.AcceptChanges()
Exit For
End If
Next
End If
End Sub
Private Sub KlammerRechtsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles KlammerRechtsToolStripMenuItem.Click
Dim rowView As DataRowView = GridViewSearchTerms.GetFocusedRow()
If IsNothing(rowView) = False Then
Dim oAttrID As String = rowView.Item("AttrID")
Dim oSearchTerm As String = rowView.Item("SearchTerm")
For Each oRow As DataRow In DTSearchTerms.Rows
If oRow.Item("AttrID") = oAttrID And oRow.Item("SearchTerm") = oSearchTerm Then
oRow.Item("BracketRight") = ")"
DTSearchTerms.AcceptChanges()
Exit For
End If
Next
End If
End Sub
Private Sub KlammerEntfernenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles KlammerEntfernenToolStripMenuItem.Click
Dim rowView As DataRowView = GridViewSearchTerms.GetFocusedRow()
If IsNothing(rowView) = False Then
Dim oAttrID As String = rowView.Item("AttrID")
Dim oSearchTerm As String = rowView.Item("SearchTerm")
For Each oRow As DataRow In DTSearchTerms.Rows
If oRow.Item("AttrID") = oAttrID And oRow.Item("SearchTerm") = oSearchTerm Then
oRow.Item("BracketRight") = ""
oRow.Item("BracketLeft") = ""
DTSearchTerms.AcceptChanges()
Exit For
End If
Next
End If
End Sub
Private Sub frmSearchStart_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
My.UIConfig.SearchForm.Location = Me.Location
My.UIConfigManager.Save()
@@ -618,7 +687,35 @@ Public Class frmSearchStart
End If
oCount += 1
Next
MsgBox(oSEARCH_SQL)
Dim oEnvironment As New DigitalData.Modules.ZooFlow.Environment() With {
.User = My.Application.User,
.Modules = My.Application.Modules,
.Database = My.Database,
.Settings = My.Application.Settings
}
Dim oDTSearchResult As DataTable = My.Database_IDB.GetDatatable(oSEARCH_SQL)
If oDTSearchResult.Rows.Count > 0 Then
Dim oShortGuid = Guid.NewGuid()
Dim oWindowGuid = $"{PSEARCH_ID.ToString}-{My.User.Name}" '{String.Join("-", oShortGuid.ToString)}"
Dim oParams = New DocumentResultParams() With {
.WindowGuid = oWindowGuid
}
oParams.Results.Add(New DocumentResult() With {
.Title = TabSelected.Text,
.Datatable = oDTSearchResult
})
Dim oForm As New frmDocumentResultList(My.LogConfig, oEnvironment, oParams)
' AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
' OpenForms.Add(oForm)
oForm.Show()
Else
Display_InfoItem("No results for this searchcombination!", Color.OrangeRed)
End If
Catch ex As Exception
End Try
@@ -628,7 +725,6 @@ Public Class frmSearchStart
Private Function GetSearchTerm_for_Type(pAttrID As Int16, pAttrTitle As String, pCriteria As String, pTERM As String) As String
Dim oRETURN As String = ""
Dim oDT As New DataTable
Dim oFilter As String = $"GUID = {pAttrID}"
Dim oFilteredRows() As DataRow = My.DTAttributes.Select(oFilter)
If oFilteredRows.Length = 1 Then