merge vers

This commit is contained in:
2024-03-07 16:59:42 +01:00
8 changed files with 223 additions and 55 deletions

View File

@@ -486,6 +486,14 @@ Public Class cMessenger
End Function End Function
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 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
End Class End Class
Public Class cMessenger_ChatMembers Public Class cMessenger_ChatMembers
@@ -517,10 +525,10 @@ Public Class cMessenger
Public Function SAVE() As Boolean Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() 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) " & Dim sqlstr = " BEGIN TRAN If EXISTS(Select * FROM [tblMessenger_ChatMembers] WHERE chatMb_chatId=@chatMb_chatId And chatMb_maId=@chatMb_maId) " &
" BEGIN " & getUpdateCmd() & " END " & " BEGIN " & getUpdateCmd() & " End " &
" Else " & " Else " &
" BEGIN " & getInsertCmd() & " END " & " BEGIN " & getInsertCmd() & " End " &
" commit tran " " commit tran "
Return SQL.doSQLVarList(sqlstr, "ADMIN", , list) Return SQL.doSQLVarList(sqlstr, "ADMIN", , list)
@@ -529,7 +537,7 @@ Public Class cMessenger
Public Sub LOAD() Public Sub LOAD()
Try Try
Using conn As SqlConnection = SQL.GetNewOpenConnectionADMIN() 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_chatId", chatMb_chatId)
cmd.Parameters.AddWithValue("@chatMb_maId", chatMb_maId) cmd.Parameters.AddWithValue("@chatMb_maId", chatMb_maId)
Dim dr = cmd.ExecuteReader() Dim dr = cmd.ExecuteReader()
@@ -550,7 +558,7 @@ Public Class cMessenger
End Using End Using
End Using End Using
Catch ex As Exception 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 Try
End Sub End Sub

View File

@@ -20,6 +20,7 @@ Public Class cUeberstunden
Property uest_ignoreLimit As Boolean Property uest_ignoreLimit As Boolean
Property uest_overwriteValue As Boolean Property uest_overwriteValue As Boolean
Property uest_paidout_sum As Object = Nothing Property uest_paidout_sum As Object = Nothing
Property uest_isParttime As Boolean
Public hasEntry = False 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_maxUE", uest_maxUE))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_overwriteValue", uest_overwriteValue)) 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_paidout_sum", uest_paidout_sum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("uest_isParttime", uest_isParttime))
Return list Return list
End Function End Function

View File

