MS Remove Chat

This commit is contained in:
2020-05-20 14:53:55 +02:00
parent a950c09802
commit 07aa03a47e
18 changed files with 20 additions and 899 deletions

View File

@@ -109,9 +109,22 @@ Public Class ThreadRunner
Private Sub DoWork(sender As Object, e As DoWorkEventArgs) Handles _workerThread.DoWork
Try
Dim args As WorkerArgs = e.Argument
Try
Dim oSQL = "SELECT [EMAIL_MSGID] FROM TBEMLP_HISTORY WHERE STATUS = 'REJECTED' and DATEDIFF(DAY,CHANGED_WHEN,GETDATE()) <= 5 order by guid desc"
Dim oDT As DataTable = _mssql.GetDatatable(oSQL)
If Not IsNothing(oDT) Then
For Each oROW As DataRow In oDT.Rows
Dim oUpdate = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET REJECTED = True WHERE MESSAGE_ID = '{oROW.Item(0)}' and REJECTED = false"
_firebird.ExecuteNonQuery(oUpdate)
Next
End If
Catch ex As Exception
_logger.Warn("Error while Updating REJECTED State: " & ex.Message)
End Try
Dim args As WorkerArgs = e.Argument
_logger.Debug("Background worker running..")
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, My.Settings.MSSQLEmailOutAccountID, _mssql)
job.Start(args)
Catch ex As Exception