This commit is contained in:
2023-01-27 14:29:52 +01:00
9 changed files with 474 additions and 182 deletions

View File

@@ -87,10 +87,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.76.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<Reference Include="ClosedXML, Version=0.95.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\dll\closedxml\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DocumentFormat.OpenXml.2.7.2\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="FastColoredTextBox">
<HintPath>..\..\..\dll\FastColoredTextBox.dll</HintPath>
</Reference>

View File

@@ -57,6 +57,7 @@ Partial Class frmDienstplanVariabel
Me.pnl = New System.Windows.Forms.Panel()
Me.Panel6 = New System.Windows.Forms.Panel()
Me.Panel7 = New System.Windows.Forms.Panel()
Me.Button20 = New System.Windows.Forms.Button()
Me.Button18 = New System.Windows.Forms.Button()
Me.cboQSSpaet = New System.Windows.Forms.ComboBox()
Me.Label23 = New System.Windows.Forms.Label()
@@ -458,6 +459,7 @@ Partial Class frmDienstplanVariabel
'
'Panel7
'
Me.Panel7.Controls.Add(Me.Button20)
Me.Panel7.Controls.Add(Me.Button18)
Me.Panel7.Controls.Add(Me.cboQSSpaet)
Me.Panel7.Controls.Add(Me.Label23)
@@ -468,6 +470,16 @@ Partial Class frmDienstplanVariabel
Me.Panel7.Size = New System.Drawing.Size(352, 231)
Me.Panel7.TabIndex = 109
'
'Button20
'
Me.Button20.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button20.Location = New System.Drawing.Point(0, 208)
Me.Button20.Name = "Button20"
Me.Button20.Size = New System.Drawing.Size(133, 23)
Me.Button20.TabIndex = 84
Me.Button20.Text = "FZ aus UK aktual."
Me.Button20.UseVisualStyleBackColor = True
'
'Button18
'
Me.Button18.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -1624,12 +1636,12 @@ Partial Class frmDienstplanVariabel
'
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SchichtLöcshenToolStripMenuItem})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
Me.ContextMenuStrip1.Size = New System.Drawing.Size(181, 48)
Me.ContextMenuStrip1.Size = New System.Drawing.Size(158, 26)
'
'SchichtLöcshenToolStripMenuItem
'
Me.SchichtLöcshenToolStripMenuItem.Name = "SchichtLöcshenToolStripMenuItem"
Me.SchichtLöcshenToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.SchichtLöcshenToolStripMenuItem.Size = New System.Drawing.Size(157, 22)
Me.SchichtLöcshenToolStripMenuItem.Text = "Schicht löschen"
'
'Panel4
@@ -1916,4 +1928,5 @@ Partial Class frmDienstplanVariabel
Friend WithEvents Label1 As Label
Friend WithEvents txtSchichtstd As TextBox
Friend WithEvents SchichtLöcshenToolStripMenuItem As ToolStripMenuItem
Friend WithEvents Button20 As Button
End Class

View File

