diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.Designer.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.Designer.vb index 328b3a45..dadc86c3 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.Designer.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.Designer.vb @@ -53,6 +53,8 @@ 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.Label9 = New System.Windows.Forms.Label() + Me.Label6 = New System.Windows.Forms.Label() Me.picShow = New System.Windows.Forms.PictureBox() Me.txtAuszManuell = New System.Windows.Forms.TextBox() Me.cx25 = New System.Windows.Forms.CheckBox() @@ -67,6 +69,8 @@ Partial Class frmUeberstundenauszahlen Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.lblWarning = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() + Me.txtAusz_hhmm = New System.Windows.Forms.TextBox() + Me.txtAuszManuell_hhmm = New System.Windows.Forms.TextBox() CType(Me.picDel, System.ComponentModel.ISupportInitialize).BeginInit() Me.Panel1.SuspendLayout() CType(Me.picShow, System.ComponentModel.ISupportInitialize).BeginInit() @@ -147,7 +151,7 @@ Partial Class frmUeberstundenauszahlen ' 'txtAusz ' - Me.txtAusz.Location = New System.Drawing.Point(212, 196) + Me.txtAusz.Location = New System.Drawing.Point(245, 196) Me.txtAusz.Name = "txtAusz" Me.txtAusz.Size = New System.Drawing.Size(54, 20) Me.txtAusz.TabIndex = 9 @@ -328,6 +332,10 @@ Partial Class frmUeberstundenauszahlen ' 'Panel1 ' + Me.Panel1.Controls.Add(Me.txtAuszManuell_hhmm) + Me.Panel1.Controls.Add(Me.txtAusz_hhmm) + Me.Panel1.Controls.Add(Me.Label9) + Me.Panel1.Controls.Add(Me.Label6) Me.Panel1.Controls.Add(Me.picShow) Me.Panel1.Controls.Add(Me.txtAuszManuell) Me.Panel1.Controls.Add(Me.cx25) @@ -360,9 +368,27 @@ Partial Class frmUeberstundenauszahlen Me.Panel1.Controls.Add(Me.txtAusz50) Me.Panel1.Location = New System.Drawing.Point(15, 67) Me.Panel1.Name = "Panel1" - Me.Panel1.Size = New System.Drawing.Size(619, 235) + Me.Panel1.Size = New System.Drawing.Size(619, 258) Me.Panel1.TabIndex = 30 ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(195, 225) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(38, 13) + Me.Label9.TabIndex = 42 + Me.Label9.Text = "hh:mm" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(195, 199) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(44, 13) + Me.Label6.TabIndex = 39 + Me.Label6.Text = "Dezimal" + ' 'picShow ' Me.picShow.BackgroundImage = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.today @@ -376,7 +402,7 @@ Partial Class frmUeberstundenauszahlen ' 'txtAuszManuell ' - Me.txtAuszManuell.Location = New System.Drawing.Point(272, 196) + Me.txtAuszManuell.Location = New System.Drawing.Point(305, 196) Me.txtAuszManuell.Name = "txtAuszManuell" Me.txtAuszManuell.Size = New System.Drawing.Size(54, 20) Me.txtAuszManuell.TabIndex = 37 @@ -449,7 +475,7 @@ Partial Class frmUeberstundenauszahlen 'Label8 ' Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(214, 179) + Me.Label8.Location = New System.Drawing.Point(247, 179) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(56, 13) Me.Label8.TabIndex = 33 @@ -502,6 +528,23 @@ Partial Class frmUeberstundenauszahlen Me.Label5.Size = New System.Drawing.Size(0, 13) Me.Label5.TabIndex = 40 ' + 'txtAusz_hhmm + ' + Me.txtAusz_hhmm.Location = New System.Drawing.Point(245, 222) + Me.txtAusz_hhmm.Name = "txtAusz_hhmm" + Me.txtAusz_hhmm.Size = New System.Drawing.Size(54, 20) + Me.txtAusz_hhmm.TabIndex = 45 + Me.txtAusz_hhmm.Text = "0" + ' + 'txtAuszManuell_hhmm + ' + Me.txtAuszManuell_hhmm.Location = New System.Drawing.Point(305, 222) + Me.txtAuszManuell_hhmm.Name = "txtAuszManuell_hhmm" + Me.txtAuszManuell_hhmm.Size = New System.Drawing.Size(54, 20) + Me.txtAuszManuell_hhmm.TabIndex = 46 + Me.txtAuszManuell_hhmm.Text = "0" + Me.txtAuszManuell_hhmm.Visible = False + ' 'frmUeberstundenauszahlen ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -576,4 +619,8 @@ Partial Class frmUeberstundenauszahlen Friend WithEvents picShow As Windows.Forms.PictureBox Friend WithEvents lblWarning As Windows.Forms.Label Friend WithEvents Label5 As Windows.Forms.Label + Friend WithEvents Label9 As Windows.Forms.Label + Friend WithEvents Label6 As Windows.Forms.Label + Friend WithEvents txtAuszManuell_hhmm As Windows.Forms.TextBox + Friend WithEvents txtAusz_hhmm As Windows.Forms.TextBox End Class diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.vb index 1ff5c156..a04bf7be 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmUeberstundenauszahlen.vb @@ -1,8 +1,10 @@  +Imports System.Globalization Imports System.Text Imports System.Threading Imports System.Windows.Forms -Imports DocumentFormat.OpenXml.EMMA + + Public Class frmUeberstundenauszahlen @@ -268,10 +270,14 @@ Public Class frmUeberstundenauszahlen If overwrittenSum > 0 Then txtAuszManuell.Text = overwrittenSum txtAusz.Visible = False + txtAusz_hhmm.Visible = False txtAuszManuell.Visible = True + txtAuszManuell_hhmm.Visible = True Else txtAusz.Visible = True + txtAusz_hhmm.Visible = True txtAuszManuell.Visible = False + txtAuszManuell_hhmm.Visible = False End If @@ -395,6 +401,62 @@ Public Class frmUeberstundenauszahlen End Sub + Private Sub txtAuszManuell_TextChanged(sender As Object, e As EventArgs) Handles txtAuszManuell.TextChanged + + 'If txtAuszManuell.Text <> "" AndAlso IsNumeric(txtAuszManuell.Text) Then + + ' txtAuszManuell_hhmm.Text = fixTime(txtAuszManuell.Text) + + 'End If + + End Sub + + Private Sub txtAuszManuell_hhmm_TextChanged(sender As Object, e As EventArgs) Handles txtAuszManuell_hhmm.TextChanged + + If txtAuszManuell_hhmm.Text <> "" AndAlso txtAuszManuell_hhmm.Text.Contains(":") AndAlso Not txtAuszManuell_hhmm.Text.EndsWith(":") Then + Try + + Dim timeToDouble = txtAuszManuell_hhmm.Text + Dim ts As TimeSpan = New TimeSpan(Integer.Parse(timeToDouble.Split(":"c)(0)), Integer.Parse(timeToDouble.Split(":"c)(1)), 0) + txtAuszManuell.Text = Math.Round(ts.TotalHours, 2) + + 'txtAusz.Text = ts.Hours & "," & ts.Minutes + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End If + + End Sub + + Private Sub txtAusz_hhmm_TextChanged(sender As Object, e As EventArgs) Handles txtAusz_hhmm.TextChanged + + If txtAusz_hhmm.Text <> "" AndAlso txtAusz_hhmm.Text.Contains(":") AndAlso Not txtAusz_hhmm.Text.EndsWith(":") Then + Try + + Dim timeToDouble = txtAusz_hhmm.Text + Dim ts As TimeSpan = New TimeSpan(Integer.Parse(timeToDouble.Split(":"c)(0)), Integer.Parse(timeToDouble.Split(":"c)(1)), 0) + txtAusz.Text = Math.Round(ts.TotalHours, 2) + + 'txtAusz.Text = ts.Hours & "," & ts.Minutes + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End If + + End Sub + + Private Sub txtAusz_hhmm_KeyPress(sender As Object, e As KeyPressEventArgs) + Select Case Asc(e.KeyChar) + Case 48 To 57, 8, 44, 46, 58 + Case Else + e.Handled = True + End Select + End Sub + + Private Sub txtAusz_hhmm_Validated(sender As Object, e As EventArgs) + + End Sub + Private Sub txtAusz_TextChanged(sender As Object, e As EventArgs) Handles txtAusz.TextChanged calcUeberstunden() @@ -523,7 +585,8 @@ Public Class frmUeberstundenauszahlen If gesamt > 0 Then Dim row = dtsetEntries.NewRow row.Item("accountid") = 1598 - row.Item("value") = gesamt.ToString.Replace(",", ".") * (-1) + Dim value = gesamt * (-1) + row.Item("value") = value.ToString.Replace(",", ".") dtsetEntries.Rows.InsertAt(row, dtsetEntries.Rows.Count) row = dtsetEntries.NewRow @@ -628,16 +691,15 @@ Public Class frmUeberstundenauszahlen ues.uest_systemuser = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME ues.SAVE() End If - MsgBox("Erfolgreich aus Timas zurückgesetzt!") - picDel.Visible = False - Thread.Sleep(1000) 'warten bis Eintrag in Timas-DB - getUeberstunden(cbxabwDatum.Checked) - - End If - + picDel.Visible = False + Thread.Sleep(1000) 'warten bis Eintrag in Timas-DB + getUeberstunden(cbxabwDatum.Checked) End If + End If + + End Sub Public Function RoundOfDigits(ByVal Value As Decimal, ByVal Digits As Integer) As Decimal @@ -818,4 +880,25 @@ Public Class frmUeberstundenauszahlen Next End Sub + + Private Function fixTime(val As String) As String + + Try + If val <> "" AndAlso IsNumeric(val) Then + Dim hours = Convert.ToInt32(val) + Dim minutes = (val Mod hours) * 60 + Return hours & ":" & minutes + Else + Return "" + End If + + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + End Function + + + End Class \ No newline at end of file