@@ -41,6 +41,7 @@ Partial Class frmMessenger
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer() Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel6 = New System.Windows.Forms.Panel() Me.Panel6 = New System.Windows.Forms.Panel()
Me.Label3 = New System.Windows.Forms.Label()
Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label() Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label()
Me.cbxInaktiveChats = New System.Windows.Forms.CheckBox() Me.cbxInaktiveChats = New System.Windows.Forms.CheckBox()
Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
@@ -100,6 +101,7 @@ Partial Class frmMessenger
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn()
CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer.Panel1.SuspendLayout() Me.SplitContainer.Panel1.SuspendLayout()
Me.SplitContainer.Panel2.SuspendLayout() Me.SplitContainer.Panel2.SuspendLayout()
@@ -175,7 +177,7 @@ Partial Class frmMessenger
Me.SplitContainer2.Panel2.Controls.Add(Me.DGVSonstige) Me.SplitContainer2.Panel2.Controls.Add(Me.DGVSonstige)
Me.SplitContainer2.Panel2.Controls.Add(Me.Panel5) Me.SplitContainer2.Panel2.Controls.Add(Me.Panel5)
Me.SplitContainer2.Panel2Collapsed = True Me.SplitContainer2.Panel2Collapsed = True
Me.SplitContainer2.Size = New System.Drawing.Size(275, 794) Me.SplitContainer2.Size = New System.Drawing.Size(275, 787)
Me.SplitContainer2.SplitterDistance = 590 Me.SplitContainer2.SplitterDistance = 590
Me.SplitContainer2.SplitterWidth = 3 Me.SplitContainer2.SplitterWidth = 3
Me.SplitContainer2.TabIndex = 8 Me.SplitContainer2.TabIndex = 8
@@ -224,19 +226,29 @@ Partial Class frmMessenger
Me.dgvChats.RowsDefaultCellStyle = DataGridViewCellStyle4 Me.dgvChats.RowsDefaultCellStyle = DataGridViewCellStyle4
Me.dgvChats.RowTemplate.Height = 30 Me.dgvChats.RowTemplate.Height = 30
Me.dgvChats.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.dgvChats.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvChats.Size = New System.Drawing.Size(275, 773) Me.dgvChats.Size = New System.Drawing.Size(275, 739)
Me.dgvChats.TabIndex = 0 Me.dgvChats.TabIndex = 0
' '
'Panel6 'Panel6
' '
Me.Panel6.Controls.Add(Me.Label3)
Me.Panel6.Controls.Add(Me.lblLKWChat_MsgCntInaktiv) Me.Panel6.Controls.Add(Me.lblLKWChat_MsgCntInaktiv)
Me.Panel6.Controls.Add(Me.cbxInaktiveChats) Me.Panel6.Controls.Add(Me.cbxInaktiveChats)
Me.Panel6.Dock = System.Windows.Forms.DockStyle.Bottom Me.Panel6.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Panel6.Location = New System.Drawing.Point(0, 773) Me.Panel6.Location = New System.Drawing.Point(0, 739)
Me.Panel6.Name = "Panel6" Me.Panel6.Name = "Panel6"
Me.Panel6.Size = New System.Drawing.Size(275, 21) Me.Panel6.Size = New System.Drawing.Size(275, 48)
Me.Panel6.TabIndex = 7 Me.Panel6.TabIndex = 7
' '
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(5, 23)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(237, 13)
Me.Label3.TabIndex = 108
Me.Label3.Text = "Chats werden nach 30 Tagen auf inaktiv gesetzt"
'
'lblLKWChat_MsgCntInaktiv 'lblLKWChat_MsgCntInaktiv
' '
Me.lblLKWChat_MsgCntInaktiv.BackColor = System.Drawing.Color.Red Me.lblLKWChat_MsgCntInaktiv.BackColor = System.Drawing.Color.Red
@@ -409,9 +421,9 @@ Partial Class frmMessenger
' '
Me.Panel2.Controls.Add(Me.cbxInaktiveChatsSpecial) Me.Panel2.Controls.Add(Me.cbxInaktiveChatsSpecial)
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Bottom Me.Panel2.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Panel2.Location = New System.Drawing.Point(0, 899) Me.Panel2.Location = New System.Drawing.Point(0, 892)
Me.Panel2.Name = "Panel2" Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(275, 23) Me.Panel2.Size = New System.Drawing.Size(275, 30)
Me.Panel2.TabIndex = 6 Me.Panel2.TabIndex = 6
' '
'cbxInaktiveChatsSpecial 'cbxInaktiveChatsSpecial
@@ -987,6 +999,13 @@ Partial Class frmMessenger
Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.ReadOnly = True
Me.DataGridViewTextBoxColumn3.Width = 150 Me.DataGridViewTextBoxColumn3.Width = 150
' '
'DataGridViewTextBoxColumn4
'
Me.DataGridViewTextBoxColumn4.HeaderText = ""
Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4"
Me.DataGridViewTextBoxColumn4.ReadOnly = True
Me.DataGridViewTextBoxColumn4.Width = 20
'
'frmMessenger 'frmMessenger
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -1105,4 +1124,6 @@ Partial Class frmMessenger
Friend WithEvents clmnName As DataGridViewTextBoxColumn Friend WithEvents clmnName As DataGridViewTextBoxColumn
Friend WithEvents clmnFirma As DataGridViewTextBoxColumn Friend WithEvents clmnFirma As DataGridViewTextBoxColumn
Friend WithEvents clmnStatus As DataGridViewTextBoxColumn Friend WithEvents clmnStatus As DataGridViewTextBoxColumn
Friend WithEvents DataGridViewTextBoxColumn4 As DataGridViewTextBoxColumn
Friend WithEvents Label3 As Label
End Class End Class