@@ -1129,10 +1129,11 @@ Public Class frmDienstplanVariabel
If dgv.Parent.Parent.GetType() Is GetType(usrCntlDienstWoche) Then o = dgv.Parent.Parent
Dim d As Date = CDate(getValuesDienstDGV(o, dgv.Name, "datum"))
If o.SCHICHT.dedet_Splitschicht = True Then
MsgBox("Keine Änderungen bei Splitschichten erlaubt!")
Exit Sub
If o IsNot Nothing Then
If o.SCHICHT.dedet_Splitschicht = True Then
MsgBox("Keine Änderungen bei Splitschichten erlaubt!")
Exit Sub
End If
End If
For Each s In BEN_SCHICHTEN
@@ -1264,7 +1265,7 @@ Public Class frmDienstplanVariabel
initALL()
End If
End Sub
Public Sub initALL(Optional MAID As Integer = -1)
Public Sub initALL(Optional MAID As Integer = -1, Optional onlyFehlzeiten As Boolean = False)
Me.Cursor = Cursors.WaitCursor
' Me.Enabled = False
@@ -1276,104 +1277,114 @@ Public Class frmDienstplanVariabel
Dim cDienstAbwesendheiten As List(Of cDienstAbwesendheiten) = SQLDienst.getDienstAbwesendheiten(montag, sonntag, niederlassung)
Dim ma As List(Of cDienstMA) = Nothing
If MAID > 0 Then
If Not SQLDienst.delDstEintraegeMaId(montag, sonntag, niederlassung, MAID) Then Me.Cursor = Cursors.Default : Exit Sub 'Alle löschen
If Not SQLDienst.delDstEintraegeMaId(montag, sonntag, niederlassung, MAID, onlyFehlzeiten) Then Me.Cursor = Cursors.Default : Exit Sub 'Alles Löschen/Nur Fehlzeiten löschen
ma = SQLDienst.getAllDienstMA(niederlassung, montag, " AND dstma_id = " & MAID)
Else
If Not SQLDienst.delDstEintraege(montag, sonntag, niederlassung) Then Me.Cursor = Cursors.Default : Exit Sub 'Alle löschen
If Not SQLDienst.delDstEintraege(montag, sonntag, niederlassung, onlyFehlzeiten) Then Me.Cursor = Cursors.Default : Exit Sub 'Alles Löschen/Nur Fehlzeiten löschen
ma = SQLDienst.getAllDienstMA(niederlassung, montag)
End If
Dim datum As Date = montag
For i = 1 To 7
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(datum.Year) 'Evtl Jahressprung, darum neu definieren
For Each m In ma
Dim eintrag As New cDienstEintrag
eintrag.dstetr_dstmaId = m.dstma_id
eintrag.dstetr_datum = datum
Dim existingEntry = SQLDienst.getCountEntrys(eintrag.dstetr_dstmaId, eintrag.dstetr_datum, eintrag.dstetr_datum)
If Not FT.isFeiertag(datum, IIf(m.dstma_land <> "", m.dstma_land, SETTINGS.dpset_land)) Then
If m.dstma_muster Then
' MsgBox("HIER")
Dim tz As List(Of cDienstTeilzeit) = SQLDienst.getAllDienstTeilzeit(m.dstma_id)
eintrag.dstetr_art = getFromTeilzeit(m.dstma_4wo, "abt", tz, datum, SCHICHT)
If eintrag.dstetr_art = "" Then
eintrag.dstetr_art = "FREI"
Else
' MsgBox(getFromTeilzeit("von", tz, datum, SCHICHT) & " _ " & getFromTeilzeit("bis", tz, datum, SCHICHT))
eintrag.dstetr_von = getFromTeilzeit(m.dstma_4wo, "von", tz, datum, SCHICHT)
eintrag.dstetr_bis = getFromTeilzeit(m.dstma_4wo, "bis", tz, datum, SCHICHT)
eintrag.dstetr_pause = getFromTeilzeit(m.dstma_4wo, "pause", tz, datum, SCHICHT)
' eintrag.dstetr_pause = getDefaultTimeBySchicht(eintrag.dstetr_art, "pause", week(datum.DayOfWeek))
eintrag.dstetr_grund = ""
eintrag.dstetr_info = getFromTeilzeit(m.dstma_4wo, "info", tz, datum, SCHICHT)
'MsgBox(eintrag.dstetr_art)
If Not onlyFehlzeiten Or onlyFehlzeiten AndAlso existingEntry = 0 Then
If Not FT.isFeiertag(datum, IIf(m.dstma_land <> "", m.dstma_land, SETTINGS.dpset_land)) Then
If m.dstma_muster Then
' MsgBox("HIER")
Dim tz As List(Of cDienstTeilzeit) = SQLDienst.getAllDienstTeilzeit(m.dstma_id)
eintrag.dstetr_art = getFromTeilzeit(m.dstma_4wo, "abt", tz, datum, SCHICHT)
End If
Else
If m.dstma_arbvh = "VZ" Then
If week(datum.DayOfWeek) = "SA" Or week(datum.DayOfWeek) = "SO" Then
If eintrag.dstetr_art = "" Then
eintrag.dstetr_art = "FREI"
Else
eintrag.dstetr_art = getSchichtArt(m.dstma_abteilung, m.dstma_stammSchicht, datum)
eintrag.dstetr_hauptsplitschicht = getBooleanHauptsplitschicht(m.dstma_stammSchicht)
'MsgBox(getSchichtArt(m.dstma_abteilung, m.dstma_stammSchicht, datum))
'Abwesenheiten prüfen:
' For Each d In cDienstAbwesendheiten
'If d.dstna_mitId = eintrag.dstetr_dstmaId AndAlso d.dstna_datum_von <= datum And d.dstna_datum_bis >= datum Then
' eintrag.dstetr_art = d.dstna_grund
'End If
' Next
' MsgBox(getFromTeilzeit("von", tz, datum, SCHICHT) & " _ " & getFromTeilzeit("bis", tz, datum, SCHICHT))
eintrag.dstetr_von = getFromTeilzeit(m.dstma_4wo, "von", tz, datum, SCHICHT)
eintrag.dstetr_bis = getFromTeilzeit(m.dstma_4wo, "bis", tz, datum, SCHICHT)
eintrag.dstetr_pause = getFromTeilzeit(m.dstma_4wo, "pause", tz, datum, SCHICHT)
' eintrag.dstetr_pause = getDefaultTimeBySchicht(eintrag.dstetr_art, "pause", week(datum.DayOfWeek))
eintrag.dstetr_grund = ""
eintrag.dstetr_info = getFromTeilzeit(m.dstma_4wo, "info", tz, datum, SCHICHT)
'MsgBox(eintrag.dstetr_art)
eintrag.dstetr_art = getFromTeilzeit(m.dstma_4wo, "abt", tz, datum, SCHICHT)
End If
eintrag.dstetr_von = getDefaultTimeBySchicht(eintrag.dstetr_art, "von", week(datum.DayOfWeek))
eintrag.dstetr_bis = getDefaultTimeBySchicht(eintrag.dstetr_art, "bis", week(datum.DayOfWeek))
eintrag.dstetr_pause = getDefaultTimeBySchicht(eintrag.dstetr_art, "pause", week(datum.DayOfWeek))
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
Else
If m.dstma_arbvh = "VZ" Then
If week(datum.DayOfWeek) = "SA" Or week(datum.DayOfWeek) = "SO" Then
eintrag.dstetr_art = "FREI"
Else
eintrag.dstetr_art = getSchichtArt(m.dstma_abteilung, m.dstma_stammSchicht, datum)
eintrag.dstetr_hauptsplitschicht = getBooleanHauptsplitschicht(m.dstma_stammSchicht)
'MsgBox(getSchichtArt(m.dstma_abteilung, m.dstma_stammSchicht, datum))
'Abwesenheiten prüfen:
' For Each d In cDienstAbwesendheiten
'If d.dstna_mitId = eintrag.dstetr_dstmaId AndAlso d.dstna_datum_von <= datum And d.dstna_datum_bis >= datum Then
' eintrag.dstetr_art = d.dstna_grund
'End If
' Next
End If
eintrag.dstetr_von = getDefaultTimeBySchicht(eintrag.dstetr_art, "von", week(datum.DayOfWeek))
eintrag.dstetr_bis = getDefaultTimeBySchicht(eintrag.dstetr_art, "bis", week(datum.DayOfWeek))
eintrag.dstetr_pause = getDefaultTimeBySchicht(eintrag.dstetr_art, "pause", week(datum.DayOfWeek))
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
If False Then
If False Then
If m.dstma_kuerzel = "AKPINAR" Then
If m.dstma_kuerzel = "AKPINAR" Then
If Not week(datum.DayOfWeek) = "SA" And Not week(datum.DayOfWeek) = "SO" Then
'MsgBox("Hallo")
' eintrag.dstetr_von = "08:00"
' eintrag.dstetr_bis = "19:00"
eintrag.dstetr_info = " 8-14 14:30-19"
If Not week(datum.DayOfWeek) = "SA" And Not week(datum.DayOfWeek) = "SO" Then
'MsgBox("Hallo")
' eintrag.dstetr_von = "08:00"
' eintrag.dstetr_bis = "19:00"
eintrag.dstetr_info = " 8-14 14:30-19"
End If
End If
End If
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
Else 'TEILZEIT
eintrag.dstetr_art = "FREI"
eintrag.dstetr_von = "00:00"
eintrag.dstetr_bis = "00:00"
eintrag.dstetr_pause = "0"
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
End If
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
Else 'TEILZEIT
eintrag.dstetr_art = "FREI"
eintrag.dstetr_von = "00:00"
eintrag.dstetr_bis = "00:00"
eintrag.dstetr_pause = "0"
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
End If
Else 'FEIERTAG
eintrag.dstetr_art = "FREI"
eintrag.dstetr_von = "00:00"
eintrag.dstetr_bis = "00:00"
eintrag.dstetr_pause = "0"
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
End If
Else 'FEIERTAG
eintrag.dstetr_art = "FREI"
eintrag.dstetr_von = "00:00"
eintrag.dstetr_bis = "00:00"
eintrag.dstetr_pause = "0"
eintrag.dstetr_grund = ""
eintrag.dstetr_info = ""
' SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
End If
'Abwesenheiten prüfen:
For Each d In cDienstAbwesendheiten
If d.dstna_mitId = eintrag.dstetr_dstmaId AndAlso d.dstna_datum_von <= datum And d.dstna_datum_bis >= datum Then
@@ -1386,10 +1397,26 @@ Public Class frmDienstplanVariabel
eintrag.dstetr_von = getDefaultTimeBySchicht(grund, "von", week(datum.DayOfWeek).ToUpper)
eintrag.dstetr_bis = getDefaultTimeBySchicht(grund, "bis", week(datum.DayOfWeek).ToUpper)
eintrag.dstetr_pause = getDefaultTimeBySchicht(grund, "pause", week(datum.DayOfWeek).ToUpper)
End If
Next
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
If onlyFehlzeiten Then
'MsgBox("MA-ID: " & eintrag.dstetr_dstmaId & " " & "existingEntry: " & existingEntry & " Art: " & eintrag.dstetr_art & " DATUM: " & eintrag.dstetr_datum)
If existingEntry = 1 AndAlso (eintrag.dstetr_art = "URL" Or eintrag.dstetr_art = "KS" Or eintrag.dstetr_art = "DR" Or eintrag.dstetr_art = "BS") Or existingEntry = 0 Then
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung,, False)
ElseIf existingEntry > 1 AndAlso (eintrag.dstetr_art = "URL" Or eintrag.dstetr_art = "KS" Or eintrag.dstetr_art = "DR" Or eintrag.dstetr_art = "BS") Then 'wenn mehr als 1 Eintrag pro Tag -> Splitschicht
SQLDienst.delDstEintraegeMaId(datum, datum, niederlassung, m.dstma_id)
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung,, False)
End If
Else
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
End If
Next
datum = datum.AddDays(1)
@@ -2100,14 +2127,13 @@ Public Class frmDienstplanVariabel
MsgBox("Keine Splitschichten erlaubt!")
Exit Sub
End If
If o.SCHICHT.dedet_Hauptsplitschicht = False Then
MsgBox("In Schicht " & o.schicht_name & " sind keine Splitschichten erlaubt!")
Exit Sub
End If
Dim ids As New List(Of Integer)
Dim arr As DataGridViewSelectedCellCollection = dgv_tmp.SelectedCells
For Each c As DataGridViewCell In arr
@@ -2456,7 +2482,7 @@ Public Class frmDienstplanVariabel
If frmUrlKW.RESULT <> "" Then
' MsgBox(markId)
initALL(markId)
initALL(markId, True)
End If
@@ -2690,7 +2716,7 @@ Public Class frmDienstplanVariabel
End If
Else
MsgBox("Kein Mitarbeiter auswewählt!")
MsgBox("Kein Mitarbeiter ausgewählt!")
End If
End Sub
@@ -2918,4 +2944,12 @@ Public Class frmDienstplanVariabel
End Function
Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
If Panel6.Controls.Count > 0 Then
Dim u As usrcntlDienstplanStunden = DirectCast(Panel6.Controls(0), usrcntlDienstplanStunden)
If markId > 0 Then
initALL(markId, True)
End If
End If
End Sub
End Class

