Überarbeitung Schichtmodell

This commit is contained in:
2022-12-06 17:11:58 +01:00
parent d2f9685c4e
commit f9a4646b6b
8 changed files with 177 additions and 48 deletions

View File

@@ -39,6 +39,7 @@ Partial Class frmDienstplanVariabel
Me.ctiBemWo = New System.Windows.Forms.ToolStripMenuItem()
Me.NormaldienstToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.GanzeWocheToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripMenuSplitschicht = New System.Windows.Forms.ToolStripMenuItem()
Me.TabPage1 = New System.Windows.Forms.TabPage()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.Button2 = New System.Windows.Forms.Button()
@@ -131,8 +132,10 @@ Partial Class frmDienstplanVariabel
Me.dgvFrei_Mi = New System.Windows.Forms.DataGridView()
Me.dgvUrl_Do = New System.Windows.Forms.DataGridView()
Me.tbAuswertung = New System.Windows.Forms.TabPage()
Me.UsrcntlAuswertungWocheAuslastung1 = New ADMIN.usrcntlAuswertungWocheAuslastung()
Me.pnlPlatzhalter = New System.Windows.Forms.Panel()
Me.tbTagesverteilung = New System.Windows.Forms.TabPage()
Me.UsrCntlAuswertungAuslastungMA1 = New ADMIN.usrCntlAuswertungAuslastungMA()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.txtKWYear = New System.Windows.Forms.TextBox()
Me.txtKW = New System.Windows.Forms.TextBox()
@@ -152,10 +155,8 @@ Partial Class frmDienstplanVariabel
Me.Button3 = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.Panel4 = New System.Windows.Forms.Panel()
Me.Button19 = New System.Windows.Forms.Button()
Me.pnlOptions = New System.Windows.Forms.Panel()
Me.UsrcntlAuswertungWocheAuslastung1 = New ADMIN.usrcntlAuswertungWocheAuslastung()
Me.UsrCntlAuswertungAuslastungMA1 = New ADMIN.usrCntlAuswertungAuslastungMA()
Me.Button19 = New System.Windows.Forms.Button()
Me.ctxtDgv.SuspendLayout()
Me.TabPage1.SuspendLayout()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -217,9 +218,9 @@ Partial Class frmDienstplanVariabel
'
'ctxtDgv
'
Me.ctxtDgv.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ctiFrei, Me.ctiUrlaub, Me.ctiKrankenstand, Me.ctiDienstreise, Me.ZeitausgleichToolStripMenuItem, Me.ctiDbl, Me.ctiWocheSchichtWechsel, Me.ctiBemWo, Me.NormaldienstToolStripMenuItem, Me.GanzeWocheToolStripMenuItem})
Me.ctxtDgv.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ctiFrei, Me.ctiUrlaub, Me.ctiKrankenstand, Me.ctiDienstreise, Me.ZeitausgleichToolStripMenuItem, Me.ctiDbl, Me.ctiWocheSchichtWechsel, Me.ctiBemWo, Me.NormaldienstToolStripMenuItem, Me.GanzeWocheToolStripMenuItem, Me.ToolStripMenuSplitschicht})
Me.ctxtDgv.Name = "ctxtDgvSchicht1"
Me.ctxtDgv.Size = New System.Drawing.Size(229, 224)
Me.ctxtDgv.Size = New System.Drawing.Size(229, 246)
'
'ctiFrei
'
@@ -288,6 +289,12 @@ Partial Class frmDienstplanVariabel
Me.GanzeWocheToolStripMenuItem.Size = New System.Drawing.Size(228, 22)
Me.GanzeWocheToolStripMenuItem.Text = "--> Ganze Woche"
'
'ToolStripMenuSplitschicht
'
Me.ToolStripMenuSplitschicht.Name = "ToolStripMenuSplitschicht"
Me.ToolStripMenuSplitschicht.Size = New System.Drawing.Size(228, 22)
Me.ToolStripMenuSplitschicht.Text = "--> Splitschicht hinzufügen"
'
'TabPage1
'
Me.TabPage1.Controls.Add(Me.PictureBox1)
@@ -1351,6 +1358,15 @@ Partial Class frmDienstplanVariabel
Me.tbAuswertung.Text = "Auswertung"
Me.tbAuswertung.UseVisualStyleBackColor = True
'
'UsrcntlAuswertungWocheAuslastung1
'
Me.UsrcntlAuswertungWocheAuslastung1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
Me.UsrcntlAuswertungWocheAuslastung1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UsrcntlAuswertungWocheAuslastung1.Location = New System.Drawing.Point(102, 3)
Me.UsrcntlAuswertungWocheAuslastung1.Name = "UsrcntlAuswertungWocheAuslastung1"
Me.UsrcntlAuswertungWocheAuslastung1.Size = New System.Drawing.Size(1077, 320)
Me.UsrcntlAuswertungWocheAuslastung1.TabIndex = 0
'
'pnlPlatzhalter
'
Me.pnlPlatzhalter.Dock = System.Windows.Forms.DockStyle.Left
@@ -1371,6 +1387,14 @@ Partial Class frmDienstplanVariabel
Me.tbTagesverteilung.Text = "Tagesverteilung MA"
Me.tbTagesverteilung.UseVisualStyleBackColor = True
'
'UsrCntlAuswertungAuslastungMA1
'
Me.UsrCntlAuswertungAuslastungMA1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UsrCntlAuswertungAuslastungMA1.Location = New System.Drawing.Point(102, 3)
Me.UsrCntlAuswertungAuslastungMA1.Name = "UsrCntlAuswertungAuslastungMA1"
Me.UsrCntlAuswertungAuslastungMA1.Size = New System.Drawing.Size(1077, 320)
Me.UsrCntlAuswertungAuslastungMA1.TabIndex = 3
'
'Panel3
'
Me.Panel3.Dock = System.Windows.Forms.DockStyle.Left
@@ -1607,23 +1631,6 @@ Partial Class frmDienstplanVariabel
Me.Panel4.Size = New System.Drawing.Size(1545, 42)
Me.Panel4.TabIndex = 3
'
'Button19
'
Me.Button19.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.Button19.FlatAppearance.BorderSize = 0
Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button19.ForeColor = System.Drawing.Color.Black
Me.Button19.Image = Global.ADMIN.My.Resources.Resources.Excel_2013_logo_155x110
Me.Button19.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button19.Location = New System.Drawing.Point(234, 7)
Me.Button19.Name = "Button19"
Me.Button19.Size = New System.Drawing.Size(98, 27)
Me.Button19.TabIndex = 107
Me.Button19.Tag = "Dienstplan erstellen"
Me.Button19.Text = "Monat"
Me.Button19.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button19.UseVisualStyleBackColor = True
'
'pnlOptions
'
Me.pnlOptions.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
@@ -1643,22 +1650,22 @@ Partial Class frmDienstplanVariabel
Me.pnlOptions.Size = New System.Drawing.Size(1088, 41)
Me.pnlOptions.TabIndex = 108
'
'UsrcntlAuswertungWocheAuslastung1
'Button19
'
Me.UsrcntlAuswertungWocheAuslastung1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
Me.UsrcntlAuswertungWocheAuslastung1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UsrcntlAuswertungWocheAuslastung1.Location = New System.Drawing.Point(102, 3)
Me.UsrcntlAuswertungWocheAuslastung1.Name = "UsrcntlAuswertungWocheAuslastung1"
Me.UsrcntlAuswertungWocheAuslastung1.Size = New System.Drawing.Size(1077, 320)
Me.UsrcntlAuswertungWocheAuslastung1.TabIndex = 0
'
'UsrCntlAuswertungAuslastungMA1
'
Me.UsrCntlAuswertungAuslastungMA1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UsrCntlAuswertungAuslastungMA1.Location = New System.Drawing.Point(102, 3)
Me.UsrCntlAuswertungAuslastungMA1.Name = "UsrCntlAuswertungAuslastungMA1"
Me.UsrCntlAuswertungAuslastungMA1.Size = New System.Drawing.Size(1077, 320)
Me.UsrCntlAuswertungAuslastungMA1.TabIndex = 3
Me.Button19.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.Button19.FlatAppearance.BorderSize = 0
Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button19.ForeColor = System.Drawing.Color.Black
Me.Button19.Image = Global.ADMIN.My.Resources.Resources.Excel_2013_logo_155x110
Me.Button19.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button19.Location = New System.Drawing.Point(234, 7)
Me.Button19.Name = "Button19"
Me.Button19.Size = New System.Drawing.Size(98, 27)
Me.Button19.TabIndex = 107
Me.Button19.Tag = "Dienstplan erstellen"
Me.Button19.Text = "Monat"
Me.Button19.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button19.UseVisualStyleBackColor = True
'
'frmDienstplanVariabel
'
@@ -1868,4 +1875,5 @@ Partial Class frmDienstplanVariabel
Friend WithEvents Button18 As System.Windows.Forms.Button
Friend WithEvents Button19 As System.Windows.Forms.Button
Friend WithEvents pnlOptions As Panel
Friend WithEvents ToolStripMenuSplitschicht As ToolStripMenuItem
End Class

