messenger, Ueberstunden, timas
This commit is contained in:
@@ -486,10 +486,10 @@ Public Class cMessenger
|
||||
End Function
|
||||
|
||||
|
||||
Public Function setOldChatsInactiv(olderthan As Integer) As Boolean
|
||||
Public Function setOldChatsInactiv(olderthan As String) As Boolean
|
||||
|
||||
Dim dateBack = If(olderthan <> "", CDate(Now.AddDays(olderthan * -1)), CDate(Now.AddDays(30 * -1)))
|
||||
Dim sqlstr = " Update [tblMessenger_Chat] set [chat_aktiv] = 0 WHERE chat_aktiv = 1 and chat_lastMsg <=" & dateBack
|
||||
Dim sqlstr = " Update [tblMessenger_Chat] set [chat_aktiv] = 0 from [tblMessenger_Chat] as chat WHERE chat.chat_aktiv = 1 and (chat.chat_id not in (select chatMg_chatId from [tblMessenger_ChatMessages] where chatMg_datetime >= '" & dateBack.ToShortDateString & "') and chat_erstelltAm <= '" & dateBack.ToShortDateString & "') or (chat_erstelltAm <= '" & dateBack.ToShortDateString & "' and (select count(*) from [tblMessenger_ChatMessages] where chat_id = chatMg_chatId) = 0) and chat.chat_aktiv = 1"
|
||||
Return SQL.doSQL(sqlstr, "ADMIN")
|
||||
End Function
|
||||
|
||||
@@ -525,10 +525,10 @@ Public Class cMessenger
|
||||
|
||||
Public Function SAVE() As Boolean
|
||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM [tblMessenger_ChatMembers] WHERE chatMb_chatId=@chatMb_chatId AND chatMb_maId=@chatMb_maId) " &
|
||||
" BEGIN " & getUpdateCmd() & " END " &
|
||||
Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM [tblMessenger_ChatMembers] WHERE chatMb_chatId=@chatMb_chatId And chatMb_maId=@chatMb_maId) " &
|
||||
" BEGIN " & getUpdateCmd() & " End " &
|
||||
" Else " &
|
||||
" BEGIN " & getInsertCmd() & " END " &
|
||||
" BEGIN " & getInsertCmd() & " End " &
|
||||
" commit tran "
|
||||
|
||||
Return SQL.doSQLVarList(sqlstr, "ADMIN", , list)
|
||||
@@ -537,7 +537,7 @@ Public Class cMessenger
|
||||
Public Sub LOAD()
|
||||
Try
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionADMIN()
|
||||
Using cmd As New SqlCommand("SELECT * FROM [tblMessenger_ChatMembers] WHERE chatMb_chatId=@chatMb_chatId AND chatMb_maId=@chatMb_maId ", conn)
|
||||
Using cmd As New SqlCommand("Select * FROM [tblMessenger_ChatMembers] WHERE chatMb_chatId=@chatMb_chatId And chatMb_maId=@chatMb_maId ", conn)
|
||||
cmd.Parameters.AddWithValue("@chatMb_chatId", chatMb_chatId)
|
||||
cmd.Parameters.AddWithValue("@chatMb_maId", chatMb_maId)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
@@ -558,7 +558,7 @@ Public Class cMessenger
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||
MsgBox("Fehler In der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user