View File

@@ -22,12 +22,12 @@ Partial Class frmUrlKW
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.pnl = New System.Windows.Forms.Panel()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.txtInfo = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.cboArt = New VERAG_PROG_ALLGEMEIN.MyComboBox
Me.cboArt = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
@@ -54,11 +54,10 @@ Partial Class frmUrlKW
Me.Label25 = New System.Windows.Forms.Label()
Me.cbxMo = New System.Windows.Forms.CheckBox()
Me.btnSpeichern = New System.Windows.Forms.Button()
Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox
Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.lblKW = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.lblUrlaubEintragen = New System.Windows.Forms.Label()
Me.Button5 = New System.Windows.Forms.Button()
Me.pnl.SuspendLayout()
Me.SuspendLayout()
'
@@ -104,15 +103,25 @@ Partial Class frmUrlKW
Me.pnl.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnl.Location = New System.Drawing.Point(0, 0)
Me.pnl.Name = "pnl"
Me.pnl.Size = New System.Drawing.Size(513, 212)
Me.pnl.Size = New System.Drawing.Size(537, 212)
Me.pnl.TabIndex = 0
'
'Button5
'
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button5.Image = Global.ADMIN.My.Resources.Resources.plus
Me.Button5.Location = New System.Drawing.Point(361, 155)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(47, 44)
Me.Button5.TabIndex = 43
Me.Button5.UseVisualStyleBackColor = True
'
'Button4
'
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button4.Image = Global.ADMIN.My.Resources.Resources.del
Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button4.Location = New System.Drawing.Point(385, 66)
Me.Button4.Location = New System.Drawing.Point(411, 66)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(111, 44)
Me.Button4.TabIndex = 42
@@ -138,10 +147,12 @@ Partial Class frmUrlKW
'
'cboArt
'
Me.cboArt._allowedValuesFreiText = Nothing
Me.cboArt._allowFreiText = False
Me.cboArt._value = ""
Me.cboArt.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboArt.FormattingEnabled = True
Me.cboArt.Location = New System.Drawing.Point(385, 39)
Me.cboArt.Location = New System.Drawing.Point(411, 39)
Me.cboArt.Name = "cboArt"
Me.cboArt.Size = New System.Drawing.Size(111, 21)
Me.cboArt.TabIndex = 39
@@ -149,7 +160,7 @@ Partial Class frmUrlKW
'Button3
'
Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button3.Location = New System.Drawing.Point(344, 8)
Me.Button3.Location = New System.Drawing.Point(373, 8)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(32, 24)
Me.Button3.TabIndex = 38
@@ -159,7 +170,7 @@ Partial Class frmUrlKW
'Button2
'
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button2.Location = New System.Drawing.Point(448, 9)
Me.Button2.Location = New System.Drawing.Point(474, 9)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(32, 24)
Me.Button2.TabIndex = 37
@@ -169,7 +180,7 @@ Partial Class frmUrlKW
'Button1
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(385, 114)
Me.Button1.Location = New System.Drawing.Point(411, 114)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(111, 27)
Me.Button1.TabIndex = 36
@@ -189,63 +200,63 @@ Partial Class frmUrlKW
'
'lblSo
'
Me.lblSo.Location = New System.Drawing.Point(329, 114)
Me.lblSo.Location = New System.Drawing.Point(356, 114)
Me.lblSo.Name = "lblSo"
Me.lblSo.Size = New System.Drawing.Size(50, 15)
Me.lblSo.Size = New System.Drawing.Size(55, 15)
Me.lblSo.TabIndex = 34
Me.lblSo.Text = "01.01."
Me.lblSo.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblSa
'
Me.lblSa.Location = New System.Drawing.Point(278, 114)
Me.lblSa.Location = New System.Drawing.Point(300, 114)
Me.lblSa.Name = "lblSa"
Me.lblSa.Size = New System.Drawing.Size(50, 15)
Me.lblSa.Size = New System.Drawing.Size(55, 15)
Me.lblSa.TabIndex = 33
Me.lblSa.Text = "01.01."
Me.lblSa.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblFr
'
Me.lblFr.Location = New System.Drawing.Point(223, 114)
Me.lblFr.Location = New System.Drawing.Point(245, 114)
Me.lblFr.Name = "lblFr"
Me.lblFr.Size = New System.Drawing.Size(50, 15)
Me.lblFr.Size = New System.Drawing.Size(55, 15)
Me.lblFr.TabIndex = 32
Me.lblFr.Text = "01.01."
Me.lblFr.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblDo
'
Me.lblDo.Location = New System.Drawing.Point(171, 114)
Me.lblDo.Location = New System.Drawing.Point(189, 114)
Me.lblDo.Name = "lblDo"
Me.lblDo.Size = New System.Drawing.Size(50, 15)
Me.lblDo.Size = New System.Drawing.Size(55, 15)
Me.lblDo.TabIndex = 31
Me.lblDo.Text = "01.01."
Me.lblDo.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblMi
'
Me.lblMi.Location = New System.Drawing.Point(117, 114)
Me.lblMi.Location = New System.Drawing.Point(127, 114)
Me.lblMi.Name = "lblMi"
Me.lblMi.Size = New System.Drawing.Size(50, 15)
Me.lblMi.Size = New System.Drawing.Size(55, 15)
Me.lblMi.TabIndex = 30
Me.lblMi.Text = "01.01."
Me.lblMi.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblDi
'
Me.lblDi.Location = New System.Drawing.Point(67, 114)
Me.lblDi.Location = New System.Drawing.Point(66, 114)
Me.lblDi.Name = "lblDi"
Me.lblDi.Size = New System.Drawing.Size(50, 15)
Me.lblDi.Size = New System.Drawing.Size(55, 15)
Me.lblDi.TabIndex = 29
Me.lblDi.Text = "01.01."
Me.lblDi.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'lblMo
'
Me.lblMo.Location = New System.Drawing.Point(12, 114)
Me.lblMo.Location = New System.Drawing.Point(2, 114)
Me.lblMo.Name = "lblMo"
Me.lblMo.Size = New System.Drawing.Size(50, 15)
Me.lblMo.Size = New System.Drawing.Size(55, 15)
Me.lblMo.TabIndex = 28
Me.lblMo.Text = "01.01."
Me.lblMo.TextAlign = System.Drawing.ContentAlignment.TopCenter
@@ -253,7 +264,7 @@ Partial Class frmUrlKW
'Label17
'
Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label17.Location = New System.Drawing.Point(329, 101)
Me.Label17.Location = New System.Drawing.Point(356, 101)
Me.Label17.Name = "Label17"
Me.Label17.Size = New System.Drawing.Size(50, 15)
Me.Label17.TabIndex = 20
@@ -263,7 +274,7 @@ Partial Class frmUrlKW
'cbxSo
'
Me.cbxSo.AutoSize = True
Me.cbxSo.Location = New System.Drawing.Point(347, 132)
Me.cbxSo.Location = New System.Drawing.Point(374, 132)
Me.cbxSo.Name = "cbxSo"
Me.cbxSo.Size = New System.Drawing.Size(15, 14)
Me.cbxSo.TabIndex = 27
@@ -272,7 +283,7 @@ Partial Class frmUrlKW
'Label18
'
Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label18.Location = New System.Drawing.Point(278, 101)
Me.Label18.Location = New System.Drawing.Point(300, 101)
Me.Label18.Name = "Label18"
Me.Label18.Size = New System.Drawing.Size(50, 15)
Me.Label18.TabIndex = 19
@@ -282,7 +293,7 @@ Partial Class frmUrlKW
'cbxSa
'
Me.cbxSa.AutoSize = True
Me.cbxSa.Location = New System.Drawing.Point(296, 132)
Me.cbxSa.Location = New System.Drawing.Point(318, 132)
Me.cbxSa.Name = "cbxSa"
Me.cbxSa.Size = New System.Drawing.Size(15, 14)
Me.cbxSa.TabIndex = 26
@@ -291,7 +302,7 @@ Partial Class frmUrlKW
'Label19
'
Me.Label19.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label19.Location = New System.Drawing.Point(223, 101)
Me.Label19.Location = New System.Drawing.Point(245, 101)
Me.Label19.Name = "Label19"
Me.Label19.Size = New System.Drawing.Size(50, 15)
Me.Label19.TabIndex = 18
@@ -301,7 +312,7 @@ Partial Class frmUrlKW
'cbxFr
'
Me.cbxFr.AutoSize = True
Me.cbxFr.Location = New System.Drawing.Point(241, 132)
Me.cbxFr.Location = New System.Drawing.Point(263, 132)
Me.cbxFr.Name = "cbxFr"
Me.cbxFr.Size = New System.Drawing.Size(15, 14)
Me.cbxFr.TabIndex = 25
@@ -310,7 +321,7 @@ Partial Class frmUrlKW
'Label20
'
Me.Label20.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label20.Location = New System.Drawing.Point(171, 101)
Me.Label20.Location = New System.Drawing.Point(189, 101)
Me.Label20.Name = "Label20"
Me.Label20.Size = New System.Drawing.Size(50, 15)
Me.Label20.TabIndex = 17
@@ -320,7 +331,7 @@ Partial Class frmUrlKW
'cbxDo
'
Me.cbxDo.AutoSize = True
Me.cbxDo.Location = New System.Drawing.Point(189, 132)
Me.cbxDo.Location = New System.Drawing.Point(207, 132)
Me.cbxDo.Name = "cbxDo"
Me.cbxDo.Size = New System.Drawing.Size(15, 14)
Me.cbxDo.TabIndex = 24
@@ -329,7 +340,7 @@ Partial Class frmUrlKW
'Label21
'
Me.Label21.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label21.Location = New System.Drawing.Point(117, 101)
Me.Label21.Location = New System.Drawing.Point(129, 101)
Me.Label21.Name = "Label21"
Me.Label21.Size = New System.Drawing.Size(50, 15)
Me.Label21.TabIndex = 16
@@ -339,7 +350,7 @@ Partial Class frmUrlKW
'cbxMi
'
Me.cbxMi.AutoSize = True
Me.cbxMi.Location = New System.Drawing.Point(135, 132)
Me.cbxMi.Location = New System.Drawing.Point(147, 132)
Me.cbxMi.Name = "cbxMi"
Me.cbxMi.Size = New System.Drawing.Size(15, 14)
Me.cbxMi.TabIndex = 23
@@ -348,7 +359,7 @@ Partial Class frmUrlKW
'Label22
'
Me.Label22.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label22.Location = New System.Drawing.Point(67, 101)
Me.Label22.Location = New System.Drawing.Point(70, 101)
Me.Label22.Name = "Label22"
Me.Label22.Size = New System.Drawing.Size(50, 15)
Me.Label22.TabIndex = 15
@@ -358,7 +369,7 @@ Partial Class frmUrlKW
'cbxDi
'
Me.cbxDi.AutoSize = True
Me.cbxDi.Location = New System.Drawing.Point(85, 132)
Me.cbxDi.Location = New System.Drawing.Point(88, 132)
Me.cbxDi.Name = "cbxDi"
Me.cbxDi.Size = New System.Drawing.Size(15, 14)
Me.cbxDi.TabIndex = 22
@@ -367,7 +378,7 @@ Partial Class frmUrlKW
'Label25
'
Me.Label25.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label25.Location = New System.Drawing.Point(12, 101)
Me.Label25.Location = New System.Drawing.Point(11, 101)
Me.Label25.Name = "Label25"
Me.Label25.Size = New System.Drawing.Size(50, 15)
Me.Label25.TabIndex = 14
@@ -377,7 +388,7 @@ Partial Class frmUrlKW
'cbxMo
'
Me.cbxMo.AutoSize = True
Me.cbxMo.Location = New System.Drawing.Point(30, 132)
Me.cbxMo.Location = New System.Drawing.Point(29, 132)
Me.cbxMo.Name = "cbxMo"
Me.cbxMo.Size = New System.Drawing.Size(15, 14)
Me.cbxMo.TabIndex = 21
@@ -388,7 +399,7 @@ Partial Class frmUrlKW
Me.btnSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSpeichern.Image = Global.ADMIN.My.Resources.Resources.save
Me.btnSpeichern.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnSpeichern.Location = New System.Drawing.Point(385, 155)
Me.btnSpeichern.Location = New System.Drawing.Point(411, 155)
Me.btnSpeichern.Name = "btnSpeichern"
Me.btnSpeichern.Size = New System.Drawing.Size(111, 44)
Me.btnSpeichern.TabIndex = 4
@@ -397,6 +408,8 @@ Partial Class frmUrlKW
'
'MyComboBox1
'
Me.MyComboBox1._allowedValuesFreiText = Nothing
Me.MyComboBox1._allowFreiText = False
Me.MyComboBox1._value = ""
Me.MyComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple
Me.MyComboBox1.Enabled = False
@@ -411,7 +424,7 @@ Partial Class frmUrlKW
'
Me.lblKW.AutoSize = True
Me.lblKW.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold)
Me.lblKW.Location = New System.Drawing.Point(382, 12)
Me.lblKW.Location = New System.Drawing.Point(408, 12)
Me.lblKW.Name = "lblKW"
Me.lblKW.Size = New System.Drawing.Size(60, 17)
Me.lblKW.TabIndex = 2
@@ -437,21 +450,11 @@ Partial Class frmUrlKW
Me.lblUrlaubEintragen.TabIndex = 0
Me.lblUrlaubEintragen.Text = "Urlaub eintragen"
'
'Button5
'
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button5.Image = Global.ADMIN.My.Resources.Resources.plus
Me.Button5.Location = New System.Drawing.Point(332, 155)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(47, 44)
Me.Button5.TabIndex = 43
Me.Button5.UseVisualStyleBackColor = True
'
'frmUrlKW
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(513, 212)
Me.ClientSize = New System.Drawing.Size(537, 212)
Me.Controls.Add(Me.pnl)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "frmUrlKW"

