Messanger Reminder, Anpassung NCTS Auswertung

This commit is contained in:
2023-01-09 16:31:36 +01:00
parent f82be87030
commit 7d5dc8664e
8 changed files with 100 additions and 45 deletions

View File

@@ -41,6 +41,7 @@ Partial Class frmMessenger
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel6 = New System.Windows.Forms.Panel()
Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label()
Me.cbxInaktiveChats = New System.Windows.Forms.CheckBox()
Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel5 = New System.Windows.Forms.Panel()
@@ -51,7 +52,6 @@ Partial Class frmMessenger
Me.Button9 = New System.Windows.Forms.Button()
Me.btnTEST = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label()
Me.cbxInaktiveChatsSpecial = New System.Windows.Forms.CheckBox()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel()
@@ -95,6 +95,7 @@ Partial Class frmMessenger
Me.Timer_REFRESH = New System.Windows.Forms.Timer(Me.components)
Me.cntxt = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ChatDeaktivierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolChatReminder = New System.Windows.Forms.ToolStripMenuItem()
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn()
@@ -235,6 +236,20 @@ Partial Class frmMessenger
Me.Panel6.Size = New System.Drawing.Size(275, 21)
Me.Panel6.TabIndex = 7
'
'lblLKWChat_MsgCntInaktiv
'
Me.lblLKWChat_MsgCntInaktiv.BackColor = System.Drawing.Color.Red
Me.lblLKWChat_MsgCntInaktiv.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.lblLKWChat_MsgCntInaktiv.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Bold)
Me.lblLKWChat_MsgCntInaktiv.ForeColor = System.Drawing.Color.White
Me.lblLKWChat_MsgCntInaktiv.Location = New System.Drawing.Point(104, -1)
Me.lblLKWChat_MsgCntInaktiv.Name = "lblLKWChat_MsgCntInaktiv"
Me.lblLKWChat_MsgCntInaktiv.Size = New System.Drawing.Size(26, 23)
Me.lblLKWChat_MsgCntInaktiv.TabIndex = 106
Me.lblLKWChat_MsgCntInaktiv.Text = "99"
Me.lblLKWChat_MsgCntInaktiv.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.lblLKWChat_MsgCntInaktiv.Visible = False
'
'cbxInaktiveChats
'
Me.cbxInaktiveChats.AutoSize = True
@@ -398,20 +413,6 @@ Partial Class frmMessenger
Me.Panel2.Size = New System.Drawing.Size(275, 23)
Me.Panel2.TabIndex = 6
'
'lblLKWChat_MsgCntInaktiv
'
Me.lblLKWChat_MsgCntInaktiv.BackColor = System.Drawing.Color.Red
Me.lblLKWChat_MsgCntInaktiv.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.lblLKWChat_MsgCntInaktiv.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Bold)
Me.lblLKWChat_MsgCntInaktiv.ForeColor = System.Drawing.Color.White
Me.lblLKWChat_MsgCntInaktiv.Location = New System.Drawing.Point(104, -1)
Me.lblLKWChat_MsgCntInaktiv.Name = "lblLKWChat_MsgCntInaktiv"
Me.lblLKWChat_MsgCntInaktiv.Size = New System.Drawing.Size(26, 23)
Me.lblLKWChat_MsgCntInaktiv.TabIndex = 106
Me.lblLKWChat_MsgCntInaktiv.Text = "99"
Me.lblLKWChat_MsgCntInaktiv.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.lblLKWChat_MsgCntInaktiv.Visible = False
'
'cbxInaktiveChatsSpecial
'
Me.cbxInaktiveChatsSpecial.AutoSize = True
@@ -935,16 +936,22 @@ Partial Class frmMessenger
'cntxt
'
Me.cntxt.ImageScalingSize = New System.Drawing.Size(24, 24)
Me.cntxt.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ChatDeaktivierenToolStripMenuItem})
Me.cntxt.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ChatDeaktivierenToolStripMenuItem, Me.toolChatReminder})
Me.cntxt.Name = "cntxt"
Me.cntxt.Size = New System.Drawing.Size(167, 26)
Me.cntxt.Size = New System.Drawing.Size(181, 70)
'
'ChatDeaktivierenToolStripMenuItem
'
Me.ChatDeaktivierenToolStripMenuItem.Name = "ChatDeaktivierenToolStripMenuItem"
Me.ChatDeaktivierenToolStripMenuItem.Size = New System.Drawing.Size(166, 22)
Me.ChatDeaktivierenToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.ChatDeaktivierenToolStripMenuItem.Text = "Chat deaktivieren"
'
'toolChatReminder
'
Me.toolChatReminder.Name = "toolChatReminder"
Me.toolChatReminder.Size = New System.Drawing.Size(180, 22)
Me.toolChatReminder.Text = "Reminder ein/aus"
'
'DataGridViewTextBoxColumn1
'
Me.DataGridViewTextBoxColumn1.HeaderText = "Column1"
@@ -1085,4 +1092,5 @@ Partial Class frmMessenger
Friend WithEvents UsrCntlChat_Art_Btn_LKWCHAT As usrCntlChat_Art_Btn
Friend WithEvents UsrCntlChat_Art_Btn_SNDCHAT As usrCntlChat_Art_Btn
Friend WithEvents lblLKWChat_MsgCntInaktiv As Label
Friend WithEvents toolChatReminder As ToolStripMenuItem
End Class