View File

@@ -822,7 +822,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
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 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 ,(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 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 Dim Dt_Current As DataTable = dgvChats.DataSource
If Dt_New Is Nothing Then Return True 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. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmUeberstundenauszahlen)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmUeberstundenauszahlen))
Me.dtpMonat = New System.Windows.Forms.DateTimePicker() Me.dtpMonat = New System.Windows.Forms.DateTimePicker()
Me.lblMonat = New System.Windows.Forms.Label() Me.lblMonat = New System.Windows.Forms.Label()
@@ -52,23 +53,24 @@ Partial Class frmUeberstundenauszahlen
Me.picDel = New System.Windows.Forms.PictureBox() Me.picDel = New System.Windows.Forms.PictureBox()
Me.txtAusz50vonSaldo = New System.Windows.Forms.TextBox() Me.txtAusz50vonSaldo = New System.Windows.Forms.TextBox()
Me.Panel1 = New System.Windows.Forms.Panel() Me.Panel1 = New System.Windows.Forms.Panel()
Me.picShow = New System.Windows.Forms.PictureBox()
Me.txtAuszManuell = New System.Windows.Forms.TextBox() Me.txtAuszManuell = New System.Windows.Forms.TextBox()
Me.cx25 = New System.Windows.Forms.CheckBox() Me.cx25 = New System.Windows.Forms.CheckBox()
Me.cbx50 = New System.Windows.Forms.CheckBox() Me.cbx50 = New System.Windows.Forms.CheckBox()
Me.cbx100 = New System.Windows.Forms.CheckBox() Me.cbx100 = New System.Windows.Forms.CheckBox()
Me.txtberAusz25 = New System.Windows.Forms.TextBox() Me.txtberAusz25 = New System.Windows.Forms.TextBox()
Me.cbxoverwrite = New System.Windows.Forms.CheckBox() Me.cbxoverwrite = New System.Windows.Forms.CheckBox()
Me.dgvUeberstunden = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Label8 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label()
Me.txt50x1 = New System.Windows.Forms.TextBox() Me.txt50x1 = New System.Windows.Forms.TextBox()
Me.cbxTeilzeit = New System.Windows.Forms.CheckBox() Me.cbxTeilzeit = New System.Windows.Forms.CheckBox()
Me.dgvUeberstunden = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.picShow = New System.Windows.Forms.PictureBox() Me.lblWarning = New System.Windows.Forms.Label()
CType(Me.picDel, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.picDel, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout() Me.Panel1.SuspendLayout()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'dtpMonat 'dtpMonat
@@ -103,9 +105,8 @@ Partial Class frmUeberstundenauszahlen
Me.Label3.AutoSize = True Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(32, 131) Me.Label3.Location = New System.Drawing.Point(32, 131)
Me.Label3.Name = "Label3" Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(138, 13) Me.Label3.Size = New System.Drawing.Size(0, 13)
Me.Label3.TabIndex = 3 Me.Label3.TabIndex = 3
Me.Label3.Text = "Mehrarbeit (autom. ausbez.)"
' '
'Label4 'Label4
' '
@@ -361,6 +362,17 @@ Partial Class frmUeberstundenauszahlen
Me.Panel1.Size = New System.Drawing.Size(619, 235) Me.Panel1.Size = New System.Drawing.Size(619, 235)
Me.Panel1.TabIndex = 30 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 'txtAuszManuell
' '
Me.txtAuszManuell.Location = New System.Drawing.Point(272, 196) Me.txtAuszManuell.Location = New System.Drawing.Point(272, 196)
@@ -419,6 +431,20 @@ Partial Class frmUeberstundenauszahlen
Me.cbxoverwrite.Text = "max. auszahlbar" Me.cbxoverwrite.Text = "max. auszahlbar"
Me.cbxoverwrite.UseVisualStyleBackColor = True Me.cbxoverwrite.UseVisualStyleBackColor = True
' '
'dgvUeberstunden
'
Me.dgvUeberstunden.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvUeberstunden.AllowUserToAddRows = False
Me.dgvUeberstunden.AllowUserToDeleteRows = False
Me.dgvUeberstunden.BackgroundColor = System.Drawing.Color.White
Me.dgvUeberstunden.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvUeberstunden.Location = New System.Drawing.Point(381, 30)
Me.dgvUeberstunden.Name = "dgvUeberstunden"
Me.dgvUeberstunden.ReadOnly = True
Me.dgvUeberstunden.Size = New System.Drawing.Size(227, 98)
Me.dgvUeberstunden.TabIndex = 13
Me.dgvUeberstunden.Visible = False
'
'Label8 'Label8
' '
Me.Label8.AutoSize = True Me.Label8.AutoSize = True
@@ -447,20 +473,6 @@ Partial Class frmUeberstundenauszahlen
Me.cbxTeilzeit.Text = "Teilzeit" Me.cbxTeilzeit.Text = "Teilzeit"
Me.cbxTeilzeit.UseVisualStyleBackColor = True Me.cbxTeilzeit.UseVisualStyleBackColor = True
' '
'dgvUeberstunden
'
Me.dgvUeberstunden.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvUeberstunden.AllowUserToAddRows = False
Me.dgvUeberstunden.AllowUserToDeleteRows = False
Me.dgvUeberstunden.BackgroundColor = System.Drawing.Color.White
Me.dgvUeberstunden.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvUeberstunden.Location = New System.Drawing.Point(381, 30)
Me.dgvUeberstunden.Name = "dgvUeberstunden"
Me.dgvUeberstunden.ReadOnly = True
Me.dgvUeberstunden.Size = New System.Drawing.Size(227, 98)
Me.dgvUeberstunden.TabIndex = 13
Me.dgvUeberstunden.Visible = False
'
'PictureBox1 'PictureBox1
' '
Me.PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image) Me.PictureBox1.BackgroundImage = CType(resources.GetObject("PictureBox1.BackgroundImage"), System.Drawing.Image)
@@ -471,22 +483,21 @@ Partial Class frmUeberstundenauszahlen
Me.PictureBox1.TabIndex = 38 Me.PictureBox1.TabIndex = 38
Me.PictureBox1.TabStop = False Me.PictureBox1.TabStop = False
' '
'picShow 'lblWarning
' '
Me.picShow.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.today Me.lblWarning.AutoSize = True
Me.picShow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.lblWarning.ForeColor = System.Drawing.Color.Red
Me.picShow.Location = New System.Drawing.Point(431, 11) Me.lblWarning.Location = New System.Drawing.Point(413, 48)
Me.picShow.Name = "picShow" Me.lblWarning.Name = "lblWarning"
Me.picShow.Size = New System.Drawing.Size(21, 16) Me.lblWarning.Size = New System.Drawing.Size(0, 13)
Me.picShow.TabIndex = 38 Me.lblWarning.TabIndex = 39
Me.picShow.TabStop = False
Me.picShow.Visible = False
' '
'frmUeberstundenauszahlen 'frmUeberstundenauszahlen
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(646, 337) Me.ClientSize = New System.Drawing.Size(646, 337)
Me.Controls.Add(Me.lblWarning)
Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.cbxTeilzeit) Me.Controls.Add(Me.cbxTeilzeit)
Me.Controls.Add(Me.Panel1) Me.Controls.Add(Me.Panel1)
@@ -503,9 +514,9 @@ Partial Class frmUeberstundenauszahlen
CType(Me.picDel, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.picDel, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False) Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout() Me.Panel1.PerformLayout()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.dgvUeberstunden, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.picShow, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@@ -552,4 +563,5 @@ Partial Class frmUeberstundenauszahlen
Friend WithEvents txtAuszManuell As Windows.Forms.TextBox Friend WithEvents txtAuszManuell As Windows.Forms.TextBox
Friend WithEvents PictureBox1 As Windows.Forms.PictureBox Friend WithEvents PictureBox1 As Windows.Forms.PictureBox
Friend WithEvents picShow As Windows.Forms.PictureBox Friend WithEvents picShow As Windows.Forms.PictureBox
Friend WithEvents lblWarning As Windows.Forms.Label
End Class End Class

