Flag "Zeiterfassung" in Mitarbeiterübersicht

This commit is contained in:
2023-11-07 14:59:47 +01:00
parent 70d50dcd2a
commit fd41b761e6
3 changed files with 138 additions and 134 deletions

View File

@@ -67,7 +67,7 @@ Public Class usrCntlMitarbeiter
Dim sql As String = "SELECT mit_id,mit_username,mit_vname, mit_nname ,mit_niederlassung,mit_abteilung,mit_email,mit_durchwahl,mit_gekuendigt, case when mit_timasId is null then 0 else 1 end as mit_ze, isnull(mit_foto_DocId,'') as mit_foto_DocId FROM tblMitarbeiter WHERE (mit_firma='" & firma & "' OR (mit_firma='ALL' AND mit_FirmaHaupt='" & firma & "' )) "
Dim sql As String = "SELECT mit_id,mit_username,mit_vname, mit_nname ,mit_niederlassung,mit_abteilung,mit_email,cast (case when mit_timasId is null then 0 else 1 end as bit) mit_ze,mit_durchwahl,mit_gekuendigt, isnull(mit_foto_DocId,'') as mit_foto_DocId FROM tblMitarbeiter WHERE (mit_firma='" & firma & "' OR (mit_firma='ALL' AND mit_FirmaHaupt='" & firma & "' )) "
If txtSuche.Text <> "" Then
sql &= " AND (mit_username LIKE '%" & txtSuche.Text & "%' OR mit_nname LIKE '%" & txtSuche.Text & "%' OR mit_vname LIKE '%" & txtSuche.Text & "%') "
@@ -82,16 +82,16 @@ Public Class usrCntlMitarbeiter
' dgvVERAG.DataSource = UID.AnzeigeTabelleFirma(sql)
dgvVERAG.SET_SQL(sql, "ADMIN")
dgvVERAG.LOAD()
c.SET_SQL(sql, "ADMIN")
c.LOAD()
'Tabelle Kommt/Geht bereinigen
If dgvVERAG.RowCount = 0 Then
dgvVERAG.DataSource = Nothing
If c.RowCount = 0 Then
c.DataSource = Nothing
Else
sortDGV(dgvVERAG)
sortDGV(c)
'Eintraege_festlegen()
'AL: Sortierung nach Ausfahrt (Zeit)
dgvVERAG.Sort(dgvVERAG.Columns(3), ListSortDirection.Ascending)
c.Sort(c.Columns(3), ListSortDirection.Ascending)
End If
ElseIf firma = "ATILLA" Then
' dgvATILLA.DataSource = UID.AnzeigeTabelleFirma(sql)
@@ -269,14 +269,18 @@ Public Class usrCntlMitarbeiter
.Columns(6).Width = 120
.Columns(6).HeaderText = "Email"
.Columns(7).Width = 120
.Columns(7).HeaderText = "TelefonNr."
.Columns(8).Width = 80
.Columns(8).HeaderText = "Gekündigt"
.Columns(7).Width = 70
.Columns(7).HeaderText = "Zeiterf."
.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Columns(8).Width = 120
.Columns(8).HeaderText = "TelefonNr."
.Columns(9).Width = 70
.Columns(9).HeaderText = "Gekünd."
.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
.Columns(9).Width = 80
.Columns(9).HeaderText = "Zeiterfassung"
'.Columns(9).Visible = False
@@ -301,16 +305,16 @@ Public Class usrCntlMitarbeiter
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim frmMitarbDetails As New frmMitarbDetails
frmMitarbDetails.mid = dgvVERAG.CurrentRow.Cells(0).Value
frmMitarbDetails.mid = c.CurrentRow.Cells(0).Value
frmMitarbDetails.Show()
AddHandler frmMitarbDetails.FormClosing, AddressOf handleClose
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If TabControl1.SelectedIndex = 0 Then
Select Case MsgBox("Soll der Mitarbeiter '" & dgvVERAG.CurrentRow.Cells(1).Value & "' wirklich gelöscht werden?", vbQuestion Or vbYesNo Or vbDefaultButton2, "Löschen?")
Select Case MsgBox("Soll der Mitarbeiter '" & c.CurrentRow.Cells(1).Value & "' wirklich gelöscht werden?", vbQuestion Or vbYesNo Or vbDefaultButton2, "Löschen?")
Case vbYes
UID.delData(Convert.ToInt32(dgvVERAG.CurrentRow.Cells(0).Value))
UID.delData(Convert.ToInt32(c.CurrentRow.Cells(0).Value))
Tabelle_anzeigen()
Case vbNo
@@ -383,7 +387,7 @@ Public Class usrCntlMitarbeiter
Private Sub dgvIMEX_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIMEX.CellDoubleClick, dgvUNISPED.CellDoubleClick, dgvAMBAR.CellDoubleClick, dgvVERAG.CellDoubleClick, dgvATILLA.CellDoubleClick, dgvFRONTOFFICE.CellDoubleClick, dgvVERIMEX.CellDoubleClick
Private Sub dgvIMEX_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIMEX.CellDoubleClick, dgvUNISPED.CellDoubleClick, dgvAMBAR.CellDoubleClick, c.CellDoubleClick, dgvATILLA.CellDoubleClick, dgvFRONTOFFICE.CellDoubleClick, dgvVERIMEX.CellDoubleClick
Me.Cursor = Cursors.Default
Dim frmMitarbDetails As New frmMitarbDetails
frmMitarbDetails.mid = sender.CurrentRow.Cells(0).Value
@@ -406,7 +410,7 @@ Public Class usrCntlMitarbeiter
Dim dgv As DataGridView = Nothing
Select Case TabControl1.SelectedIndex
Case 0 : dgv = dgvVERAG
Case 0 : dgv = c
Case 1 : dgv = dgvATILLA
Case 2 : dgv = dgvIMEX
Case 3 : dgv = dgvUNISPED
@@ -439,13 +443,13 @@ Public Class usrCntlMitarbeiter
If TabControl1.SelectedIndex = 0 Then
If dgvVERAG.SelectedRows.Count <> 1 Then Exit Sub
If c.SelectedRows.Count <> 1 Then Exit Sub
Select Case sender.Name
Case copyUserName
copyUser(dgvVERAG.CurrentRow.Cells(0).Value)
copyUser(c.CurrentRow.Cells(0).Value)
Case setPermissionsName
Dim frm As New frmBenutzerBerGruppenKopieren(dgvVERAG.CurrentRow.Cells(0).Value)
Dim frm As New frmBenutzerBerGruppenKopieren(c.CurrentRow.Cells(0).Value)
frm.Show(Me)
End Select
@@ -517,15 +521,15 @@ Public Class usrCntlMitarbeiter
End If
End Sub
Private Sub dgvVerag_CellMouseDown(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles dgvVERAG.CellMouseDown, dgvVERIMEX.CellMouseDown, dgvUNISPED.CellMouseDown, dgvIMEX.CellMouseDown, dgvFRONTOFFICE.CellMouseDown, dgvATILLA.CellMouseDown, dgvAMBAR.CellMouseDown
Private Sub dgvVerag_CellMouseDown(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles c.CellMouseDown, dgvVERIMEX.CellMouseDown, dgvUNISPED.CellMouseDown, dgvIMEX.CellMouseDown, dgvFRONTOFFICE.CellMouseDown, dgvATILLA.CellMouseDown, dgvAMBAR.CellMouseDown
If e.Button = Windows.Forms.MouseButtons.Right AndAlso e.RowIndex > -1 Then
Dim rowClicked As DataGridView.HitTestInfo
Select Case sender.name
Case "dgvVERAG"
rowClicked = dgvVERAG.HitTest(e.X, e.Y)
dgvVERAG.ClearSelection()
Me.dgvVERAG.Rows(e.RowIndex).Selected = True
rowClicked = c.HitTest(e.X, e.Y)
c.ClearSelection()
Me.c.Rows(e.RowIndex).Selected = True
Case "dgvVERIMEX"
rowClicked = dgvVERIMEX.HitTest(e.X, e.Y)
@@ -709,7 +713,7 @@ Public Class usrCntlMitarbeiter
If TabControl1.SelectedIndex = 0 Then
dgv = dgvVERAG
dgv = c
ElseIf TabControl1.SelectedIndex = 1 Then