View File

@@ -1,7 +1,10 @@
Imports System.Drawing
Imports System.IO
Imports System.Threading
Imports System.Web.UI.WebControls.WebParts
Imports System.Windows.Forms
Imports Util
Imports VERAG_PROG_ALLGEMEIN.cMessenger
Public Class frmMessenger
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
@@ -1310,4 +1313,31 @@ Public Class frmMessenger
Private Sub UsrCntlChat_Art_snd_Load(ctl As usrCntlChat_Art_Btn) Handles UsrCntlChat_Art_Btn_SNDCHAT.CLICKED
End Sub
Private Sub toolChatReminder_Click(sender As Object, e As EventArgs) Handles toolChatReminder.Click
If dgvChats.SelectedRows.Count > 0 Then
'Prüfen, ob bereits ein Reminder aktiv ist....
Dim RemidnerMsgId As Integer = SQL.getValueTxtBySql("SELECT TOP (1) [chatMg_id] FROM tblMessenger_Chat INNER JOIN tblMessenger_ChatMessages ON chat_id=chatMg_chatId INNER JOIN [tblMessenger_ChatMessageStatus] on chatmg_id=[chatMgSt_chatMsgId] where [chatMgSt_art]='REMINDER' AND [chatMgSt_MaId]='" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "' AND [chatMgSt_flag]=0 and chat_id='" & dgvChats.SelectedRows(0).Cells("chat_id").Value & "'", "ADMIN",,, -1)
If RemidnerMsgId > 0 Then '...wenn JA, Reminder zurücksetzen
' SQL.doSQL("UPDATE [tblMessenger_ChatMessageStatus] set [chatMgSt_flag]=1, [chatMgSt_gelesen]=1 WHERE [chatMgSt_chatMsgId] = '" & RemidnerMsgId & "' AND [chatMgSt_art]='REMINDER' AND [chatMgSt_MaId]='" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "'", "ADMIN")
SQL.doSQL("DELETE [tblMessenger_ChatMessageStatus] WHERE [chatMgSt_chatMsgId] = '" & RemidnerMsgId & "' AND [chatMgSt_art]='REMINDER' AND [chatMgSt_MaId]='" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "'", "ADMIN")
intiDGVChats()
Else '...wenn NEIN, Reminder setzen
Dim MsgId As Integer = SQL.getValueTxtBySql("SELECT TOP (1) [chatMg_id] FROM [tblMessenger_ChatMessages] where chatMg_chatid='" & dgvChats.SelectedRows(0).Cells("chat_id").Value & "' order by [chatMg_datetime] desc", "ADMIN",,, -1)
If MsgId > 0 Then
Dim STAT As New cMessenger_ChatMessageStatus(MsgId, VERAG_PROG_ALLGEMEIN.cAllgemein.USRID, False, "REMINDER", False)
STAT.SAVE()
intiDGVChats()
End If
End If
End If
End Sub
End Class