Messenger, Ueberstunden

This commit is contained in:
2024-03-07 14:21:52 +01:00
parent bcba9114c7
commit 25d5767574
8 changed files with 142 additions and 38 deletions

View File

@@ -486,6 +486,14 @@ Public Class cMessenger
End Function
Public Function SetOldChatsInactiv(olderthan As Integer) 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
Return SQL.doSQL(sqlstr, "ADMIN")
End Function
End Class
Public Class cMessenger_ChatMembers

View File

@@ -20,6 +20,7 @@ Public Class cUeberstunden
Property uest_ignoreLimit As Boolean
Property uest_overwriteValue As Boolean
Property uest_paidout_sum As Object = Nothing
Property uest_isParttime As Boolean
Public hasEntry = False
@@ -57,6 +58,7 @@ Public Class cUeberstunden
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_maxUE", uest_maxUE))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_overwriteValue", uest_overwriteValue))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_paidout_sum", uest_paidout_sum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_isParttime", uest_isParttime))
Return list
End Function

View File

@@ -24,6 +24,7 @@ Partial Class frmMessenger
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
@@ -38,11 +39,11 @@ Partial Class frmMessenger
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMessenger))
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
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.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel5 = New System.Windows.Forms.Panel()
Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.PictureBox2 = New System.Windows.Forms.PictureBox()
@@ -63,7 +64,7 @@ Partial Class frmMessenger
Me.btnNeu = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel()
Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel(Me.components)
Me.UsrCntlMessenger_ChatElement1 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatElement()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.btnTeilnehmer = New System.Windows.Forms.Button()
@@ -91,9 +92,9 @@ Partial Class frmMessenger
Me.btnSendAtt = New System.Windows.Forms.Button()
Me.btnSenden = New System.Windows.Forms.Button()
Me.rtbChatMessage = New System.Windows.Forms.RichTextBox()
Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer()
Me.Timer_REFRESH = New System.Windows.Forms.Timer()
Me.cntxt = New System.Windows.Forms.ContextMenuStrip()
Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer(Me.components)
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()

View File

@@ -814,7 +814,7 @@ Public Class frmMessenger
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")
AND chat_aktiv=" & IIf(Not cbxInaktiveChats.Checked, 1, 0) & " ORDER BY chat_lastMsg DESC", "ADMIN")
Dim Dt_Current As DataTable = dgvChats.DataSource
If Dt_New Is Nothing Then Return True

View File

