This commit is contained in:
2024-03-20 21:58:37 +01:00
5 changed files with 90 additions and 22 deletions

View File

@@ -79,7 +79,7 @@ Public Class frmDiestAddMa
End Sub
Sub fillCboMA()
For Each m In ListMA
cboMA.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem(m.mit_nname & " " & m.mit_vname, m.mit_id))
cboMA.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem(m.mit_nname & " " & m.mit_vname & " (" & m.mit_id & ")", m.mit_id))
Next
End Sub

View File

@@ -1225,8 +1225,8 @@ Public Class frmMitarbDetails
Return False
End If
If txtLohnNr.Text = "" AndAlso txtClientNr.Text = "" Then
MsgBox("LohnNr und ClientNr prüfen!")
If txtClientNr.Text = "" Then
MsgBox("ClientNr prüfen!")
Return False
End If
@@ -1250,7 +1250,15 @@ Public Class frmMitarbDetails
Return False
End If
Return True
If txtLohnNr.Text = "" Then
If Not vbYes = MsgBox("Möchten Sie den Mitarbeiter ohne Lohnnummer anlegen?" & vbNewLine & "Ohne Lohnnummer kann kein Ableich ins Lohnsystem erfolgen!", vbYesNoCancel) Then
Return False
End If
End If
Return True
End Function

View File

@@ -33,6 +33,8 @@ Partial Class frmMitarbTimas
Me.btnOK = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.txtMandantenNr = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.txtLohn = New System.Windows.Forms.TextBox()
Me.lblLohnNr = New System.Windows.Forms.Label()
@@ -79,8 +81,8 @@ Partial Class frmMitarbTimas
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
Me.dgvData = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.TabControl1 = New System.Windows.Forms.TabControl()
Me.txtMandantenNr = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox()
Me.Label8 = New System.Windows.Forms.Label()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
@@ -176,6 +178,8 @@ Partial Class frmMitarbTimas
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.Label8)
Me.GroupBox2.Controls.Add(Me.CheckedListBox1)
Me.GroupBox2.Controls.Add(Me.txtMandantenNr)
Me.GroupBox2.Controls.Add(Me.Label4)
Me.GroupBox2.Controls.Add(Me.Button1)
@@ -210,6 +214,24 @@ Partial Class frmMitarbTimas
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Timas - User"
'
'txtMandantenNr
'
Me.txtMandantenNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtMandantenNr.Location = New System.Drawing.Point(226, 96)
Me.txtMandantenNr.Name = "txtMandantenNr"
Me.txtMandantenNr.Size = New System.Drawing.Size(91, 20)
Me.txtMandantenNr.TabIndex = 129
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(223, 80)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(78, 13)
Me.Label4.TabIndex = 130
Me.Label4.Text = "Mandanten-Nr:"
'
'Button1
'
Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
@@ -670,23 +692,25 @@ Partial Class frmMitarbTimas
Me.TabControl1.Size = New System.Drawing.Size(546, 242)
Me.TabControl1.TabIndex = 123
'
'txtMandantenNr
'CheckedListBox1
'
Me.txtMandantenNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtMandantenNr.Location = New System.Drawing.Point(226, 96)
Me.txtMandantenNr.Name = "txtMandantenNr"
Me.txtMandantenNr.Size = New System.Drawing.Size(91, 20)
Me.txtMandantenNr.TabIndex = 129
Me.CheckedListBox1.Enabled = False
Me.CheckedListBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CheckedListBox1.FormattingEnabled = True
Me.CheckedListBox1.Location = New System.Drawing.Point(342, 67)
Me.CheckedListBox1.Name = "CheckedListBox1"
Me.CheckedListBox1.Size = New System.Drawing.Size(210, 94)
Me.CheckedListBox1.TabIndex = 131
'
'Label4
'Label8
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(223, 80)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(78, 13)
Me.Label4.TabIndex = 130
Me.Label4.Text = "Mandanten-Nr:"
Me.Label8.AutoSize = True
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(339, 51)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(196, 13)
Me.Label8.TabIndex = 132
Me.Label8.Text = "Einstellungen (werden in Timas gesetzt):"
'
'frmMitarbTimas
'
@@ -773,4 +797,6 @@ Partial Class frmMitarbTimas
Friend WithEvents Button1 As Button
Friend WithEvents txtMandantenNr As TextBox
Friend WithEvents Label4 As Label
Friend WithEvents CheckedListBox1 As CheckedListBox
Friend WithEvents Label8 As Label
End Class

View File

@@ -9,6 +9,7 @@ Public Class frmMitarbTimas
Dim emp As cTimasEmployee
Dim timas As cTimasAPI
Dim dtTimas As New DataTable
Dim dtcustomFields As New DataTable
Sub New()
@@ -44,6 +45,7 @@ Public Class frmMitarbTimas
emp = timas.getEmployee(mid)
avisoEmp = New VERAG_PROG_ALLGEMEIN.cMitarbeiter(emp.externid)
timas.getAllGroups(dtTimas)
initDGV(dtTimas)
@@ -99,6 +101,7 @@ Public Class frmMitarbTimas
cbxGebDat.Checked = True : txtGebDat.Text = emp.birthdayDate
End If
initcheckedlistbox(timas.getEmployeecustomFields(mid))
End Sub
@@ -144,7 +147,19 @@ Public Class frmMitarbTimas
'mitarbeiter.mit_TESTonly = cbxTestaccount.Checked
If checkMandatoryFields() Then
timas.updateEmployee(emp, dgvData)
If timas.updateEmployee(emp, dgvData) Then
Dim UID As New cMitarbeiter()
Dim mitarbeiter
mitarbeiter = UID.getMitarbeiterByTimasId(emp.ID)
If mitarbeiter IsNot Nothing Then
mitarbeiter.mit_PersonalNr = emp.pnr1
UID.updateMitarbeiter(mitarbeiter)
End If
End If
Else
MsgBox("Mitarbeiter konnte nicht upgedeated werden!")
End If
@@ -337,7 +352,7 @@ Public Class frmMitarbTimas
If avisoEmp.mit_emailprivat <> "" Then
txtEmail.Text = avisoEmp.mit_emailprivat
ElseIf avisoEmp.mit_email <> ""Then
ElseIf avisoEmp.mit_email <> "" Then
txtEmail.Text = avisoEmp.mit_email
End If
@@ -351,5 +366,16 @@ Public Class frmMitarbTimas
End If
End If
End Sub
Private Sub initcheckedlistbox(dt As DataTable)
For Each row As DataRow In dt.Rows
If row.Item("type").ToString.ToLower = "boolean" Then
CheckedListBox1.Items.Add(row.Item("name"), IIf(row.Item("value") = "true", True, False))
End If
Next
End Sub
End Class

View File

@@ -1544,6 +1544,14 @@ Public Class cMitarbeiter
Return Nothing
End Function
Public Function getMitarbeiterByTimasId(ByVal id As Integer) As VERAG_PROG_ALLGEMEIN.cMitarbeiter
Dim m = New VERAG_PROG_ALLGEMEIN.cMitarbeiter
If m.LOAD(id, True) Then
Return m
End If
Return Nothing
End Function
Public Function insertMitarbeiter(ByVal m As VERAG_PROG_ALLGEMEIN.cMitarbeiter, ByRef mid As Integer) As Boolean
Dim hAuswahl As String = ""