From d0cee438e2148689d9673050adb611b18d0c56ee Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Thu, 28 Sep 2023 11:52:59 +0200 Subject: [PATCH 1/3] Zeiterfassung --- SDL/frmMain.vb | 6 +- .../frmMitarbeitersuche.Designer.vb | 95 ++++++++++++------- .../frmMitarbeitersuche.vb | 80 +++++++++++----- .../Schnittstellen/TIMAS/cTimasAPI.vb | 2 +- 4 files changed, 121 insertions(+), 62 deletions(-) diff --git a/SDL/frmMain.vb b/SDL/frmMain.vb index 22baaf33..15c7d5d2 100644 --- a/SDL/frmMain.vb +++ b/SDL/frmMain.vb @@ -151,10 +151,8 @@ Public Class frmMain If a = vbYes Then Dim info timas.setTimeEntry(cAllgemein.MITARBEITER, Now, info, "in") - MsgBox(info) - Else - - End If + MsgBox(info) + End If End If End If diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb index 30149543..3d384760 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb @@ -30,11 +30,14 @@ Partial Class frmMitarbeitersuche Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.pnlMain = New System.Windows.Forms.Panel() Me.pnl = New System.Windows.Forms.Panel() + Me.pnlZeiten = New System.Windows.Forms.Panel() + Me.Button2 = New System.Windows.Forms.Button() + Me.Button1 = New System.Windows.Forms.Button() + Me.PictureBox9 = New System.Windows.Forms.PictureBox() + Me.lblTimasSaldo = New System.Windows.Forms.Label() Me.lblMAId = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.btnSettings = New System.Windows.Forms.Button() - Me.PictureBox9 = New System.Windows.Forms.PictureBox() - Me.lblTimasSaldo = New System.Windows.Forms.Label() Me.lblTimasZeiten = New System.Windows.Forms.Label() Me.pnlWohnadresse = New System.Windows.Forms.Panel() Me.lblWohnadresse = New System.Windows.Forms.Label() @@ -59,7 +62,6 @@ Partial Class frmMitarbeitersuche Me.pnlGeburtstag = New System.Windows.Forms.Panel() Me.lblGeburtstag = New System.Windows.Forms.Label() Me.PictureBox1 = New System.Windows.Forms.PictureBox() - Me.pnlZeiten = New System.Windows.Forms.Panel() Me.MyPanel1 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) Me.Panel1 = New System.Windows.Forms.Panel() Me.lblPosition = New System.Windows.Forms.Label() @@ -75,6 +77,7 @@ Partial Class frmMitarbeitersuche CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() Me.pnlMain.SuspendLayout() Me.pnl.SuspendLayout() + Me.pnlZeiten.SuspendLayout() CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).BeginInit() Me.pnlWohnadresse.SuspendLayout() CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() @@ -83,7 +86,6 @@ Partial Class frmMitarbeitersuche CType(Me.pic, System.ComponentModel.ISupportInitialize).BeginInit() Me.pnlGeburtstag.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.pnlZeiten.SuspendLayout() Me.MyPanel1.SuspendLayout() Me.SuspendLayout() ' @@ -186,6 +188,59 @@ Partial Class frmMitarbeitersuche Me.pnl.Size = New System.Drawing.Size(774, 454) Me.pnl.TabIndex = 24 ' + 'pnlZeiten + ' + Me.pnlZeiten.Controls.Add(Me.Button2) + Me.pnlZeiten.Controls.Add(Me.Button1) + Me.pnlZeiten.Controls.Add(Me.PictureBox9) + Me.pnlZeiten.Controls.Add(Me.lblTimasSaldo) + Me.pnlZeiten.Location = New System.Drawing.Point(8, 393) + Me.pnlZeiten.Name = "pnlZeiten" + Me.pnlZeiten.Size = New System.Drawing.Size(619, 40) + Me.pnlZeiten.TabIndex = 22 + ' + 'Button2 + ' + Me.Button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button2.ImageAlign = System.Drawing.ContentAlignment.TopLeft + Me.Button2.Location = New System.Drawing.Point(548, 3) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(68, 35) + Me.Button2.TabIndex = 124 + Me.Button2.Text = "GEHEN" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button1.ImageAlign = System.Drawing.ContentAlignment.TopLeft + Me.Button1.Location = New System.Drawing.Point(474, 3) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(68, 35) + Me.Button1.TabIndex = 123 + Me.Button1.Text = "KOMMEN" + Me.Button1.UseVisualStyleBackColor = True + ' + 'PictureBox9 + ' + Me.PictureBox9.Image = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green + Me.PictureBox9.Location = New System.Drawing.Point(10, 7) + Me.PictureBox9.Name = "PictureBox9" + Me.PictureBox9.Size = New System.Drawing.Size(34, 27) + Me.PictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox9.TabIndex = 120 + Me.PictureBox9.TabStop = False + ' + 'lblTimasSaldo + ' + Me.lblTimasSaldo.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) + Me.lblTimasSaldo.Location = New System.Drawing.Point(50, 7) + Me.lblTimasSaldo.Name = "lblTimasSaldo" + Me.lblTimasSaldo.Size = New System.Drawing.Size(223, 24) + Me.lblTimasSaldo.TabIndex = 30 + ' 'lblMAId ' Me.lblMAId.AutoSize = True @@ -223,25 +278,6 @@ Partial Class frmMitarbeitersuche Me.btnSettings.UseVisualStyleBackColor = True Me.btnSettings.Visible = False ' - 'PictureBox9 - ' - Me.PictureBox9.Image = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green - Me.PictureBox9.Location = New System.Drawing.Point(10, 7) - Me.PictureBox9.Name = "PictureBox9" - Me.PictureBox9.Size = New System.Drawing.Size(34, 27) - Me.PictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage - Me.PictureBox9.TabIndex = 120 - Me.PictureBox9.TabStop = False - ' - 'lblTimasSaldo - ' - Me.lblTimasSaldo.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) - Me.lblTimasSaldo.Location = New System.Drawing.Point(50, 7) - Me.lblTimasSaldo.Name = "lblTimasSaldo" - Me.lblTimasSaldo.Size = New System.Drawing.Size(189, 24) - Me.lblTimasSaldo.TabIndex = 30 - Me.lblTimasSaldo.Visible = False - ' 'lblTimasZeiten ' Me.lblTimasZeiten.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) @@ -479,15 +515,6 @@ Partial Class frmMitarbeitersuche Me.PictureBox1.TabIndex = 13 Me.PictureBox1.TabStop = False ' - 'pnlZeiten - ' - Me.pnlZeiten.Controls.Add(Me.PictureBox9) - Me.pnlZeiten.Controls.Add(Me.lblTimasSaldo) - Me.pnlZeiten.Location = New System.Drawing.Point(8, 393) - Me.pnlZeiten.Name = "pnlZeiten" - Me.pnlZeiten.Size = New System.Drawing.Size(619, 40) - Me.pnlZeiten.TabIndex = 22 - ' 'MyPanel1 ' Me.MyPanel1.BackColor = System.Drawing.Color.FromArgb(CType(CType(250, Byte), Integer), CType(CType(254, Byte), Integer), CType(CType(255, Byte), Integer)) @@ -647,6 +674,7 @@ Partial Class frmMitarbeitersuche Me.pnlMain.ResumeLayout(False) Me.pnl.ResumeLayout(False) Me.pnl.PerformLayout() + Me.pnlZeiten.ResumeLayout(False) CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).EndInit() Me.pnlWohnadresse.ResumeLayout(False) CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit() @@ -656,7 +684,6 @@ Partial Class frmMitarbeitersuche Me.pnlGeburtstag.ResumeLayout(False) Me.pnlGeburtstag.PerformLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() - Me.pnlZeiten.ResumeLayout(False) Me.MyPanel1.ResumeLayout(False) Me.ResumeLayout(False) @@ -709,4 +736,6 @@ Partial Class frmMitarbeitersuche Friend WithEvents lblMAId As Windows.Forms.Label Friend WithEvents Label5 As Windows.Forms.Label Friend WithEvents pnlZeiten As Windows.Forms.Panel + Friend WithEvents Button2 As Windows.Forms.Button + Friend WithEvents Button1 As Windows.Forms.Button End Class diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index 11dd2f9a..26b50663 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -1,7 +1,9 @@ Imports System.ComponentModel Imports System.Drawing Imports System.Net +Imports System.Threading Imports System.Windows.Forms +Imports Therefore.API Imports VERAG_PROG_ALLGEMEIN.cCreditSafeAPI Public Class frmMitarbeitersuche @@ -163,31 +165,8 @@ Public Class frmMitarbeitersuche btn.Visible = True btnSettings.Visible = True End If - If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then - btn.Visible = True - 'Eintrag für Zeitübersicht - 'lblTimasZeiten.Visible = True - lblTimasSaldo.Visible = True - If Not requestDone Then - Dim dtZeiten As New DataTable - If timas IsNot Nothing Then - timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text) - If timas.getTimeEntries(MA.mit_timasId, dtZeiten, requestDone) Then - PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green - Else - PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red - End If - If dtZeiten.Rows.Count > 0 Then - pnlZeiten.Visible = True - Else - pnlZeiten.Visible = False - End If - - End If - - End If - End If + initTimasSaldo() If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MA_TeamBearbeiten", "SDL") Then If MA.getFirma = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA Then 'MA derselben Firma bearbeiten @@ -308,4 +287,57 @@ Public Class frmMitarbeitersuche End If End Sub + Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click + Dim art As String + If sender Is Button1 Then + art = "in" + Else + art = "out" + End If + + If VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_timasId IsNot Nothing Then + Dim timas As New cTimasAPI + Dim a As MsgBoxResult = MsgBox(sender.text & " für " & VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME & vbNewLine & Now.ToString(), vbYesNo) + If a = vbYes Then + Dim info + timas.setTimeEntry(cAllgemein.MITARBEITER, Now, info, art) + MsgBox(info) + Thread.Sleep(2000) 'warten bis Eintrag in Timas-DB + requestDone = False + initTimasSaldo() + End If + End If + End Sub + + + + Private Sub initTimasSaldo() + + If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then + btn.Visible = True + 'Eintrag für Zeitübersicht + 'lblTimasZeiten.Visible = True + lblTimasSaldo.Visible = True + If Not requestDone Then + Dim dtZeiten As New DataTable + If timas IsNot Nothing Then + timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text) + If timas.getTimeEntries(MA.mit_timasId, dtZeiten, requestDone) Then + PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green + Else + PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red + End If + + If dtZeiten.Rows.Count > 0 Then + pnlZeiten.Visible = True + Else + pnlZeiten.Visible = False + End If + + End If + + End If + End If + + End Sub End Class \ No newline at end of file diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb index ae199908..fccd2466 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb @@ -242,7 +242,7 @@ Public Class cTimasAPI success = json.UpdateString("entry", CDate(mitarbeiter.mit_einstiegsdatum).ToString("yyyy-MM-dd")) success = json.UpdateNull("exit") success = json.UpdateString("importSign", "Import from Aviso") - success = json.UpdateString("login", mitarbeiter.mit_AliasAD_Username) + success = json.UpdateString("login", mitarbeiter.mit_username) success = json.UpdateBool("loginActive", 1) success = json.UpdateString("email", mitarbeiter.mit_email) success = json.UpdateString("street", mitarbeiter.mit_strasse) From 85021d75343506d7ab5f5128802877f01f69835c Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Thu, 28 Sep 2023 12:01:34 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Plausi-Pr=C3=BCfung=20f=C3=BCr=20GEHEN/KOMM?= =?UTF-8?q?EN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mitarbeiterverzeichnis/frmMitarbeitersuche.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index 26b50663..436bf043 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -324,8 +324,13 @@ Public Class frmMitarbeitersuche timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text) If timas.getTimeEntries(MA.mit_timasId, dtZeiten, requestDone) Then PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green + + Button2.Enabled = True + Button1.Enabled = False Else PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red + Button2.Enabled = False + Button1.Enabled = True End If If dtZeiten.Rows.Count > 0 Then From b99759151f2cb6c0a19ddf4cb7fb4997c9c45181 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Fri, 29 Sep 2023 08:54:47 +0200 Subject: [PATCH 3/3] mitarbeiter-Zeiterfassung --- .../frmMitarbeitersuche.Designer.vb | 18 +++---- .../frmMitarbeitersuche.vb | 54 +++++++++++-------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb index 3d384760..611982a1 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb @@ -161,6 +161,7 @@ Partial Class frmMitarbeitersuche Me.pnl.BackColor = System.Drawing.Color.FromArgb(CType(CType(250, Byte), Integer), CType(CType(254, Byte), Integer), CType(CType(255, Byte), Integer)) Me.pnl.Controls.Add(Me.pnlZeiten) Me.pnl.Controls.Add(Me.lblMAId) + Me.pnl.Controls.Add(Me.PictureBox9) Me.pnl.Controls.Add(Me.Label5) Me.pnl.Controls.Add(Me.btnSettings) Me.pnl.Controls.Add(Me.lblTimasZeiten) @@ -192,11 +193,10 @@ Partial Class frmMitarbeitersuche ' Me.pnlZeiten.Controls.Add(Me.Button2) Me.pnlZeiten.Controls.Add(Me.Button1) - Me.pnlZeiten.Controls.Add(Me.PictureBox9) Me.pnlZeiten.Controls.Add(Me.lblTimasSaldo) - Me.pnlZeiten.Location = New System.Drawing.Point(8, 393) + Me.pnlZeiten.Location = New System.Drawing.Point(58, 393) Me.pnlZeiten.Name = "pnlZeiten" - Me.pnlZeiten.Size = New System.Drawing.Size(619, 40) + Me.pnlZeiten.Size = New System.Drawing.Size(569, 40) Me.pnlZeiten.TabIndex = 22 ' 'Button2 @@ -204,7 +204,7 @@ Partial Class frmMitarbeitersuche Me.Button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button2.ImageAlign = System.Drawing.ContentAlignment.TopLeft - Me.Button2.Location = New System.Drawing.Point(548, 3) + Me.Button2.Location = New System.Drawing.Point(488, 3) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(68, 35) Me.Button2.TabIndex = 124 @@ -216,7 +216,7 @@ Partial Class frmMitarbeitersuche Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button1.ImageAlign = System.Drawing.ContentAlignment.TopLeft - Me.Button1.Location = New System.Drawing.Point(474, 3) + Me.Button1.Location = New System.Drawing.Point(414, 3) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(68, 35) Me.Button1.TabIndex = 123 @@ -226,7 +226,7 @@ Partial Class frmMitarbeitersuche 'PictureBox9 ' Me.PictureBox9.Image = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green - Me.PictureBox9.Location = New System.Drawing.Point(10, 7) + Me.PictureBox9.Location = New System.Drawing.Point(18, 400) Me.PictureBox9.Name = "PictureBox9" Me.PictureBox9.Size = New System.Drawing.Size(34, 27) Me.PictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage @@ -236,7 +236,7 @@ Partial Class frmMitarbeitersuche 'lblTimasSaldo ' Me.lblTimasSaldo.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) - Me.lblTimasSaldo.Location = New System.Drawing.Point(50, 7) + Me.lblTimasSaldo.Location = New System.Drawing.Point(7, 9) Me.lblTimasSaldo.Name = "lblTimasSaldo" Me.lblTimasSaldo.Size = New System.Drawing.Size(223, 24) Me.lblTimasSaldo.TabIndex = 30 @@ -446,7 +446,7 @@ Partial Class frmMitarbeitersuche 'lblHandyNr ' Me.lblHandyNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold) - Me.lblHandyNr.Location = New System.Drawing.Point(350, 164) + Me.lblHandyNr.Location = New System.Drawing.Point(360, 164) Me.lblHandyNr.Name = "lblHandyNr" Me.lblHandyNr.Size = New System.Drawing.Size(411, 25) Me.lblHandyNr.TabIndex = 22 @@ -467,7 +467,7 @@ Partial Class frmMitarbeitersuche 'lblTelefon ' Me.lblTelefon.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold) - Me.lblTelefon.Location = New System.Drawing.Point(350, 138) + Me.lblTelefon.Location = New System.Drawing.Point(360, 138) Me.lblTelefon.Name = "lblTelefon" Me.lblTelefon.Size = New System.Drawing.Size(411, 25) Me.lblTelefon.TabIndex = 16 diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index 436bf043..aebd8aa8 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -162,12 +162,20 @@ Public Class frmMitarbeitersuche End Select If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", "SDL") Then + 'pnlZeiten.Visible = True btn.Visible = True btnSettings.Visible = True End If + requestDone = False initTimasSaldo() + If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_timasId IsNot Nothing Then + pnlZeiten.Visible = True + Else + pnlZeiten.Visible = False + End If + If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MA_TeamBearbeiten", "SDL") Then If MA.getFirma = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA Then 'MA derselben Firma bearbeiten btnSettings.Visible = True @@ -313,35 +321,35 @@ Public Class frmMitarbeitersuche Private Sub initTimasSaldo() - If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then - btn.Visible = True - 'Eintrag für Zeitübersicht - 'lblTimasZeiten.Visible = True - lblTimasSaldo.Visible = True - If Not requestDone Then - Dim dtZeiten As New DataTable - If timas IsNot Nothing Then - timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text) - If timas.getTimeEntries(MA.mit_timasId, dtZeiten, requestDone) Then - PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green - Button2.Enabled = True - Button1.Enabled = False - Else - PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red - Button2.Enabled = False - Button1.Enabled = True - End If + btn.Visible = True + 'Eintrag für Zeitübersicht + 'lblTimasZeiten.Visible = True + lblTimasSaldo.Visible = True + If Not requestDone Then + lblTimasSaldo.Text = "" + Dim dtZeiten As New DataTable + If timas IsNot Nothing Then + timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text) + If timas.getTimeEntries(MA.mit_timasId, dtZeiten, requestDone) Then + PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green - If dtZeiten.Rows.Count > 0 Then - pnlZeiten.Visible = True - Else - pnlZeiten.Visible = False - End If + Button2.Enabled = True + Button1.Enabled = False + Else + PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red + Button2.Enabled = False + Button1.Enabled = True + End If + If dtZeiten.Rows.Count > 0 AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then + pnlZeiten.Visible = True + Else + pnlZeiten.Visible = False End If End If + End If End Sub