Überarbeitung Schichtmodell
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user