View File

@@ -391,19 +391,25 @@ Public Class frmDienstplanVariabel
' Next
FlowLayoutPanel.Controls.Clear()
Dim DTBenutzer As DataTable = ADMIN.AnzeigeTabelle(" SELECT * FROM [tblDienstplanEintraegeDetails] WHERE [dedet_niederlassung]='" & niederlassung & "' AND dedet_benutzerdefinierteSchicht=1 AND dedet_aktiv=1 ORDER BY dedet_reihenfolge")
Dim DTBenutzer As DataTable = ADMIN.AnzeigeTabelle(" SELECT * FROM [tblDienstplanEintraegeDetails] WHERE [dedet_niederlassung]='" & niederlassung & "' AND dedet_benutzerdefinierteSchicht=1 AND dedet_aktiv=1 ORDER BY dedet_reihenfolge")
For Each r As DataRow In DTBenutzer.Rows
Dim SCHICHT As New cDienstplanSchicht(r("dedet_id"))
Dim u As New usrCntlDienstWoche(SCHICHT, SETTINGS)
u.Height = (FlowLayoutPanel.Height - 5) * (SCHICHT.dedet_ProzentGrafik / 100)
FlowLayoutPanel.Controls.Add(u)
' MsgBox("TEST")
If SCHICHT.dedet_Splitschicht = False Then
u.Height = (FlowLayoutPanel.Height - 5) * (SCHICHT.dedet_ProzentGrafik / 100)
FlowLayoutPanel.Controls.Add(u)
'MsgBox(SCHICHT.dedet_info)
End If
Dim schicht_Name = SCHICHT.dedet_abt
If schicht_Name = "ZOLL1" Then schicht_Name = "ZOLL_VM"
If schicht_Name = "ZOLL2" Then schicht_Name = "ZOLL_NM"
u.schicht_name = schicht_Name
BEN_SCHICHTEN.Add(u)
SCHICHTEN_ARTEN.Add(SCHICHT)
Next
initWeekInfo()
@@ -413,14 +419,26 @@ Public Class frmDienstplanVariabel
'ConetxtMenü für verschieben aktivieren
Dim i As Integer = 0
For Each s In BEN_SCHICHTEN
Dim menu1 As New ToolStripMenuItem() With {.Text = "--> " & s.SCHICHT.dedet_info, .Name = "cti_" & s.schicht_name, .Font = New Font(Me.Font.FontFamily, Me.Font.Size, FontStyle.Bold)} '
AddHandler menu1.Click, AddressOf Schicht2ToolStripMenuItem_Click
ctxtDgv.Items.Insert(i, menu1)
Dim menu1 As ToolStripMenuItem
If s.SCHICHT.dedet_Splitschicht = False Then
menu1 = New ToolStripMenuItem() With {.Text = "--> " & s.SCHICHT.dedet_info, .Name = "cti_" & s.schicht_name, .Font = New Font(Me.Font.FontFamily, Me.Font.Size, FontStyle.Bold)} '
AddHandler menu1.Click, AddressOf Schicht2ToolStripMenuItem_Click
ctxtDgv.Items.Insert(i, menu1)
End If
Dim menuGanzeWoche As New ToolStripMenuItem() With {.Text = "--> " & s.SCHICHT.dedet_info, .Name = "cti_" & s.schicht_name, .Font = New Font(Me.Font.FontFamily, Me.Font.Size, FontStyle.Bold)} '
AddHandler menuGanzeWoche.Click, AddressOf GanzeWocheToolStripMenuItem_Click
GanzeWocheToolStripMenuItem.DropDownItems.Add(menuGanzeWoche)
Dim splitSchichten As ToolStripMenuItem
If s.SCHICHT.dedet_Splitschicht Then
splitSchichten = New ToolStripMenuItem() With {.Text = "--> " & s.SCHICHT.dedet_info, .Name = "cti_" & s.schicht_name, .Font = New Font(Me.Font.FontFamily, Me.Font.Size, FontStyle.Bold)}
AddHandler splitSchichten.Click, AddressOf ToolStripMenuSplitschicht_Click
ToolStripMenuSplitschicht.DropDownItems.Add(splitSchichten)
End If
i += 1
Next
@@ -1945,6 +1963,57 @@ Public Class frmDienstplanVariabel
End Select
End Sub
Private Sub ToolStripMenuSplitschicht_Click(sender As Object, e As EventArgs) Handles ToolStripMenuSplitschicht.Click
Dim a As ToolStripMenuItem = DirectCast(sender, ToolStripMenuItem)
If sourceCnTxt Is Nothing Then Exit Sub
Dim dgv_tmp As DataGridView = DirectCast(sourceCnTxt, DataGridView)
Dim o As usrCntlDienstWoche = Nothing
If dgv_tmp.Parent.Parent.GetType() Is GetType(usrCntlDienstWoche) Then o = dgv_tmp.Parent.Parent
Dim datumtmp = CalendarWeek(aktWoche, aktJahr)
'Betroffene IDs suchen
Dim ids As New List(Of Integer)
Dim arr As DataGridViewSelectedCellCollection = dgv_tmp.SelectedCells
For Each c As DataGridViewCell In arr
Dim r As DataGridViewRow = c.OwningRow
ids.Add(r.Cells("dstma_id").Value)
Next
'BENUTZER SCHICHTEN:
For Each s In BEN_SCHICHTEN
If a.Name = "cti_" & s.schicht_name Then
'Schicht gefunden
'alle Wochentage durchlaufen:
For i = 0 To 6
For Each sz In s.SCHICHT.ZEITEN
If sz.dsz_woTag.ToUpper = datumtmp.ToString("ddd").Replace(".", "").ToUpper Then
'Wenn hier drin, dann gibt es an dem Tag den bezogenen Schichteintrag
For Each id In ids
'Eintrag wird für alle IDs hinzugefügt
'SQLDienst.updateDienstEintragArtChange()
Next
End If
Next
datumtmp = datumtmp.AddDays(1)
Next
initDienstplan()
Exit Sub
End If
Next
End Sub
Dim sourceCnTxt As Control = Nothing
Private Sub GanzeWocheToolStripMenuItem_Click(sender As Object, e As EventArgs) ' Handles ctiDbl.Click, ctiKrankenstand.Click, ctiFrei.Click, ctiDienstreise.Click, ctiUrlaub.Click, ctiWocheSchichtWechsel.Click, ctiBemWo.Click, ZeitausgleichToolStripMenuItem.Click
@@ -2046,6 +2115,7 @@ Public Class frmDienstplanVariabel
Sub changeDGVWoSchicht(dgv_sender As DataGridView)
Me.Cursor = Cursors.WaitCursor
Try
@@ -2629,4 +2699,6 @@ Public Class frmDienstplanVariabel
Private Sub Panel4_Paint(sender As Object, e As PaintEventArgs) Handles Panel4.Paint
End Sub
End Class