View File

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

View File

@@ -1,18 +1,15 @@
 
Imports System.Data.Common
Imports System.Drawing
Imports System.Runtime.InteropServices.ComTypes
Imports System.Text Imports System.Text
Imports System.Threading Imports System.Threading
Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls
Imports System.Windows.Forms Imports System.Windows.Forms
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip
Public Class frmUeberstundenauszahlen Public Class frmUeberstundenauszahlen
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim MA As cMitarbeiter = Nothing Dim MA As cMitarbeiter = Nothing
Dim timas As cTimasAPI = New cTimasAPI Dim timas As cTimasAPI = New cTimasAPI
Dim dt As New DataTable Dim dt As New DataTable
Dim customFields As New DataTable
Dim timeaccountdt As New DataTable Dim timeaccountdt As New DataTable
Dim dtResult As New DataTable Dim dtResult As New DataTable
'Dim dtbereitsausgezahlteUE As New DataTable 'Dim dtbereitsausgezahlteUE As New DataTable
@@ -21,6 +18,7 @@ Public Class frmUeberstundenauszahlen
Dim maxUberstundenpruefung As Boolean = True Dim maxUberstundenpruefung As Boolean = True
Dim istTeilzeit As Boolean = False Dim istTeilzeit As Boolean = False
Dim faktorTeilzeit As Double = 100 Dim faktorTeilzeit As Double = 100
Dim faktorSamstagsarbeit As Double = 150
Dim stunden100ausz, stunden50ausz, stunden100auszbere, stunden50auszbere, stunden100bereitsausbezahl, stunden50bereitsausbezahlt, stunden25bereitsausbezahlt, mehrabeit, stundenlfdSaldo, stundenlfdSaldobere, overwrittenSum As Double Dim stunden100ausz, stunden50ausz, stunden100auszbere, stunden50auszbere, stunden100bereitsausbezahl, stunden50bereitsausbezahlt, stunden25bereitsausbezahlt, mehrabeit, stundenlfdSaldo, stundenlfdSaldobere, overwrittenSum As Double
@@ -33,6 +31,7 @@ Public Class frmUeberstundenauszahlen
MA = New cMitarbeiter(mit_id) MA = New cMitarbeiter(mit_id)
tag = New cFeiertage(DateTime.Parse(dtpMonat.Value).Year) tag = New cFeiertage(DateTime.Parse(dtpMonat.Value).Year)
Label7.Text = MA.mit_vname & " " & MA.mit_nname Label7.Text = MA.mit_vname & " " & MA.mit_nname
customFields = timas.getEmployeecustomFields(MA.mit_timasId)
timas.getTimeaccountList(dt) timas.getTimeaccountList(dt)
'65;"01-Lfd Saldo" '65;"01-Lfd Saldo"
@@ -77,6 +76,8 @@ Public Class frmUeberstundenauszahlen
getUeberstunden(False) getUeberstunden(False)
getAddDataFromTimas()
End Sub End Sub
@@ -131,10 +132,11 @@ Public Class frmUeberstundenauszahlen
timas.getTimeAccounts(startdate, enddate, MA.mit_timasId, timeaccountdt, dtResult) timas.getTimeAccounts(startdate, enddate, MA.mit_timasId, timeaccountdt, dtResult)
If dtResult.Rows.Count < 1 Then 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 Panel1.Enabled = False
Exit Sub Exit Sub
Else Else
lblWarning.Text = ""
Panel1.Enabled = True Panel1.Enabled = True
End If End If
@@ -206,6 +208,8 @@ Public Class frmUeberstundenauszahlen
End Sub End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
customFields = timas.getEmployeecustomFields(MA.mit_timasId)
getAddDataFromTimas()
getUeberstunden(cbxabwDatum.Checked) getUeberstunden(cbxabwDatum.Checked)
End Sub End Sub
@@ -442,7 +446,7 @@ Public Class frmUeberstundenauszahlen
Dim sum100, sum50, sum0, gesamt As Double 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! 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) sum0 = RoundOfDigits(CDbl(txtAusz50vonSaldo.Text) * 100 / faktorTeilzeit, 2)
gesamt = IIf(overwrittenSum > 0, overwrittenSum, CDbl(txtAusz.Text)) gesamt = IIf(overwrittenSum > 0, overwrittenSum, CDbl(txtAusz.Text))
@@ -498,6 +502,7 @@ Public Class frmUeberstundenauszahlen
ues.uest_ignoreLimit = Not maxUberstundenpruefung ues.uest_ignoreLimit = Not maxUberstundenpruefung
ues.uest_maxUE = CDbl(txtSummeAuszb.Text) ues.uest_maxUE = CDbl(txtSummeAuszb.Text)
ues.uest_paidout_sum = gesamt ues.uest_paidout_sum = gesamt
ues.uest_isParttime = cbxTeilzeit.Checked
If istTeilzeit Then If istTeilzeit Then
ues.uest_25 = sum0 ues.uest_25 = sum0
@@ -669,7 +674,7 @@ Public Class frmUeberstundenauszahlen
txtlfdSaldo.Text = timas.getTimeSaldo(MA.mit_timasId, "", "overallBalance") txtlfdSaldo.Text = timas.getTimeSaldo(MA.mit_timasId, "", "overallBalance")
stunden100auszbere = RoundOfDigits(stunden100ausz * 2, 2) stunden100auszbere = RoundOfDigits(stunden100ausz * 2, 2)
stunden50auszbere = RoundOfDigits(stunden50ausz * 1.5, 2) stunden50auszbere = RoundOfDigits(stunden50ausz * 100 / faktorSamstagsarbeit, 2)
txt100x2.Text = stunden100auszbere txt100x2.Text = stunden100auszbere
txt50x15.Text = stunden50auszbere txt50x15.Text = stunden50auszbere
@@ -687,12 +692,56 @@ Public Class frmUeberstundenauszahlen
If stundenlfdSaldo <= 0 Then Button1.Enabled = False If stundenlfdSaldo <= 0 Then Button1.Enabled = False
If (stunden100bereitsausbezahl + stunden50bereitsausbezahlt + stunden25bereitsausbezahlt) > 0 Then If (stunden100bereitsausbezahl + stunden50bereitsausbezahlt + stunden25bereitsausbezahlt) > 0 Then
txtSummeAuszb.Text = stundenlfdSaldo
Else
txtSummeAuszb.Text = stundenlfdSaldobere txtSummeAuszb.Text = stundenlfdSaldobere
Else
txtSummeAuszb.Text = stundenlfdSaldo
End If End If
End Sub End Sub
Private Sub getAddDataFromTimas()
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
lblMA.Text = "Mitarbeiter (mit SA-Zuschlag):"
Else
lblMA.Text = "Mitarbeiter (ohne SA-Zuschlag):"
faktorSamstagsarbeit = 100 'Samstagsarbeit wir im Timas NICHT hochgerechnet
End If
End If
If row.Item("name") = "ÜS werden nicht auf lfd. Saldo hinzugezählt" Then
If row.Item("value") = "true" Then
MsgBox("ÜS werden nicht auf lfd. Saldo hinzugezählt")
Else
lblWarning.Text = ""
End If
End If
If row.Item("name") = "Automatisch auszahlen" Then
If row.Item("value") = "true" Then
Label3.Text = "Mehrarbeit (autom. ausbez.)"
Else
Label3.Text = "Mehrarbeit (NICHT autom. ausbez.)"
End If
End If
End If
Next
End Sub
End Class End Class

