fix first call of EDMIService

This commit is contained in:
Jonathan Jenne 2020-12-17 16:26:14 +01:00
parent 73679224f8
commit 448410fb29
6 changed files with 32 additions and 10 deletions

View File

@ -251,7 +251,7 @@ Public Class ClassInit
End Try End Try
End Function End Function
Public Async Function InitUserLogin(Optional _User As String = "") As Task(Of Boolean) Public Function InitUserLogin(Optional _User As String = "") As Boolean
Try Try
If _User = "" Then If _User = "" Then
USER_USERNAME = Environment.UserName USER_USERNAME = Environment.UserName
@ -263,7 +263,7 @@ Public Class ClassInit
Return False Return False
End If End If
If APPSERVER_ACTIVE = True Then If APPSERVER_ACTIVE = True Then
Dim oTableResult As TableResult = Await _Client.GetDatatableByNameAsync("VWDD_USER_CLIENT", $"USER_ID = {USER_ID}") Dim oTableResult As TableResult = _Client.GetDatatableByName("VWDD_USER_CLIENT", $"USER_ID = {USER_ID}")
DT_CLIENT_USER = oTableResult.Table DT_CLIENT_USER = oTableResult.Table
Else Else

View File

@ -68,6 +68,11 @@ Public Class ctrlApplicationAssignment
Dim oWindowTitle As String = GetSQLFriendlyString(oForm.WindowTitle) Dim oWindowTitle As String = GetSQLFriendlyString(oForm.WindowTitle)
Dim oProcessName As String = oForm.ProcessName Dim oProcessName As String = oForm.ProcessName
If oForm.IgnoreProcess = True Then
oProcessName = "_CATCHALL_"
End If
If oProcessName <> "" Then If oProcessName <> "" Then
Dim oSQL = String.Format("INSERT INTO TBCW_PROFILE_PROCESS (PROFILE_ID,PROC_NAME,ADDED_WHO) VALUES ({0},'{1}','{2}')", ProfileId, oProcessName, Environment.UserName) Dim oSQL = String.Format("INSERT INTO TBCW_PROFILE_PROCESS (PROFILE_ID,PROC_NAME,ADDED_WHO) VALUES ({0},'{1}','{2}')", ProfileId, oProcessName, Environment.UserName)
If Database.ExecuteNonQuery(oSQL) = False Then If Database.ExecuteNonQuery(oSQL) = False Then

View File

@ -34,6 +34,7 @@ Partial Class frmProcessCapture
Me.Label4 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label()
Me.Button2 = New System.Windows.Forms.Button() Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button() Me.Button1 = New System.Windows.Forms.Button()
Me.chkIgnoreProcessName = New System.Windows.Forms.CheckBox()
Me.SuspendLayout() Me.SuspendLayout()
' '
'txtPID 'txtPID
@ -77,7 +78,7 @@ Partial Class frmProcessCapture
'Label3 'Label3
' '
Me.Label3.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(12, 98) Me.Label3.Location = New System.Drawing.Point(12, 131)
Me.Label3.Name = "Label3" Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(338, 42) Me.Label3.Size = New System.Drawing.Size(338, 42)
Me.Label3.TabIndex = 4 Me.Label3.TabIndex = 4
@ -112,7 +113,7 @@ Partial Class frmProcessCapture
Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Button2.Image = Global.DD_Clipboard_Watcher.My.Resources.Resources.cancel Me.Button2.Image = Global.DD_Clipboard_Watcher.My.Resources.Resources.cancel
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button2.Location = New System.Drawing.Point(191, 153) Me.Button2.Location = New System.Drawing.Point(191, 176)
Me.Button2.Name = "Button2" Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(159, 34) Me.Button2.Size = New System.Drawing.Size(159, 34)
Me.Button2.TabIndex = 0 Me.Button2.TabIndex = 0
@ -125,18 +126,28 @@ Partial Class frmProcessCapture
Me.Button1.Enabled = False Me.Button1.Enabled = False
Me.Button1.Image = Global.DD_Clipboard_Watcher.My.Resources.Resources.add Me.Button1.Image = Global.DD_Clipboard_Watcher.My.Resources.Resources.add
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button1.Location = New System.Drawing.Point(12, 153) Me.Button1.Location = New System.Drawing.Point(12, 176)
Me.Button1.Name = "Button1" Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(159, 34) Me.Button1.Size = New System.Drawing.Size(159, 34)
Me.Button1.TabIndex = 0 Me.Button1.TabIndex = 0
Me.Button1.Text = "Fenster zuordnen" Me.Button1.Text = "Fenster zuordnen"
Me.Button1.UseVisualStyleBackColor = True Me.Button1.UseVisualStyleBackColor = True
' '
'chkIgnoreProcessName
'
Me.chkIgnoreProcessName.Location = New System.Drawing.Point(12, 85)
Me.chkIgnoreProcessName.Name = "chkIgnoreProcessName"
Me.chkIgnoreProcessName.Size = New System.Drawing.Size(338, 24)
Me.chkIgnoreProcessName.TabIndex = 5
Me.chkIgnoreProcessName.Text = "Prozess-/Fenster-Erkennung überspringen"
Me.chkIgnoreProcessName.UseVisualStyleBackColor = True
'
'frmProcessCapture 'frmProcessCapture
' '
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(362, 199) Me.ClientSize = New System.Drawing.Size(362, 222)
Me.Controls.Add(Me.chkIgnoreProcessName)
Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label2)
@ -146,7 +157,7 @@ Partial Class frmProcessCapture
Me.Controls.Add(Me.txtPID) Me.Controls.Add(Me.txtPID)
Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.Button1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.IconOptions.Icon = CType(resources.GetObject("frmProcessCapture.IconOptions.Icon"), System.Drawing.Icon)
Me.Name = "frmProcessCapture" Me.Name = "frmProcessCapture"
Me.Text = "Prozess Auswertung" Me.Text = "Prozess Auswertung"
Me.TopMost = True Me.TopMost = True
@ -164,4 +175,5 @@ Partial Class frmProcessCapture
Friend WithEvents Label4 As Label Friend WithEvents Label4 As Label
Friend WithEvents Button2 As Button Friend WithEvents Button2 As Button
Friend WithEvents Button1 As Button Friend WithEvents Button1 As Button
Friend WithEvents chkIgnoreProcessName As CheckBox
End Class End Class