View File

@@ -66,6 +66,8 @@ Partial Class frmSchichtenZeiten
Me.cbxRotMo = New System.Windows.Forms.CheckBox()
Me.cbxBenutzerdefinierteSchicht = New System.Windows.Forms.CheckBox()
Me.pnl = New System.Windows.Forms.Panel()
Me.cbxSplitschicht = New System.Windows.Forms.CheckBox()
Me.cbxHauptsplitschicht = New System.Windows.Forms.CheckBox()
Me.txtZusatzAL = New System.Windows.Forms.TextBox()
Me.Label9 = New System.Windows.Forms.Label()
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
@@ -536,6 +538,8 @@ Partial Class frmSchichtenZeiten
'
'pnl
'
Me.pnl.Controls.Add(Me.cbxSplitschicht)
Me.pnl.Controls.Add(Me.cbxHauptsplitschicht)
Me.pnl.Controls.Add(Me.txtZusatzAL)
Me.pnl.Controls.Add(Me.Label9)
Me.pnl.Controls.Add(Me.CheckBox2)
@@ -566,6 +570,26 @@ Partial Class frmSchichtenZeiten
Me.pnl.Size = New System.Drawing.Size(362, 165)
Me.pnl.TabIndex = 109
'
'cbxSplitschicht
'
Me.cbxSplitschicht.AutoSize = True
Me.cbxSplitschicht.Location = New System.Drawing.Point(210, 143)
Me.cbxSplitschicht.Name = "cbxSplitschicht"
Me.cbxSplitschicht.Size = New System.Drawing.Size(80, 17)
Me.cbxSplitschicht.TabIndex = 125
Me.cbxSplitschicht.Text = "Splitschicht"
Me.cbxSplitschicht.UseVisualStyleBackColor = True
'
'cbxHauptsplitschicht
'
Me.cbxHauptsplitschicht.AutoSize = True
Me.cbxHauptsplitschicht.Location = New System.Drawing.Point(210, 121)
Me.cbxHauptsplitschicht.Name = "cbxHauptsplitschicht"
Me.cbxHauptsplitschicht.Size = New System.Drawing.Size(107, 17)
Me.cbxHauptsplitschicht.TabIndex = 124
Me.cbxHauptsplitschicht.Text = "Hauptsplitschicht"
Me.cbxHauptsplitschicht.UseVisualStyleBackColor = True
'
'txtZusatzAL
'
Me.txtZusatzAL.Location = New System.Drawing.Point(102, 143)
@@ -1005,4 +1029,6 @@ Partial Class frmSchichtenZeiten
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
Friend WithEvents ColorDialog3 As System.Windows.Forms.ColorDialog
Friend WithEvents cbxAktiv As CheckBox
Friend WithEvents cbxSplitschicht As CheckBox
Friend WithEvents cbxHauptsplitschicht As CheckBox
End Class

View File

@@ -113,6 +113,9 @@
cbxAktiv.Checked = SCHICHT.dedet_Aktiv
txtZusatzAL.Text = SCHICHT.dedet_bezLeiter
cbxHauptsplitschicht.Checked = SCHICHT.dedet_Hauptsplitschicht
cbxSplitschicht.Checked = SCHICHT.dedet_Splitschicht
If SCHICHT.dedet_ExcelBgFarbe IsNot Nothing Then
btnExcelColor.BackColor = ColorTranslator.FromHtml(SCHICHT.dedet_ExcelBgFarbe)
CheckBox2.Checked = True
@@ -227,4 +230,20 @@
frbBGExcelMonat.BackColor = ColorDialog3.Color
End If
End Sub
Private Sub cbxHauptsplitschicht_CheckedChanged(sender As Object, e As EventArgs) Handles cbxHauptsplitschicht.CheckedChanged
If cbxHauptsplitschicht.Checked Then
cbxSplitschicht.Checked = False
End If
End Sub
Private Sub cbxSplitschicht_CheckedChanged(sender As Object, e As EventArgs) Handles cbxSplitschicht.CheckedChanged
If cbxSplitschicht.Checked Then
cbxHauptsplitschicht.Checked = False
End If
End Sub
End Class