View File

@@ -145,8 +145,6 @@ Public Class cTimasAPI
rest.AddQueryParam("from", Today().AddDays(-1).ToString("yyyy-MM-ddTHH:mm:ss")) rest.AddQueryParam("from", Today().AddDays(-1).ToString("yyyy-MM-ddTHH:mm:ss"))
rest.AddQueryParam("to", Now().ToString("yyyy-MM-ddTHH:mm:ss")) rest.AddQueryParam("to", Now().ToString("yyyy-MM-ddTHH:mm:ss"))
Dim Response As String Dim Response As String
rest.IdleTimeoutMs = 5000 '5 sec rest.IdleTimeoutMs = 5000 '5 sec
Response = rest.FullRequestNoBody("GET", "/rest/web-api/employees/" & maid & "/bookings") Response = rest.FullRequestNoBody("GET", "/rest/web-api/employees/" & maid & "/bookings")
@@ -191,8 +189,7 @@ Public Class cTimasAPI
Dim timeEntry As Chilkat.JsonObject = jsonArray.ObjectAt(j) Dim timeEntry As Chilkat.JsonObject = jsonArray.ObjectAt(j)
If IsDate(timeEntry.StringOf("stamp")) Then If IsDate(timeEntry.StringOf("stamp")) Then
If CDate(timeEntry.StringOf("stamp")) >= CDate(Today()) Or CDate(timeEntry.StringOf("stamp")) >= CDate(Today().AddDays(-1)) AndAlso CDate(timeEntry.StringOf("stamp")).Hour >= 16 Then 'entweder heute keine Stempelung oder gestern > 16 Uhr (wegen Nachtschicht!) If CDate(timeEntry.StringOf("stamp")) >= CDate(Today()) Or CDate(timeEntry.StringOf("stamp")) >= CDate(Today().AddDays(-1)) AndAlso CDate(timeEntry.StringOf("stamp")).Hour >= 16 AndAlso timeEntry.StringOf("type") = "in" Then 'entweder heute keine Stempelung oder gestern > 16 Uhr (wegen Nachtschicht!)
Dim R As DataRow = dt.NewRow Dim R As DataRow = dt.NewRow
'R("statusid") = timeEntry.StringOf("statusid") 'R("statusid") = timeEntry.StringOf("statusid")
@@ -484,6 +481,70 @@ Public Class cTimasAPI
End Function End Function
Public Function getEmployeecustomFields(mitarbeiterID As String) As DataTable
Try
Dim dt As New DataTable
If Not checkConnectionTImas("") Then
Return Nothing
End If
Dim responseJson As String = rest.FullRequestNoBody("GET", "/rest/web-api/employees/" & mitarbeiterID)
If (rest.LastMethodSuccess <> True) Then
Debug.WriteLine(rest.LastErrorText)
Return Nothing
End If
If (rest.ResponseStatusCode <> 200) Then
Debug.WriteLine(rest.ResponseHeader)
MsgBox(rest.ResponseStatusCode & " " & rest.ResponseStatusText)
Return Nothing
End If
Debug.WriteLine(responseJson)
Dim json As New Chilkat.JsonObject
Dim success = json.Load(responseJson)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
End If
Dim customFields As Chilkat.JsonArray = json.ArrayOf("customFields")
If (json.LastMethodSuccess = False) Then
Debug.WriteLine("customFields member not found.")
Else
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
End If
Debug.WriteLine(json)
Return dt
Catch ex As WebException
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Function
Public Function updateEmployee(emp As cTimasEmployee, dgvGroups As DataGridView) As Boolean Public Function updateEmployee(emp As cTimasEmployee, dgvGroups As DataGridView) As Boolean
Try Try
@@ -1240,6 +1301,7 @@ Public Class cTimasEmployee
Public exitDate As String Public exitDate As String
Public Gruppen As List(Of cTimasGruppe) Public Gruppen As List(Of cTimasGruppe)
Public customFields As List(Of cTimascustomFields)
Sub New() Sub New()
@@ -1259,4 +1321,18 @@ Public Class cTimasGruppe
Me.empID = empId Me.empID = empId
End Sub 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 End Class