View File

@@ -1,4 +1,6 @@
Public Class frmUrlKW
Imports GrapeCity.ActiveReports.Chart.Graphics
Public Class frmUrlKW
Public KW As Integer
Public YEAR As Integer
Public ART As String
@@ -11,6 +13,10 @@
Dim SQLDienst As New cDienstplan
Dim montag As Date
Dim loaded = False
Dim ftString As String = " FT"
Dim DPAlreadyInit As Boolean = False
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click
' SQLDienst.delDienstNichtAnwesendKW_ByKwJahr(maId, KW, YEAR)
@@ -23,7 +29,7 @@
' SQLDienst.delDienstNichtAnwesendIdArtDatum(maId, montag, montag.AddDays(6))
End If
Dim id = SQLDienst.insertDienstNA_KW(maId, KW, YEAR, DirectCast(cboArt.SelectedItem, VERAG_PROG_ALLGEMEIN.MyListItem).Value, txtInfo.Text, niederlassung)
' Dim ma As cDienstMA = SQLDienst.getDstMA(maId)
@@ -59,6 +65,8 @@
cboArt.SelectedIndex = 0
End Sub
Private Sub frmUrlKW_Shown(sender As Object, e As EventArgs) Handles Me.Shown
@@ -75,6 +83,10 @@
For Each i In MyComboBox1.Items
If DirectCast(i, VERAG_PROG_ALLGEMEIN.MyListItem).Value = maId Then MyComboBox1.SelectedItem = i
Next
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(YEAR)
Dim ftString As String = " FT"
montag = CalendarWeek(KW, YEAR)
lblMo.Text = montag.ToString("dd.MM.")
lblDi.Text = montag.AddDays(1).ToString("dd.MM.")
@@ -84,6 +96,71 @@
lblSa.Text = montag.AddDays(5).ToString("dd.MM.")
lblSo.Text = montag.AddDays(6).ToString("dd.MM.")
DPAlreadyInit = checkIfDPEntryIsExisting()
If (FT.isFeiertag(montag, cDienstSettings.getLand(niederlassung))) Then
lblMo.TextAlign = ContentAlignment.TopLeft
lblMo.Text &= ftString
lblMo.ForeColor = Color.Red
Else
lblMo.TextAlign = ContentAlignment.TopCenter
lblMo.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(1), cDienstSettings.getLand(niederlassung))) Then
lblDi.TextAlign = ContentAlignment.TopLeft
lblDi.Text &= ftString
lblDi.ForeColor = Color.Red
Else
lblDi.TextAlign = ContentAlignment.TopCenter
lblDi.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(2), cDienstSettings.getLand(niederlassung))) Then
lblMi.TextAlign = ContentAlignment.TopLeft
lblMi.Text &= ftString
lblMi.ForeColor = Color.Red
Else
lblMi.TextAlign = ContentAlignment.TopCenter
lblMi.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(3), cDienstSettings.getLand(niederlassung))) Then
lblDo.TextAlign = ContentAlignment.TopLeft
lblDo.Text &= ftString
lblDo.ForeColor = Color.Red
Else
lblDo.TextAlign = ContentAlignment.TopCenter
lblDo.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(4), cDienstSettings.getLand(niederlassung))) Then
lblFr.TextAlign = ContentAlignment.TopLeft
lblFr.Text &= ftString
lblFr.ForeColor = Color.Red
Else
lblFr.TextAlign = ContentAlignment.TopCenter
lblFr.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(5), cDienstSettings.getLand(niederlassung))) Then
lblSa.TextAlign = ContentAlignment.TopLeft
lblSa.Text &= ftString
lblSa.ForeColor = Color.Red
Else
lblSa.TextAlign = ContentAlignment.TopCenter
lblSa.ForeColor = Color.Black
End If
If (FT.isFeiertag(montag.AddDays(6), cDienstSettings.getLand(niederlassung))) Then
lblSo.TextAlign = ContentAlignment.TopLeft
lblSo.Text &= ftString
lblSo.ForeColor = Color.Red
Else
lblSo.TextAlign = ContentAlignment.TopCenter
lblSo.ForeColor = Color.Black
End If
cbxMo.Checked = False
cbxDi.Checked = False
@@ -137,6 +214,16 @@
End If
End If
If DPAlreadyInit Then
lblUrlaubEintragen.Text = cboArt.SelectedItem.ToString & " eintragen - DP wurde bereits init."
lblUrlaubEintragen.ForeColor = Color.Red
Else
lblUrlaubEintragen.Text = cboArt.SelectedItem.ToString & " eintragen"
lblUrlaubEintragen.ForeColor = Color.Black
End If
End Sub
Public Function CalendarWeek(ByVal nWeek As Integer, ByVal nYear As Integer) As Date
@@ -171,13 +258,13 @@
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
cbxMo.Checked = sender.checked
cbxDi.Checked = sender.checked
cbxMi.Checked = sender.checked
cbxDo.Checked = sender.checked
cbxFr.Checked = sender.checked
cbxSa.Checked = sender.checked
cbxSo.Checked = sender.checked
cbxMo.Checked = IIf(lblMo.Text.Substring(lblMo.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxDi.Checked = IIf(lblDi.Text.Substring(lblDi.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxMi.Checked = IIf(lblMi.Text.Substring(lblMi.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxDo.Checked = IIf(lblDo.Text.Substring(lblDo.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxFr.Checked = IIf(lblFr.Text.Substring(lblFr.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxSa.Checked = IIf(lblSa.Text.Substring(lblSa.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
cbxSo.Checked = IIf(lblSo.Text.Substring(lblSo.Text.Length - ftString.Length) = ftString AndAlso Not cboArt._value = "DR", False, sender.checked)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
@@ -190,6 +277,7 @@
Private Sub cboArt_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboArt.SelectedIndexChanged
If loaded Then
txtInfo.Text = cboArt._value
CheckBox1_CheckedChanged(CheckBox1, e)
End If
End Sub
@@ -197,4 +285,16 @@
KW_ID = -1
init()
End Sub
Private Function checkIfDPEntryIsExisting()
If SQL.DLookup("count([dstetr_id])", "[tblDienstplanEintraege]", " [dstetr_niederlassung]='" & niederlassung & "' and [dstetr_dstmaId]='" & maId & "' and [dstetr_datum] BETWEEN'" & montag.ToShortDateString & "' AND '" & montag.AddDays(6).ToShortDateString & "'", "ADMIN", 0) > 0 Then
Return True
Else
Return False
End If
End Function
End Class

View File

@@ -27,14 +27,14 @@ Partial Class frmUrlaubsplaner
Me.dgvUrlaub = New System.Windows.Forms.DataGridView()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Label3 = New System.Windows.Forms.Label()
Me.cboJahr = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Button4 = New System.Windows.Forms.Button()
Me.lblKw = New System.Windows.Forms.Label()
Me.lblMa = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.lblUrlaubsplaner = New System.Windows.Forms.Label()
Me.cboJahr = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.pnl.SuspendLayout()
CType(Me.dgvUrlaub, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
@@ -94,6 +94,30 @@ Partial Class frmUrlaubsplaner
Me.Panel1.Size = New System.Drawing.Size(1113, 53)
Me.Panel1.TabIndex = 1
'
'Label3
'
Me.Label3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(933, 10)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(30, 13)
Me.Label3.TabIndex = 71
Me.Label3.Text = "Jahr:"
'
'cboJahr
'
Me.cboJahr._allowedValuesFreiText = Nothing
Me.cboJahr._allowFreiText = False
Me.cboJahr._value = ""
Me.cboJahr.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.cboJahr.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboJahr.FormattingEnabled = True
Me.cboJahr.Location = New System.Drawing.Point(969, 5)
Me.cboJahr.Name = "cboJahr"
Me.cboJahr.Size = New System.Drawing.Size(121, 21)
Me.cboJahr.TabIndex = 70
'
'Button4
'
Me.Button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
@@ -102,9 +126,9 @@ Partial Class frmUrlaubsplaner
Me.Button4.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button4.Image = Global.ADMIN.My.Resources.Resources.Excel_2013_logo_155x110
Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button4.Location = New System.Drawing.Point(763, 15)
Me.Button4.Location = New System.Drawing.Point(631, 15)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(31, 27)
Me.Button4.Size = New System.Drawing.Size(38, 27)
Me.Button4.TabIndex = 69
Me.Button4.Tag = "Dienstplan erstellen"
Me.Button4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
@@ -161,30 +185,6 @@ Partial Class frmUrlaubsplaner
Me.lblUrlaubsplaner.TabIndex = 0
Me.lblUrlaubsplaner.Text = "Abwesenheits-Planer"
'
'cboJahr
'
Me.cboJahr._allowedValuesFreiText = Nothing
Me.cboJahr._allowFreiText = False
Me.cboJahr._value = ""
Me.cboJahr.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.cboJahr.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboJahr.FormattingEnabled = True
Me.cboJahr.Location = New System.Drawing.Point(969, 5)
Me.cboJahr.Name = "cboJahr"
Me.cboJahr.Size = New System.Drawing.Size(121, 21)
Me.cboJahr.TabIndex = 70
'
'Label3
'
Me.Label3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(933, 10)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(30, 13)
Me.Label3.TabIndex = 71
Me.Label3.Text = "Jahr:"
'
'frmUrlaubsplaner
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

View File

@@ -1,10 +1,12 @@
Imports System.Reflection
Imports ClosedXML.Excel
Public Class frmUrlaubsplaner
Dim DP As New cDienstplan
Dim ADMIN As New cOptionenDAL
Public niederlassung = ""
Dim aktJahr As Integer = Now.Year
Dim dt As New DataTable
Private Sub frmUrlaubsplaner_Load(sender As Object, e As EventArgs) Handles Me.Load
lblMa.Text = ""
@@ -169,8 +171,8 @@ Public Class frmUrlaubsplaner
Return dDate.Year + 1 & "01"
ElseIf dDate < dThisYear Then
' Falls das Datum noch zu einer KW aus dem letzten Jahr zählt
Return dDate.Year - 1 & DatePart(DateInterval.WeekOfYear, _
New Date(dDate.Year - 1, 12, 28), FirstDayOfWeek.Monday, _
Return dDate.Year - 1 & DatePart(DateInterval.WeekOfYear,
New Date(dDate.Year - 1, 12, 28), FirstDayOfWeek.Monday,
FirstWeekOfYear.FirstFourDays)
Else
' KW = Differenz zum ersten Tag der ersten Woche
@@ -234,7 +236,7 @@ Public Class frmUrlaubsplaner
End If
End Sub
Private Sub dgvPrjDwgs_CellMouseLeave(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvUrlaub.CellMouseLeave
For i = 0 To dgvUrlaub.RowCount - 1
For i = 0 To dgvUrlaub.RowCount - 1
For j = 0 To dgvUrlaub.ColumnCount - 1
Dim c = dgvUrlaub.Rows(i).Cells(j)
If c.Value Is Nothing Then c.Style.BackColor = IIf(j = 0, Color.LightGray, Color.White)
@@ -248,7 +250,7 @@ Public Class frmUrlaubsplaner
dgvUrlaub.SuspendLayout()
dgvUrlaub.DefaultCellStyle.BackColor = Color.White
If dgvUrlaub.SelectedCells.Count > 0 Then '
'dgvUrlaub.Rows(dgvUrlaub.SelectedCells(0).OwningRow.Index).Cells("maKuerzel").Style.BackColor = Color.Red ' : MsgBox(dgvUrlaub.SelectedRows(0).Cells("maKuerzel").Value)
dgvUrlaub.Rows(dgvUrlaub.SelectedCells(0).OwningRow.Index).DefaultCellStyle.BackColor = Color.LightGray ' : MsgBox(dgvUrlaub.SelectedRows(0).Cells("maKuerzel").Value)
@@ -332,11 +334,136 @@ Public Class frmUrlaubsplaner
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
cProgramFunctions.genExcelFromDT_NEW(cProgramFunctions.dgridViewTods(dgvUrlaub))
saveToDt()
Try
Dim dt1 As New DataTable()
Dim dt2 As New DataTable()
Dim halfOfYearWeek As Integer = 28
For Each column As DataGridViewColumn In dgvUrlaub.Columns
If column.ValueType Is Nothing Then
If column.Index < 2 Then
dt1.Columns.Add(column.HeaderText, System.Type.GetType("System.String"))
dt2.Columns.Add(column.HeaderText, System.Type.GetType("System.String"))
ElseIf column.Index < halfOfYearWeek Then
dt1.Columns.Add(column.HeaderText, System.Type.GetType("System.String"))
Else
dt2.Columns.Add(column.HeaderText, System.Type.GetType("System.String"))
End If
Else
If column.Index < 2 Then
dt1.Columns.Add(column.HeaderText, column.ValueType)
dt2.Columns.Add(column.HeaderText, column.ValueType)
ElseIf column.Index < halfOfYearWeek Then
dt1.Columns.Add(column.HeaderText, column.ValueType)
Else
dt2.Columns.Add(column.HeaderText, column.ValueType)
End If
End If
Next
For Each row As DataGridViewRow In dgvUrlaub.Rows
dt1.Rows.Add()
dt2.Rows.Add()
For Each cell As DataGridViewCell In row.Cells
If cell.Value Is Nothing Then
If cell.ColumnIndex < 2 Then
dt1.Rows(dt1.Rows.Count - 1)(cell.ColumnIndex) = ""
dt2.Rows(dt2.Rows.Count - 1)(cell.ColumnIndex) = ""
ElseIf cell.ColumnIndex < halfOfYearWeek Then
dt1.Rows(dt1.Rows.Count - 1)(cell.ColumnIndex) = ""
Else
dt2.Rows(dt2.Rows.Count - 1)(cell.ColumnIndex - (halfOfYearWeek - 2)) = ""
End If
Else
If cell.ColumnIndex < 2 Then
dt1.Rows(dt1.Rows.Count - 1)(cell.ColumnIndex) = cell.Value.ToString()
dt2.Rows(dt2.Rows.Count - 1)(cell.ColumnIndex) = cell.Value.ToString()
ElseIf cell.ColumnIndex < halfOfYearWeek Then
dt1.Rows(dt1.Rows.Count - 1)(cell.ColumnIndex) = cell.Value.ToString()
Else
dt2.Rows(dt2.Rows.Count - 1)(cell.ColumnIndex - (halfOfYearWeek - 2)) = cell.Value.ToString()
End If
End If
Next
Next
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SDL\tmp\" ' My.Computer.FileSystem.GetTempFileName
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
My.Computer.FileSystem.CreateDirectory(sPath)
End If
Dim wb As New XLWorkbook
' Dim dt As DataTable = (dgv.DataSource)
' Dim dt As DataTable = TryCast(dgv., DataTable)
wb.Worksheets.Add(dt1, "URLAUB JH 1")
wb.Worksheets.Add(dt2, "URLAUB JH 2")
Dim filename As String = sPath & "Urlaubsplan_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
wb.SaveAs(filename)
Process.Start(filename)
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
End Sub
Private Sub cboJahr_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboJahr.SelectedIndexChanged
If loaded Then aktJahr = cboJahr._value : initDGV() :
End Sub
Private Function saveToDt() As DataTable
Dim dt As New DataTable()
For Each column As DataGridViewColumn In dgvUrlaub.Columns
If column.ValueType Is Nothing Then
dt.Columns.Add(column.HeaderText, System.Type.GetType("System.String"))
Else
dt.Columns.Add(column.HeaderText, column.ValueType)
End If
Next
For Each row As DataGridViewRow In dgvUrlaub.Rows
dt.Rows.Add()
For Each cell As DataGridViewCell In row.Cells
If cell.Value Is Nothing Then
dt.Rows(dt.Rows.Count - 1)(cell.ColumnIndex) = ""
Else
dt.Rows(dt.Rows.Count - 1)(cell.ColumnIndex) = cell.Value.ToString()
End If
Next
Next
Return dt
End Function
End Class

View File

@@ -365,7 +365,7 @@ Public Class usrCntlDienstplan
Dim tatStdSum As Double = 0
Dim cPF As New cProgramFunctions
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(datumKW.Year)
AddHandler rpt.Detail.Format, Sub()

View File

@@ -3550,9 +3550,13 @@ Public Class cDienstplan
Return Nothing
End Function
Public Function delDstEintraege(von, bis, niederlassung) As Boolean
Public Function delDstEintraege(von As Date, bis As Date, niederlassung As String, Optional onlyFehlzeiten As Boolean = False) As Boolean
Dim sqlFehlzeiten As String = ""
If onlyFehlzeiten Then sqlFehlzeiten &= " AND ([dstetr_art] = 'URL' OR [dstetr_art] = 'DR' OR [dstetr_art] = 'BS') "
Dim sql = "DELETE FROM tblDienstplanEintraege " &
"WHERE dstetr_niederlassung= '" & niederlassung & "' AND dstetr_datum BETWEEN @von AND @bis "
"WHERE dstetr_niederlassung= '" & niederlassung & "' AND dstetr_datum BETWEEN @von AND @bis " & sqlFehlzeiten
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
Using cmd As New SqlCommand(sql, conn)
cmd.Parameters.AddWithValue("@von", von)
@@ -3568,9 +3572,11 @@ Public Class cDienstplan
Return False
End Function
Public Function delDstEintraegeMaId(von, bis, niederlassung, dstetr_dstmaId) As Boolean
Public Function delDstEintraegeMaId(von As Date, bis As Date, niederlassung As String, dstetr_dstmaId As Integer, Optional onlyFehlzeiten As Boolean = False) As Boolean
Dim sqlFehlzeiten = ""
If onlyFehlzeiten Then sqlFehlzeiten &= " AND ([dstetr_art] = 'URL' OR [dstetr_art] = 'DR' OR [dstetr_art] = 'BS') "
Dim sql = "DELETE FROM tblDienstplanEintraege " &
"WHERE dstetr_niederlassung= '" & niederlassung & "' AND dstetr_datum BETWEEN @von AND @bis AND dstetr_dstmaId=@dstetr_dstmaId"
"WHERE dstetr_niederlassung= '" & niederlassung & "' AND dstetr_datum BETWEEN @von AND @bis AND dstetr_dstmaId=@dstetr_dstmaId" & sqlFehlzeiten
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
Using cmd As New SqlCommand(sql, conn)
cmd.Parameters.AddWithValue("@von", von)
@@ -3713,20 +3719,24 @@ Public Class cDienstplan
End Function
Public Function updateInsertByDienstEintrag(ByVal daten As cDienstEintrag, niederlassung As String, Optional dstetr_id As Integer = -1) As Boolean
Public Function updateInsertByDienstEintrag(ByVal daten As cDienstEintrag, niederlassung As String, Optional dstetr_id As Integer = -1, Optional enableMultiEntriesPerArt As Boolean = True) As Boolean
Dim SQLclause As String = ""
If enableMultiEntriesPerArt Then
SQLclause &= " AND dstetr_art=@dstetr_art"
End If
If dstetr_id > 0 Then
SQLclause = " AND dstetr_id=@dstetr_id"
End If
Dim sql As String = " begin tran" &
" if exists (select * from tblDienstplanEintraege with (updlock,serializable) where dstetr_datum = @dstetr_datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_niederlassung=@dstetr_niederlassung AND dstetr_art=@dstetr_art" & SQLclause & ") " &
" if exists (select * from tblDienstplanEintraege with (updlock,serializable) where dstetr_datum = @dstetr_datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_niederlassung=@dstetr_niederlassung" & SQLclause & ") " &
" begin " &
" UPDATE tblDienstplanEintraege " &
" SET dstetr_dstmaId=@dstetr_dstmaId, dstetr_art=@dstetr_art, dstetr_von=@dstetr_von, dstetr_bis=@dstetr_bis, dstetr_grund=@dstetr_grund, dstetr_info=@dstetr_info,dstetr_niederlassung=@dstetr_niederlassung,dstetr_pause=@dstetr_pause,dstetr_hauptsplitschicht=@dstetr_hauptsplitschicht,dstetr_splitschicht=@dstetr_splitschicht " &
" WHERE dstetr_datum = @dstetr_datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_niederlassung=@dstetr_niederlassung AND dstetr_art=@dstetr_art" & SQLclause &
" WHERE dstetr_datum = @dstetr_datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_niederlassung=@dstetr_niederlassung" & SQLclause &
" End " &
" Else " &
" begin " &
@@ -3763,6 +3773,7 @@ Public Class cDienstplan
Return False
End Function
Public Function getDienstEintragList(datum As Date, niederlassung As String) As List(Of cDienstEintrag)
Dim sql As String = " SELECT * FROM tblDienstplanEintraege WHERE dstetr_datum = @dstetr_datum AND dstetr_niederlassung=@dstetr_niederlassung "
Dim daten As List(Of cDienstEintrag) = Nothing
@@ -4087,7 +4098,7 @@ Public Class cDienstplan
Dim datum As Date = CDate(dr.Item("dstetr_datum"))
Dim woTag = datum.ToString("ddd", New CultureInfo("de-DE")).ToUpper
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage()
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(datum.Year)
' If FT.isFeiertag(datum) And woTag <> "SO" And woTag <> "SA" Then
' s +=
' End If