add distinct to regex doctype query, make on top button enabled by default

This commit is contained in:
Jonathan Jenne 2020-04-30 15:31:19 +02:00
parent e5d3d37005
commit 70694273f2
3 changed files with 24 additions and 19 deletions

View File

@ -164,7 +164,9 @@ Partial Class frmIndex
'
'BarCheckItem1
'
Me.BarCheckItem1.BindableChecked = True
resources.ApplyResources(Me.BarCheckItem1, "BarCheckItem1")
Me.BarCheckItem1.Checked = True
Me.BarCheckItem1.Id = 5
Me.BarCheckItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarCheckItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarCheckItem1.Name = "BarCheckItem1"

View File

@ -639,7 +639,7 @@
<value>DocumentViewer1</value>
</data>
<data name="&gt;&gt;DocumentViewer1.Type" xml:space="preserve">
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null</value>
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;DocumentViewer1.Parent" xml:space="preserve">
<value>SplitContainer1.Panel2</value>

View File

@ -1455,7 +1455,7 @@ Public Class frmIndex
Load_String()
DTTBGI_REGEX_DOCTYPE = ClassDatabase.Return_Datatable("SELECT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID")
DTTBGI_REGEX_DOCTYPE = ClassDatabase.Return_Datatable("SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID")
MULTIFILES = ClassDatabase.Execute_Scalar("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", MyConnectionString, True)
MULTIINDEXING_ACTIVE = False
If MULTIFILES > 0 Then
@ -1507,24 +1507,27 @@ Public Class frmIndex
FormLoaded = True
If CONFIG.Config.ProfilePreselection Then
checkItemPreselection.Checked = True
If CURRENT_LASTDOKART <> "" Then
cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(CURRENT_LASTDOKART)
End If
End If
Try
If DTTBGI_REGEX_DOCTYPE.Rows.Count > 0 Then
For Each oRoW As DataRow In DTTBGI_REGEX_DOCTYPE.Rows
Dim oOnlyFilename = Path.GetFileName(CURRENT_WORKFILE)
If Regex.IsMatch(oOnlyFilename, oRoW.Item("Regex")) Then
LOGGER.Info($"There is a match on REGEX_DOCTYPE: {oRoW.Item("DOCTYPE")}")
cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(oRoW.Item("DOCTYPE"))
Exit For
End If
Next
' Letzte Auswahl merken überschreibt die automatische selektion
If CONFIG.Config.ProfilePreselection Then
checkItemPreselection.Checked = True
If CURRENT_LASTDOKART <> "" Then
cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(CURRENT_LASTDOKART)
End If
Else
If DTTBGI_REGEX_DOCTYPE.Rows.Count > 0 Then
For Each oRoW As DataRow In DTTBGI_REGEX_DOCTYPE.Rows
Dim oOnlyFilename = Path.GetFileName(CURRENT_WORKFILE)
If Regex.IsMatch(oOnlyFilename, oRoW.Item("Regex")) Then
LOGGER.Info($"There is a match on REGEX_DOCTYPE: {oRoW.Item("DOCTYPE")}")
cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(oRoW.Item("DOCTYPE"))
Exit For
End If
Next
End If
End If
Catch ex As Exception
LOGGER.Info(" - Unexpected error DTTBGI_REGEX_DOCTYPE - ErrorMessage: " & vbNewLine & ex.Message)