@@ -22,6 +22,7 @@ Partial Class frmUeberstundenauszahlen
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmUeberstundenauszahlen))
Me.dtpMonat = New System.Windows.Forms.DateTimePicker()
Me.lblMonat = New System.Windows.Forms.Label()
@@ -52,6 +53,7 @@ Partial Class frmUeberstundenauszahlen
Me.picDel = New System.Windows.Forms.PictureBox()
Me.txtAusz50vonSaldo = New System.Windows.Forms.TextBox()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.picShow = New System.Windows.Forms.PictureBox()
Me.txtAuszManuell = New System.Windows.Forms.TextBox()
Me.cx25 = New System.Windows.Forms.CheckBox()
Me.cbx50 = New System.Windows.Forms.CheckBox()
@@ -61,14 +63,14 @@ Partial Class frmUeberstundenauszahlen
Me.Label8 = New System.Windows.Forms.Label()
Me.txt50x1 = New System.Windows.Forms.TextBox()
Me.cbxTeilzeit = New System.Windows.Forms.CheckBox()
Me.dgvUeberstunden = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.picShow = New System.Windows.Forms.PictureBox()
Me.dgvUeberstunden = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.lblWarning = New System.Windows.Forms.Label()
CType(Me.picDel, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'dtpMonat
@@ -361,6 +363,17 @@ Partial Class frmUeberstundenauszahlen
Me.Panel1.Size = New System.Drawing.Size(619, 235)
Me.Panel1.TabIndex = 30
'
'picShow
'
Me.picShow.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.today
Me.picShow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.picShow.Location = New System.Drawing.Point(431, 11)
Me.picShow.Name = "picShow"
Me.picShow.Size = New System.Drawing.Size(21, 16)
Me.picShow.TabIndex = 38
Me.picShow.TabStop = False
Me.picShow.Visible = False
'
'txtAuszManuell
'
Me.txtAuszManuell.Location = New System.Drawing.Point(272, 196)
@@ -447,6 +460,16 @@ Partial Class frmUeberstundenauszahlen
Me.cbxTeilzeit.Text = "Teilzeit"
Me.cbxTeilzeit.UseVisualStyleBackColor = True
'
'PictureBox1
'
Me.PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image)
Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox1.Location = New System.Drawing.Point(422, 12)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(29, 26)
Me.PictureBox1.TabIndex = 38
Me.PictureBox1.TabStop = False
'
'dgvUeberstunden
'
Me.dgvUeberstunden.AKTUALISIERUNGS_INTERVALL = -1
@@ -461,32 +484,21 @@ Partial Class frmUeberstundenauszahlen
Me.dgvUeberstunden.TabIndex = 13
Me.dgvUeberstunden.Visible = False
'
'PictureBox1
'lblWarning
'
Me.PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image)
Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox1.Location = New System.Drawing.Point(422, 12)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(29, 26)
Me.PictureBox1.TabIndex = 38
Me.PictureBox1.TabStop = False
'
'picShow
'
Me.picShow.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.today
Me.picShow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.picShow.Location = New System.Drawing.Point(431, 11)
Me.picShow.Name = "picShow"
Me.picShow.Size = New System.Drawing.Size(21, 16)
Me.picShow.TabIndex = 38
Me.picShow.TabStop = False
Me.picShow.Visible = False
Me.lblWarning.AutoSize = True
Me.lblWarning.ForeColor = System.Drawing.Color.Red
Me.lblWarning.Location = New System.Drawing.Point(413, 48)
Me.lblWarning.Name = "lblWarning"
Me.lblWarning.Size = New System.Drawing.Size(0, 13)
Me.lblWarning.TabIndex = 39
'
'frmUeberstundenauszahlen
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(646, 337)
Me.Controls.Add(Me.lblWarning)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.cbxTeilzeit)
Me.Controls.Add(Me.Panel1)
@@ -503,9 +515,9 @@ Partial Class frmUeberstundenauszahlen
CType(Me.picDel, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
@@ -552,4 +564,5 @@ Partial Class frmUeberstundenauszahlen
Friend WithEvents txtAuszManuell As Windows.Forms.TextBox
Friend WithEvents PictureBox1 As Windows.Forms.PictureBox
Friend WithEvents picShow As Windows.Forms.PictureBox
Friend WithEvents lblWarning As Windows.Forms.Label
End Class

View File

@@ -168,7 +168,7 @@
XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS
fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+
tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEQAACxEBf2RfkQAAHeBJREFUeF7t2VtuI0nT
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALDAAACwwBP0AiyAAAHeBJREFUeF7t2VtuI0nT
bdu/VaeNp9ffViEzoQunJF4iyAi38TBeHJUSudzMl4D6v//9738AwDB5CACsLQ8BgLXlIQCwtjwEANaW
hwDA2vIQAFhbHgIAa8tDAGBteQgArC0PAYC15SEAsLY8BADWlocAwNryEABYWx4CAGvLQwBgbXkIAKwt
DwGAteUhALC2PAQA1paHAMDa8hAAWFseAgBry0MAYG15CACsLQ8BgLXlIQCwtjwEANaWhwDA2vIQAFhb

View File

@@ -9,6 +9,7 @@ Public Class frmUeberstundenauszahlen
Dim MA As cMitarbeiter = Nothing
Dim timas As cTimasAPI = New cTimasAPI
Dim dt As New DataTable
Dim customFields As New DataTable
Dim timeaccountdt As New DataTable
Dim dtResult As New DataTable
'Dim dtbereitsausgezahlteUE As New DataTable
@@ -17,6 +18,7 @@ Public Class frmUeberstundenauszahlen
Dim maxUberstundenpruefung As Boolean = True
Dim istTeilzeit As Boolean = False
Dim faktorTeilzeit As Double = 100
Dim faktorSamstagsarbeit As Double = 150
Dim stunden100ausz, stunden50ausz, stunden100auszbere, stunden50auszbere, stunden100bereitsausbezahl, stunden50bereitsausbezahlt, stunden25bereitsausbezahlt, mehrabeit, stundenlfdSaldo, stundenlfdSaldobere, overwrittenSum As Double
@@ -29,6 +31,7 @@ Public Class frmUeberstundenauszahlen
MA = New cMitarbeiter(mit_id)
tag = New cFeiertage(DateTime.Parse(dtpMonat.Value).Year)
Label7.Text = MA.mit_vname & " " & MA.mit_nname
timas.getEmployee(MA.mit_timasId, customFields)
timas.getTimeaccountList(dt)
'65;"01-Lfd Saldo"
@@ -73,6 +76,39 @@ Public Class frmUeberstundenauszahlen
getUeberstunden(False)
For Each row As DataRow In customFields.Rows
If Not IsDBNull(row.Item("value")) AndAlso Not IsDBNull(row.Item("name")) Then
If row.Item("name") = "Teilzeit" Then
If row.Item("value") = "true" Then
cbxTeilzeit.Checked = True
Else
cbxTeilzeit.Checked = False
End If
End If
If row.Item("name") = "SA-Zuschlag" Then
If row.Item("value") = "true" Then
faktorSamstagsarbeit = 150 'Samstagsarbeit wir im Timas hochgerechnet
Else
faktorSamstagsarbeit = 100 'Samstagsarbeit wir im Timas NICHT hochgerechnet
End If
End If
If row.Item("name") = "Zuschlagsfrei" Then
If row.Item("value") = "true" Then
lblWarning.Text = "Zuschlagsfrei"
Else
lblWarning.Text = ""
End If
End If
End If
Next
End Sub
@@ -127,10 +163,11 @@ Public Class frmUeberstundenauszahlen
timas.getTimeAccounts(startdate, enddate, MA.mit_timasId, timeaccountdt, dtResult)
If dtResult.Rows.Count < 1 Then
MsgBox("Für den gewählten Zeitraum konnten keine Stunden ermittelt werden!")
lblWarning.Text = "Für den gewählten Zeitraum konnten keine Stunden ermittelt werden!"
Panel1.Enabled = False
Exit Sub
Else
lblWarning.Text = ""
Panel1.Enabled = True
End If
@@ -438,7 +475,7 @@ Public Class frmUeberstundenauszahlen
Dim sum100, sum50, sum0, gesamt As Double
sum100 = RoundOfDigits(CDbl(txtAusz100.Text) * 100 / 200, 2) 'Übergabe in ZE-System als heruntergerechnete 100%ige bzw. 50%ige ÜS!
sum50 = RoundOfDigits(CDbl(txtAusz50.Text) * 100 / 150, 2)
sum50 = RoundOfDigits(CDbl(txtAusz50.Text) * 100 / faktorSamstagsarbeit, 2)
sum0 = RoundOfDigits(CDbl(txtAusz50vonSaldo.Text) * 100 / faktorTeilzeit, 2)
gesamt = IIf(overwrittenSum > 0, overwrittenSum, CDbl(txtAusz.Text))
@@ -494,6 +531,7 @@ Public Class frmUeberstundenauszahlen
ues.uest_ignoreLimit = Not maxUberstundenpruefung
ues.uest_maxUE = CDbl(txtSummeAuszb.Text)
ues.uest_paidout_sum = gesamt
ues.uest_isParttime = cbxTeilzeit.Checked
If istTeilzeit Then
ues.uest_25 = sum0
@@ -683,9 +721,9 @@ Public Class frmUeberstundenauszahlen
If stundenlfdSaldo <= 0 Then Button1.Enabled = False
If (stunden100bereitsausbezahl + stunden50bereitsausbezahlt + stunden25bereitsausbezahlt) > 0 Then
txtSummeAuszb.Text = stundenlfdSaldo
Else
txtSummeAuszb.Text = stundenlfdSaldobere
Else
txtSummeAuszb.Text = stundenlfdSaldo
End If

View File

@@ -385,7 +385,7 @@ Public Class cTimasAPI
End Try
End Sub
Public Function getEmployee(mitarbeiterID As String) As cTimasEmployee
Public Function getEmployee(mitarbeiterID As String, ByRef datatableTimas As DataTable) As cTimasEmployee
Try
@@ -469,6 +469,33 @@ Public Class cTimasAPI
i = i + 1
End While
Dim customFields As Chilkat.JsonArray = json.ArrayOf("customFields")
If (json.LastMethodSuccess = False) Then
Debug.WriteLine("customFields member not found.")
Else
Dim dt As New DataTable
dt.Columns.Add("value", GetType(String))
dt.Columns.Add("name", GetType(String))
dt.Columns.Add("type", GetType(String))
Dim numcustomFields As Integer = customFields.Size
Dim j As Integer = 0
While j < numcustomFields
Dim customField As Chilkat.JsonObject = customFields.ObjectAt(j)
Dim R As DataRow = dt.NewRow
R("value") = customField.StringOf("value")
R("name") = customField.StringOf("name")
R("type") = customField.StringOf("type")
dt.Rows.Add(R)
j = j + 1
End While
If datatableTimas IsNot Nothing Then datatableTimas = dt
End If
Debug.WriteLine(json)
@@ -1237,6 +1264,7 @@ Public Class cTimasEmployee
Public exitDate As String
Public Gruppen As List(Of cTimasGruppe)
Public customFields As List(Of cTimascustomFields)
Sub New()
@@ -1256,4 +1284,18 @@ Public Class cTimasGruppe
Me.empID = empId
End Sub
End Class
Public Class cTimascustomFields
Public empID As Integer
Public Id As Integer
Public name As String
Public type As String
Public value As String
Sub New(empId)
Me.empID = empId
End Sub
End Class