View File

@ -121,7 +121,7 @@
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="frmProcessCapture.IconOptions.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAYAEBAQAAEABAAoAQAAZgAAABAQAAABAAgAaAUAAI4BAAAQEAAAAQAgAGgEAAD2BgAAICAQAAEA AAABAAYAEBAQAAEABAAoAQAAZgAAABAQAAABAAgAaAUAAI4BAAAQEAAAAQAgAGgEAAD2BgAAICAQAAEA
BADoAgAAXgsAACAgAAABAAgAqAgAAEYOAAAgIAAAAQAgAKgQAADuFgAAKAAAABAAAAAgAAAAAQAEAAAA BADoAgAAXgsAACAgAAABAAgAqAgAAEYOAAAgIAAAAQAgAKgQAADuFgAAKAAAABAAAAAgAAAAAQAEAAAA

View File

@ -4,6 +4,7 @@ Public Class frmProcessCapture
Public ProcessId As Integer Public ProcessId As Integer
Public ProcessName As String Public ProcessName As String
Public WindowTitle As String Public WindowTitle As String
Public IgnoreProcess As Boolean = False
Private _CurrentProcess As String = String.Empty Private _CurrentProcess As String = String.Empty
@ -50,4 +51,8 @@ Public Class frmProcessCapture
Private Sub frmProcessCapture_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmProcessCapture_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True Timer1.Enabled = True
End Sub End Sub
Private Sub chkIgnoreProcessName_CheckedChanged(sender As Object, e As EventArgs) Handles chkIgnoreProcessName.CheckedChanged
IgnoreProcess = chkIgnoreProcessName.Checked
End Sub
End Class End Class

View File

@ -32,7 +32,7 @@ Public NotInheritable Class frmSplash
Return _step * (100 / InitSteps) Return _step * (100 / InitSteps)
End Function End Function
Private Async Function bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) As Task Private Function bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) As Task
Try Try
Dim Init = New ClassInit() Dim Init = New ClassInit()
Worker.ReportProgress(CalcProgress(1), "Initializing Logger") Worker.ReportProgress(CalcProgress(1), "Initializing Logger")
@ -48,7 +48,7 @@ Public NotInheritable Class frmSplash
Thread.Sleep(200) Thread.Sleep(200)
Worker.ReportProgress(CalcProgress(4), "Initializing User-Configuration") Worker.ReportProgress(CalcProgress(4), "Initializing User-Configuration")
If Await Init.InitUserLogin = False Then If Init.InitUserLogin = False Then
If ERROR_INIT = "" Then If ERROR_INIT = "" Then
ERROR_INIT = "INVALID USER" ERROR_INIT = "INVALID USER"
End If End If