Better Config, Clean Up, Add Demo Groups

This commit is contained in:
Jonathan Jenne
2019-07-16 14:59:32 +02:00
parent a8ec4e8fd4
commit 0205f583c3
9 changed files with 216 additions and 165 deletions

View File

@@ -18,17 +18,24 @@ Public Class frmResultSQL
Private DTDataSearchDefinition As DataTable
Private _activeGridView As GridView
#End Region
Public Sub New()
MyBase.New
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Private Sub frmResultDoc_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not ConfigManager.Config.ResultDataWindowSize.IsEmpty Then
Size = ConfigManager.Config.ResultDataWindowSize
End If
If Not ConfigManager.Config.ResultDataWindowLocation.IsEmpty Then
Location = ConfigManager.Config.ResultDataWindowLocation
End If
Load_Searches()
End Sub
Sub RefreshTabData(PROFILE_ID As Integer, ConID As Integer, SQLCommand As String, TabIndex As Integer, TabCaption As String)
Try
SQLCommand = clsPatterns.ReplaceAllValues(SQLCommand, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, PROFILE_ID)
Dim myGridControl As DevExpress.XtraGrid.GridControl
Dim myGridview As DevExpress.XtraGrid.Views.Grid.GridView
Dim myGridControl As GridControl
Dim myGridview As GridView
Select Case TabIndex
Case 0
GridControlDocSearch1.DataSource = Nothing
@@ -61,19 +68,6 @@ Public Class frmResultSQL
If Not IsNothing(oDatatable) Then
XtraTabControlData.TabPages(TabIndex).Text = $"{TabCaption} ({oDatatable.Rows.Count})"
clsWMDocGrid.DTDocuments = oDatatable
'Select Case TabIndex
' Case 0
' GridControlDocSearch1.DataSource = oDatatable
' Case 1
' GridControlDocSearch2.DataSource = oDatatable
' Case 2
' GridControlDocSearch3.DataSource = oDatatable
' Case 3
' GridControlDocSearch4.DataSource = oDatatable
' Case 4
' GridControlDocSearch5.DataSource = oDatatable
'End Select
myGridControl.DataSource = oDatatable
myGridControl.ForceInitialize()
Dim oxmlPath As String = ""
@@ -107,31 +101,16 @@ Public Class frmResultSQL
End Sub
Private Sub GridViewDocSearch1_ColumnWidthChanged(sender As Object, e As Views.Base.ColumnEventArgs) Handles GridViewDataSearch1.ColumnWidthChanged
_activeGridView = GridViewDataSearch1
SaveDocGridLayout()
End Sub
Private Sub frmResultDoc_Load(sender As Object, e As EventArgs) Handles Me.Load
If ConfigManager.Config.ResultDataWindowX > 0 And ConfigManager.Config.ResultDataWindowY > 0 Then
Dim oLocation As New Point(ConfigManager.Config.ResultDataWindowX, ConfigManager.Config.ResultDataWindowY)
Location = oLocation
End If
Dim oSize As New Size(ConfigManager.Config.ResultDataWindowWidth, ConfigManager.Config.ResultDataWindowHeight)
Size = oSize
Load_Searches()
End Sub
Sub Load_Searches()
If Not IsNothing(CurrDataSearch2Load) Then
Dim oSQL = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID in ({CurrDataSearch2Load}) ORDER BY TAB_INDEX"
DTDataSearchDefinition = clsDatabase.Return_Datatable(oSQL)
Dim oindex As Integer
Dim ocounter As Integer = 0
If CurrDataSearch2Load.ToString.Contains(",") Then
@@ -147,16 +126,13 @@ Public Class frmResultSQL
End Sub
Private Sub frmResultDoc_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
ConfigManager.Config.ResultDataWindowHeight = Size.Height
ConfigManager.Config.ResultDataWindowWidth = Size.Width
ConfigManager.Config.ResultDataWindowX = Location.X
ConfigManager.Config.ResultDataWindowY = Location.Y
ConfigManager.Config.ResultDataWindowSize = Size
ConfigManager.Config.ResultDataWindowLocation = Location
ConfigManager.Save()
Catch ex As Exception
Logger.Error(ex)
Logger.Info("Error in Save FormLayout: " & ex.Message)
End Try
End Sub
Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click