neu
This commit is contained in:
114
VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb
generated
114
VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb
generated
@@ -45,10 +45,14 @@ Partial Class frmMessenger
|
||||
Me.UsrCntlMessenger_ChatAnhang1 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatAnhang()
|
||||
Me.UsrCntlMessenger_ChatElement2 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatElement()
|
||||
Me.UsrCntlMessenger_ChatElement3 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatElement()
|
||||
Me.Panel3 = New System.Windows.Forms.Panel()
|
||||
Me.Button5 = New System.Windows.Forms.Button()
|
||||
Me.Panel4 = New System.Windows.Forms.Panel()
|
||||
Me.lblChatName = New System.Windows.Forms.Label()
|
||||
Me.lblOnlineOffline = New System.Windows.Forms.Label()
|
||||
Me.pnl = New System.Windows.Forms.Panel()
|
||||
Me.pic = New System.Windows.Forms.PictureBox()
|
||||
Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel()
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.btn = New System.Windows.Forms.Button()
|
||||
Me.rtbChatMessage = New System.Windows.Forms.RichTextBox()
|
||||
@@ -68,6 +72,7 @@ Partial Class frmMessenger
|
||||
Me.SplitContainer1.Panel2.SuspendLayout()
|
||||
Me.SplitContainer1.SuspendLayout()
|
||||
Me.MyFlowLayoutPanel1.SuspendLayout()
|
||||
Me.Panel3.SuspendLayout()
|
||||
Me.pnl.SuspendLayout()
|
||||
CType(Me.pic, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.cntxt.SuspendLayout()
|
||||
@@ -89,7 +94,7 @@ Partial Class frmMessenger
|
||||
'SplitContainer.Panel2
|
||||
'
|
||||
Me.SplitContainer.Panel2.Controls.Add(Me.SplitContainer1)
|
||||
Me.SplitContainer.Size = New System.Drawing.Size(817, 685)
|
||||
Me.SplitContainer.Size = New System.Drawing.Size(817, 728)
|
||||
Me.SplitContainer.SplitterDistance = 272
|
||||
Me.SplitContainer.TabIndex = 0
|
||||
'
|
||||
@@ -136,7 +141,7 @@ Partial Class frmMessenger
|
||||
Me.dgvChats.RowsDefaultCellStyle = DataGridViewCellStyle4
|
||||
Me.dgvChats.RowTemplate.Height = 30
|
||||
Me.dgvChats.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
|
||||
Me.dgvChats.Size = New System.Drawing.Size(272, 613)
|
||||
Me.dgvChats.Size = New System.Drawing.Size(272, 656)
|
||||
Me.dgvChats.TabIndex = 0
|
||||
'
|
||||
'btnTEST
|
||||
@@ -156,7 +161,7 @@ Partial Class frmMessenger
|
||||
'
|
||||
Me.Panel2.Controls.Add(Me.cbxInaktiveChats)
|
||||
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.Panel2.Location = New System.Drawing.Point(0, 655)
|
||||
Me.Panel2.Location = New System.Drawing.Point(0, 698)
|
||||
Me.Panel2.Name = "Panel2"
|
||||
Me.Panel2.Size = New System.Drawing.Size(272, 30)
|
||||
Me.Panel2.TabIndex = 6
|
||||
@@ -227,12 +232,13 @@ Partial Class frmMessenger
|
||||
'SplitContainer1.Panel1
|
||||
'
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.MyFlowLayoutPanel1)
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.Panel3)
|
||||
'
|
||||
'SplitContainer1.Panel2
|
||||
'
|
||||
Me.SplitContainer1.Panel2.Controls.Add(Me.pnl)
|
||||
Me.SplitContainer1.Size = New System.Drawing.Size(541, 685)
|
||||
Me.SplitContainer1.SplitterDistance = 438
|
||||
Me.SplitContainer1.Size = New System.Drawing.Size(541, 728)
|
||||
Me.SplitContainer1.SplitterDistance = 464
|
||||
Me.SplitContainer1.TabIndex = 0
|
||||
'
|
||||
'MyFlowLayoutPanel1
|
||||
@@ -244,9 +250,9 @@ Partial Class frmMessenger
|
||||
Me.MyFlowLayoutPanel1.Controls.Add(Me.UsrCntlMessenger_ChatElement2)
|
||||
Me.MyFlowLayoutPanel1.Controls.Add(Me.UsrCntlMessenger_ChatElement3)
|
||||
Me.MyFlowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.MyFlowLayoutPanel1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.MyFlowLayoutPanel1.Location = New System.Drawing.Point(0, 44)
|
||||
Me.MyFlowLayoutPanel1.Name = "MyFlowLayoutPanel1"
|
||||
Me.MyFlowLayoutPanel1.Size = New System.Drawing.Size(541, 438)
|
||||
Me.MyFlowLayoutPanel1.Size = New System.Drawing.Size(541, 420)
|
||||
Me.MyFlowLayoutPanel1.TabIndex = 0
|
||||
'
|
||||
'UsrCntlMessenger_ChatElement1
|
||||
@@ -287,26 +293,86 @@ Partial Class frmMessenger
|
||||
Me.UsrCntlMessenger_ChatElement3.Size = New System.Drawing.Size(378, 48)
|
||||
Me.UsrCntlMessenger_ChatElement3.TabIndex = 6
|
||||
'
|
||||
'Panel3
|
||||
'
|
||||
Me.Panel3.BackColor = System.Drawing.Color.White
|
||||
Me.Panel3.Controls.Add(Me.Button5)
|
||||
Me.Panel3.Controls.Add(Me.Panel4)
|
||||
Me.Panel3.Controls.Add(Me.lblChatName)
|
||||
Me.Panel3.Controls.Add(Me.lblOnlineOffline)
|
||||
Me.Panel3.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.Panel3.Location = New System.Drawing.Point(0, 0)
|
||||
Me.Panel3.Name = "Panel3"
|
||||
Me.Panel3.Size = New System.Drawing.Size(541, 44)
|
||||
Me.Panel3.TabIndex = 9
|
||||
'
|
||||
'Button5
|
||||
'
|
||||
Me.Button5.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.Button5.BackColor = System.Drawing.Color.MediumSeaGreen
|
||||
Me.Button5.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.person
|
||||
Me.Button5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button5.ForeColor = System.Drawing.Color.White
|
||||
Me.Button5.Location = New System.Drawing.Point(488, 4)
|
||||
Me.Button5.Name = "Button5"
|
||||
Me.Button5.Size = New System.Drawing.Size(49, 33)
|
||||
Me.Button5.TabIndex = 8
|
||||
Me.Button5.UseVisualStyleBackColor = False
|
||||
'
|
||||
'Panel4
|
||||
'
|
||||
Me.Panel4.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.Panel4.BackColor = System.Drawing.Color.Black
|
||||
Me.Panel4.Location = New System.Drawing.Point(4, 43)
|
||||
Me.Panel4.Name = "Panel4"
|
||||
Me.Panel4.Size = New System.Drawing.Size(533, 1)
|
||||
Me.Panel4.TabIndex = 6
|
||||
'
|
||||
'lblChatName
|
||||
'
|
||||
Me.lblChatName.AutoSize = True
|
||||
Me.lblChatName.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lblChatName.Location = New System.Drawing.Point(9, 11)
|
||||
Me.lblChatName.Name = "lblChatName"
|
||||
Me.lblChatName.Size = New System.Drawing.Size(15, 20)
|
||||
Me.lblChatName.TabIndex = 4
|
||||
Me.lblChatName.Text = "-"
|
||||
'
|
||||
'lblOnlineOffline
|
||||
'
|
||||
Me.lblOnlineOffline.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblOnlineOffline.BackColor = System.Drawing.Color.MediumSeaGreen
|
||||
Me.lblOnlineOffline.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
|
||||
Me.lblOnlineOffline.ForeColor = System.Drawing.Color.White
|
||||
Me.lblOnlineOffline.Location = New System.Drawing.Point(376, 4)
|
||||
Me.lblOnlineOffline.Name = "lblOnlineOffline"
|
||||
Me.lblOnlineOffline.Size = New System.Drawing.Size(106, 33)
|
||||
Me.lblOnlineOffline.TabIndex = 5
|
||||
Me.lblOnlineOffline.Text = "ONLINE"
|
||||
Me.lblOnlineOffline.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
Me.lblOnlineOffline.Visible = False
|
||||
'
|
||||
'pnl
|
||||
'
|
||||
Me.pnl.BackColor = System.Drawing.Color.White
|
||||
Me.pnl.Controls.Add(Me.pic)
|
||||
Me.pnl.Controls.Add(Me.FlowLayoutPanel)
|
||||
Me.pnl.Controls.Add(Me.Button4)
|
||||
Me.pnl.Controls.Add(Me.Button3)
|
||||
Me.pnl.Controls.Add(Me.btn)
|
||||
Me.pnl.Controls.Add(Me.rtbChatMessage)
|
||||
Me.pnl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.pnl.Location = New System.Drawing.Point(0, 0)
|
||||
Me.pnl.Name = "pnl"
|
||||
Me.pnl.Size = New System.Drawing.Size(541, 243)
|
||||
Me.pnl.Size = New System.Drawing.Size(541, 260)
|
||||
Me.pnl.TabIndex = 0
|
||||
'
|
||||
'pic
|
||||
'
|
||||
Me.pic.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.pic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||
Me.pic.Location = New System.Drawing.Point(489, 174)
|
||||
Me.pic.Location = New System.Drawing.Point(488, 93)
|
||||
Me.pic.Name = "pic"
|
||||
Me.pic.Size = New System.Drawing.Size(49, 26)
|
||||
Me.pic.TabIndex = 7
|
||||
@@ -321,23 +387,9 @@ Partial Class frmMessenger
|
||||
Me.FlowLayoutPanel.AutoScroll = True
|
||||
Me.FlowLayoutPanel.Location = New System.Drawing.Point(4, 121)
|
||||
Me.FlowLayoutPanel.Name = "FlowLayoutPanel"
|
||||
Me.FlowLayoutPanel.Size = New System.Drawing.Size(451, 119)
|
||||
Me.FlowLayoutPanel.Size = New System.Drawing.Size(533, 136)
|
||||
Me.FlowLayoutPanel.TabIndex = 6
|
||||
'
|
||||
'Button4
|
||||
'
|
||||
Me.Button4.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.Button4.BackColor = System.Drawing.Color.MediumSeaGreen
|
||||
Me.Button4.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.people
|
||||
Me.Button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
|
||||
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button4.ForeColor = System.Drawing.Color.White
|
||||
Me.Button4.Location = New System.Drawing.Point(489, 203)
|
||||
Me.Button4.Name = "Button4"
|
||||
Me.Button4.Size = New System.Drawing.Size(49, 33)
|
||||
Me.Button4.TabIndex = 5
|
||||
Me.Button4.UseVisualStyleBackColor = False
|
||||
'
|
||||
'Button3
|
||||
'
|
||||
Me.Button3.BackColor = System.Drawing.Color.SteelBlue
|
||||
@@ -397,7 +449,7 @@ Partial Class frmMessenger
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(817, 685)
|
||||
Me.ClientSize = New System.Drawing.Size(817, 728)
|
||||
Me.Controls.Add(Me.SplitContainer)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "frmMessenger"
|
||||
@@ -417,6 +469,8 @@ Partial Class frmMessenger
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainer1.ResumeLayout(False)
|
||||
Me.MyFlowLayoutPanel1.ResumeLayout(False)
|
||||
Me.Panel3.ResumeLayout(False)
|
||||
Me.Panel3.PerformLayout()
|
||||
Me.pnl.ResumeLayout(False)
|
||||
CType(Me.pic, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.cntxt.ResumeLayout(False)
|
||||
@@ -447,7 +501,11 @@ Partial Class frmMessenger
|
||||
Friend WithEvents cbxInaktiveChats As CheckBox
|
||||
Friend WithEvents cntxt As ContextMenuStrip
|
||||
Friend WithEvents ChatDeaktivierenToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents Button4 As Button
|
||||
Friend WithEvents FlowLayoutPanel As FlowLayoutPanel
|
||||
Friend WithEvents pic As PictureBox
|
||||
Friend WithEvents lblOnlineOffline As Label
|
||||
Friend WithEvents Panel3 As Panel
|
||||
Friend WithEvents lblChatName As Label
|
||||
Friend WithEvents Panel4 As Panel
|
||||
Friend WithEvents Button5 As Button
|
||||
End Class
|
||||
|
||||
@@ -20,8 +20,11 @@ Public Class frmMessenger
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MyDatagridview1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvChats.CellContentClick
|
||||
|
||||
Private Sub MyDatagridview1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvChats.CellContentClick, dgvChats.CellClick
|
||||
If dgvChats.Rows(e.RowIndex).Cells("ungelesen").Value <> "" Then
|
||||
Dim dgv_ChatID = If(dgvChats.SelectedRows.Count > 0, dgvChats.SelectedRows(0).Cells("chat_id").Value, -1)
|
||||
intiDGVChats(dgv_ChatID, False) ' Splate ungelesen sol sich ändern
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
@@ -77,13 +80,50 @@ Public Class frmMessenger
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub initEmojisTEST()
|
||||
FlowLayoutPanel.Controls.Clear()
|
||||
If alloweasteregg Then pic.Visible = False
|
||||
|
||||
If IO.Directory.Exists(DATENVERVER_OPTIONS.getRootDir & "\DOKUMENTE\CHAT_EMOJIS\") Then
|
||||
Dim EmojiPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "CHAT_EMOJIS\"
|
||||
If Not IO.Directory.Exists(EmojiPath) Then IO.Directory.CreateDirectory(EmojiPath)
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cProgrammeUpdate.copyProgramLIST(DATENVERVER_OPTIONS.getRootDir & "\DOKUMENTE\CHAT_EMOJIS\", EmojiPath, {}) Then
|
||||
For Each a In IO.Directory.GetFiles(EmojiPath) '.OrderBy(Function(f) f)
|
||||
If alloweasteregg Or Not a.Contains("easteregg") Then
|
||||
If IO.File.Exists(a) And a.Contains(".png") And a.Contains("emoji_") Then
|
||||
|
||||
Dim p As New PictureBox
|
||||
p.Size = New Size(40, 40)
|
||||
p.BackgroundImage = Image.FromFile(a)
|
||||
p.BackgroundImageLayout = ImageLayout.Zoom
|
||||
p.Cursor = Cursors.Hand
|
||||
AddHandler p.Click, Sub()
|
||||
If Not CHAT.chat_aktiv Then MsgBox("Chat inaktiv!") : Exit Sub
|
||||
If CHAT IsNot Nothing Then
|
||||
saveEmoji(a)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
FlowLayoutPanel.Controls.Add(p)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub intiDGVChats(Optional dgv_ChatID = -1, Optional reloadChat = True)
|
||||
With dgvChats
|
||||
|
||||
Dim loadedTmp = loaded
|
||||
If Not reloadChat Then
|
||||
loaded = False
|
||||
End If
|
||||
.DataSource = SQL.loadDgvBySql("SELECT [chat_id],CASE WHEN chat_name<>'' THEN chat_name ELSE (SELECT TOP 1 mit_vname + ' ' + mit_nname FROM tblMessenger_ChatMembers INNER JOIN tblMitarbeiter ON mit_id=chatMb_maId where chatMb_chatId=chat_id AND chatMb_maId <>" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & ") END as chat_name
|
||||
,(SELECT REPLACE(COUNT(*),'0','') FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE [chat_id]=chatMg_chatId AND chatMgSt_MaId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & " AND chatMgSt_gelesen=0) as ungelesen
|
||||
FROM [tblMessenger_Chat] WHERE (SELECT COUNT(*) FROM tblMessenger_ChatMembers WHERE chatMB_chatId=chat_id AND chatMB_maId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & ")>0
|
||||
AND chat_aktiv='" & (Not cbxInaktiveChats.Checked) & "' ORDER BY chat_id DESC", "ADMIN")
|
||||
AND chat_aktiv='" & (Not cbxInaktiveChats.Checked) & "' ORDER BY chat_lastMsg DESC", "ADMIN")
|
||||
|
||||
If .Columns.Count = 0 Then Exit Sub
|
||||
|
||||
@@ -96,9 +136,8 @@ Public Class frmMessenger
|
||||
.Columns("ungelesen").DefaultCellStyle.Font = New Font(.Font.FontFamily, 7, FontStyle.Bold)
|
||||
|
||||
dgvChats.GetOrder()
|
||||
Dim loadedTmp = loaded
|
||||
|
||||
If Not reloadChat Then
|
||||
loaded = False
|
||||
dgvChats.ClearSelection()
|
||||
If dgv_ChatID > 0 Then
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
@@ -158,21 +197,53 @@ Public Class frmMessenger
|
||||
|
||||
Sub RELOAD_CHAT()
|
||||
Try
|
||||
lblChatName.Text = "-"
|
||||
' Dim scrollMax = (MyFlowLayoutPanel1.VerticalScroll.Value = MyFlowLayoutPanel1.VerticalScroll.Maximum)
|
||||
MyFlowLayoutPanel1.Controls.Clear()
|
||||
If CHAT IsNot Nothing Then
|
||||
CHAT.READ_ALL_MESSAGES()
|
||||
' CHAT = New VERAG_PROG_ALLGEMEIN.cMessenger.cMessenger_Chat(dgvChats.SelectedRows(0).Cells("chat_id").Value)
|
||||
For Each MSG In CHAT.CHAT_MESSAGES
|
||||
|
||||
|
||||
MyFlowLayoutPanel1.Controls.Add(getControlFromMSG(MSG))
|
||||
|
||||
Next
|
||||
' MyFlowLayoutPanel1.VerticalScroll.()
|
||||
'MyFlowLayoutPanel1.AutoScrollPosition = New Point(MyFlowLayoutPanel1.Width, MyFlowLayoutPanel1.Height)
|
||||
' If MyFlowLayoutPanel1.Controls.Count > 0 Then MyFlowLayoutPanel1.ScrollControlIntoView(MyFlowLayoutPanel1.Controls(MyFlowLayoutPanel1.Controls.Count - 1))
|
||||
|
||||
' If scrollMax Then
|
||||
MyFlowLayoutPanel1.VerticalScroll.Value = MyFlowLayoutPanel1.VerticalScroll.Maximum
|
||||
|
||||
If CHAT.chat_name <> "" Then
|
||||
lblChatName.Text = CHAT.chat_name
|
||||
Button5.BackgroundImage = My.Resources.people
|
||||
Else
|
||||
lblChatName.Text = SQL.getValueTxtBySql("SELECT isnull(mit_vname,'') + ' ' + isnull(mit_nname,'') FROM [tblMessenger_ChatMembers] inner join tblMitarbeiter on mit_id=chatMb_maId where chatMb_chatId ='" & CHAT.chat_id & "' and chatMb_maId<>'" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "'", "ADMIN")
|
||||
Button5.BackgroundImage = My.Resources.person
|
||||
End If
|
||||
End If
|
||||
checkOnlineOffline()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Sub checkOnlineOffline()
|
||||
Try
|
||||
|
||||
If CHAT Is Nothing OrElse CHAT.chat_name <> "" Then
|
||||
lblOnlineOffline.Visible = False
|
||||
Else
|
||||
lblOnlineOffline.Visible = True
|
||||
Dim cntOnline = SQL.getValueTxtBySql("SELECT count(*) FROM [tblMessenger_ChatMembers] inner join tblSessions ON sess_maId=[chatMb_maId] and sess_lastRm > dateadd(MINUTE,-2, getdate()) where chatMb_chatId ='" & CHAT.chat_id & "' and chatMb_maId<>'" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "'", "ADMIN")
|
||||
If cntOnline > 0 Then
|
||||
lblOnlineOffline.Text = "ONLINE"
|
||||
lblOnlineOffline.BackColor = Color.MediumSeaGreen
|
||||
Else
|
||||
lblOnlineOffline.Text = "OFFLINE"
|
||||
lblOnlineOffline.BackColor = Color.Red
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
@@ -224,6 +295,7 @@ Public Class frmMessenger
|
||||
CHAT.LOAD_MESSAGES(topMessages)
|
||||
|
||||
' CHAT = New VERAG_PROG_ALLGEMEIN.cMessenger.cMessenger_Chat(dgvChats.SelectedRows(0).Cells("chat_id").Value)
|
||||
Dim newMsg As Boolean = False
|
||||
For Each MSG In CHAT.CHAT_MESSAGES
|
||||
Dim found As Boolean = False
|
||||
For Each I In MyFlowLayoutPanel1.Controls
|
||||
@@ -244,6 +316,7 @@ Public Class frmMessenger
|
||||
|
||||
Next
|
||||
If Not found Then
|
||||
newMsg = True
|
||||
MyFlowLayoutPanel1.Controls.Add(getControlFromMSG(MSG))
|
||||
|
||||
'Dim CHAT_ITEM As New usrCntlMessenger_ChatElement(MSG)
|
||||
@@ -255,12 +328,15 @@ Public Class frmMessenger
|
||||
CHAT.READ_ALL_MESSAGES()
|
||||
End If
|
||||
Next
|
||||
If newMsg Then
|
||||
MyFlowLayoutPanel1.VerticalScroll.Value = MyFlowLayoutPanel1.VerticalScroll.Maximum
|
||||
End If
|
||||
' MyFlowLayoutPanel1.VerticalScroll.()
|
||||
'MyFlowLayoutPanel1.AutoScrollPosition = New Point(MyFlowLayoutPanel1.Width, MyFlowLayoutPanel1.Height)
|
||||
' If MyFlowLayoutPanel1.Controls.Count > 0 Then MyFlowLayoutPanel1.ScrollControlIntoView(MyFlowLayoutPanel1.Controls(MyFlowLayoutPanel1.Controls.Count - 1))
|
||||
MyFlowLayoutPanel1.VerticalScroll.Value = MyFlowLayoutPanel1.VerticalScroll.Maximum
|
||||
' MyFlowLayoutPanel1.VerticalScroll.Value = MyFlowLayoutPanel1.VerticalScroll.Maximum --> nur, wenn neue MSG
|
||||
End If
|
||||
|
||||
checkOnlineOffline()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
@@ -400,13 +476,37 @@ Public Class frmMessenger
|
||||
loaded = False
|
||||
REFRESH_CHAT()
|
||||
Dim dgv_ChatID = If(dgvChats.SelectedRows.Count > 0, dgvChats.SelectedRows(0).Cells("chat_id").Value, -1)
|
||||
intiDGVChats(dgv_ChatID,False)
|
||||
|
||||
|
||||
If checkNewestShit() Then ' prüft, ob neue Nachrichten gekommen sind, sont kein Refresh (stört das scrollen)
|
||||
intiDGVChats(dgv_ChatID, False)
|
||||
End If
|
||||
|
||||
loaded = True
|
||||
End Sub
|
||||
|
||||
|
||||
Function checkNewestShit() As Boolean
|
||||
Try
|
||||
|
||||
Dim Dt_New As DataTable = SQL.loadDgvBySql("SELECT [chat_id],CASE WHEN chat_name<>'' THEN chat_name ELSE (SELECT TOP 1 mit_vname + ' ' + mit_nname FROM tblMessenger_ChatMembers INNER JOIN tblMitarbeiter ON mit_id=chatMb_maId where chatMb_chatId=chat_id AND chatMb_maId <>" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & ") END as chat_name
|
||||
,(SELECT REPLACE(COUNT(*),'0','') FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE [chat_id]=chatMg_chatId AND chatMgSt_MaId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & " AND chatMgSt_gelesen=0) as ungelesen
|
||||
FROM [tblMessenger_Chat] WHERE (SELECT COUNT(*) FROM tblMessenger_ChatMembers WHERE chatMB_chatId=chat_id AND chatMB_maId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & ")>0
|
||||
AND chat_aktiv='" & (Not cbxInaktiveChats.Checked) & "' ORDER BY chat_lastMsg DESC", "ADMIN")
|
||||
Dim Dt_Current As DataTable = dgvChats.DataSource
|
||||
|
||||
If Dt_Current.Rows.Count <> Dt_New.Rows.Count Then Return True
|
||||
|
||||
For Each r As DataRow In Dt_New.Rows
|
||||
If r("ungelesen") IsNot DBNull.Value AndAlso r("ungelesen") <> "" AndAlso CInt(r("ungelesen")) > 0 Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Sub initMsg()
|
||||
Dim dgv_ChatID = If(dgvChats.SelectedRows.Count > 0, dgvChats.SelectedRows(0).Cells("chat_id").Value, -1)
|
||||
'intiDGVChats(dgv_ChatID)
|
||||
@@ -608,14 +708,6 @@ Public Class frmMessenger
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
If CHAT IsNot Nothing Then
|
||||
|
||||
Dim f As New frmMessenger_Members(CHAT)
|
||||
f.ShowDialog(Me)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
@@ -639,7 +731,7 @@ Public Class frmMessenger
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(" FEHLER: DaagDrop!" & ex.Message & ex.StackTrace)
|
||||
MsgBox(" FEHLER: DragDrop!" & ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -664,6 +756,20 @@ Public Class frmMessenger
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||
If CHAT Is Nothing Then Exit Sub
|
||||
|
||||
If CHAT.chat_name <> "" Then
|
||||
Dim f As New frmMessenger_Members(CHAT)
|
||||
f.ShowDialog(Me)
|
||||
Else
|
||||
Dim mit_id = SQL.getValueTxtBySql("SELECT mit_id FROM [tblMessenger_ChatMembers] inner join tblMitarbeiter on mit_id=chatMb_maId where chatMb_chatId ='" & CHAT.chat_id & "' and chatMb_maId<>'" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & "'", "ADMIN")
|
||||
Dim f As New frmMitarbeitersuche(mit_id)
|
||||
f.ShowDialog(Me)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub rtbChatMessage_TextChanged(sender As Object, e As EventArgs) Handles rtbChatMessage.TextChanged
|
||||
' FlowLayoutPanel.Enabled = (rtbChatMessage.Text = "")
|
||||
'End Sub
|
||||
|
||||
@@ -22,7 +22,7 @@ Public Class frmMessenger_Members
|
||||
|
||||
For Each MB In CHAT.CHAT_MEMBERS
|
||||
Dim MA As New cMitarbeiter(MB.chatMb_maId)
|
||||
.Rows.Add({"", MA.Fullname, If(MA.mit_firma = "ALL", MA.mit_FirmaHaupt, MA.mit_firma)})
|
||||
.Rows.Add({MB.chatMb_maId, MA.Fullname, If(MA.mit_firma = "ALL", MA.mit_FirmaHaupt, MA.mit_firma)})
|
||||
Next
|
||||
.ClearSelection()
|
||||
End With
|
||||
@@ -31,4 +31,13 @@ Public Class frmMessenger_Members
|
||||
Private Sub frmMessenger_Members_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
initDGV()
|
||||
End Sub
|
||||
|
||||
Private Sub dgvChatMembers_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvChatMembers.CellDoubleClick, dgvChatMembers.CellContentDoubleClick
|
||||
If dgvChatMembers.SelectedRows.Count > 0 Then
|
||||
Dim mit_id = dgvChatMembers.SelectedRows(0).Cells("clmnMaId").Value
|
||||
Dim f As New frmMitarbeitersuche(mit_id)
|
||||
f.ShowDialog(Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user