isFeiertag, Control (Insert und Delete in Schichten), ExcelAusgabeDP, etc.
This commit is contained in:
69
UID/Dienstplan/frmDienstplanVariabel.Designer.vb
generated
69
UID/Dienstplan/frmDienstplanVariabel.Designer.vb
generated
@@ -1,9 +1,9 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class frmDienstplanVariabel
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
@@ -20,7 +20,7 @@ Partial Class frmDienstplanVariabel
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("KW 1")
|
||||
@@ -61,6 +61,8 @@ Partial Class frmDienstplanVariabel
|
||||
Me.cboQSSpaet = New System.Windows.Forms.ComboBox()
|
||||
Me.Label23 = New System.Windows.Forms.Label()
|
||||
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
|
||||
Me.txtSchichtstd = New System.Windows.Forms.TextBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.txtWoStd = New System.Windows.Forms.TextBox()
|
||||
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||
@@ -152,11 +154,10 @@ Partial Class frmDienstplanVariabel
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.Button3 = New System.Windows.Forms.Button()
|
||||
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.SchichtLöcshenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Panel4 = New System.Windows.Forms.Panel()
|
||||
Me.pnlOptions = New System.Windows.Forms.Panel()
|
||||
Me.Button19 = New System.Windows.Forms.Button()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.txtSchichtstd = New System.Windows.Forms.TextBox()
|
||||
Me.UsrcntlAuswertungWocheAuslastung1 = New ADMIN.usrcntlAuswertungWocheAuslastung()
|
||||
Me.UsrCntlAuswertungAuslastungMA1 = New ADMIN.usrCntlAuswertungAuslastungMA()
|
||||
Me.ctxtDgv.SuspendLayout()
|
||||
@@ -214,6 +215,7 @@ Partial Class frmDienstplanVariabel
|
||||
CType(Me.dgvUrl_Do, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.tbAuswertung.SuspendLayout()
|
||||
Me.tbTagesverteilung.SuspendLayout()
|
||||
Me.ContextMenuStrip1.SuspendLayout()
|
||||
Me.Panel4.SuspendLayout()
|
||||
Me.pnlOptions.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
@@ -529,6 +531,29 @@ Partial Class frmDienstplanVariabel
|
||||
Me.GroupBox1.TabStop = False
|
||||
Me.GroupBox1.Text = "Details zum aktuellen Eintrag"
|
||||
'
|
||||
'txtSchichtstd
|
||||
'
|
||||
Me.txtSchichtstd.BackColor = System.Drawing.Color.White
|
||||
Me.txtSchichtstd.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.txtSchichtstd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.txtSchichtstd.Location = New System.Drawing.Point(194, 117)
|
||||
Me.txtSchichtstd.MaxLength = 1
|
||||
Me.txtSchichtstd.Name = "txtSchichtstd"
|
||||
Me.txtSchichtstd.ReadOnly = True
|
||||
Me.txtSchichtstd.Size = New System.Drawing.Size(38, 13)
|
||||
Me.txtSchichtstd.TabIndex = 99
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||
Me.Label1.Location = New System.Drawing.Point(120, 118)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(68, 13)
|
||||
Me.Label1.TabIndex = 98
|
||||
Me.Label1.Text = "Std. Schicht:"
|
||||
Me.Label1.Visible = False
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
@@ -1597,8 +1622,15 @@ Partial Class frmDienstplanVariabel
|
||||
'
|
||||
'ContextMenuStrip1
|
||||
'
|
||||
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SchichtLöcshenToolStripMenuItem})
|
||||
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
|
||||
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
|
||||
Me.ContextMenuStrip1.Size = New System.Drawing.Size(181, 48)
|
||||
'
|
||||
'SchichtLöcshenToolStripMenuItem
|
||||
'
|
||||
Me.SchichtLöcshenToolStripMenuItem.Name = "SchichtLöcshenToolStripMenuItem"
|
||||
Me.SchichtLöcshenToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
|
||||
Me.SchichtLöcshenToolStripMenuItem.Text = "Schicht löschen"
|
||||
'
|
||||
'Panel4
|
||||
'
|
||||
@@ -1654,29 +1686,6 @@ Partial Class frmDienstplanVariabel
|
||||
Me.Button19.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||
Me.Button19.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
|
||||
Me.Label1.Location = New System.Drawing.Point(120, 118)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(68, 13)
|
||||
Me.Label1.TabIndex = 98
|
||||
Me.Label1.Text = "Std. Schicht:"
|
||||
Me.Label1.Visible = False
|
||||
'
|
||||
'txtSchichtstd
|
||||
'
|
||||
Me.txtSchichtstd.BackColor = System.Drawing.Color.White
|
||||
Me.txtSchichtstd.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.txtSchichtstd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.txtSchichtstd.Location = New System.Drawing.Point(194, 117)
|
||||
Me.txtSchichtstd.MaxLength = 1
|
||||
Me.txtSchichtstd.Name = "txtSchichtstd"
|
||||
Me.txtSchichtstd.ReadOnly = True
|
||||
Me.txtSchichtstd.Size = New System.Drawing.Size(38, 13)
|
||||
Me.txtSchichtstd.TabIndex = 99
|
||||
'
|
||||
'UsrcntlAuswertungWocheAuslastung1
|
||||
'
|
||||
Me.UsrcntlAuswertungWocheAuslastung1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||
@@ -1767,6 +1776,7 @@ Partial Class frmDienstplanVariabel
|
||||
CType(Me.dgvUrl_Do, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.tbAuswertung.ResumeLayout(False)
|
||||
Me.tbTagesverteilung.ResumeLayout(False)
|
||||
Me.ContextMenuStrip1.ResumeLayout(False)
|
||||
Me.Panel4.ResumeLayout(False)
|
||||
Me.Panel4.PerformLayout()
|
||||
Me.pnlOptions.ResumeLayout(False)
|
||||
@@ -1905,4 +1915,5 @@ Partial Class frmDienstplanVariabel
|
||||
Friend WithEvents ToolStripMenuSplitschicht As ToolStripMenuItem
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents txtSchichtstd As TextBox
|
||||
Friend WithEvents SchichtLöcshenToolStripMenuItem As ToolStripMenuItem
|
||||
End Class
|
||||
|
||||
@@ -435,6 +435,7 @@ Public Class frmDienstplanVariabel
|
||||
AddHandler menuGanzeWoche.Click, AddressOf GanzeWocheToolStripMenuItem_Click
|
||||
GanzeWocheToolStripMenuItem.DropDownItems.Add(menuGanzeWoche)
|
||||
|
||||
|
||||
Else
|
||||
|
||||
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)}
|
||||
@@ -479,8 +480,9 @@ Public Class frmDienstplanVariabel
|
||||
initDienstplan()
|
||||
setDetails(entryId_TMP)
|
||||
Me.Cursor = Cursors.Default
|
||||
|
||||
End Sub
|
||||
'SCHICHT LÖCSHEN
|
||||
AddHandler SchichtLöcshenToolStripMenuItem.Click, AddressOf SchichtLöcshenToolStripMenuItem_Click
|
||||
|
||||
initAusslastung()
|
||||
|
||||
@@ -504,10 +506,15 @@ Public Class frmDienstplanVariabel
|
||||
Try
|
||||
For Each datagridview As cDienstDGV In DGV
|
||||
Dim d As DataGridView = getDGV(datagridview.dgvName, datagridview.USRCNTL)
|
||||
If datagridview.dgvAbteilung.ToString <> "ABKL" AndAlso datagridview.dgvAbteilung.ToString <> "VORSCH" Then
|
||||
AddHandler d.MouseDown, AddressOf handleDGVContextMenue
|
||||
End If
|
||||
'If datagridview.USRCNTL Is Nothing Then
|
||||
' AddHandler d.LostFocus, AddressOf remHandlerKey
|
||||
'Else
|
||||
' If datagridview.USRCNTL.SCHICHT.dedet_Splitschicht <> True Then
|
||||
' AddHandler d.LostFocus, AddressOf remHandlerKey
|
||||
' End If
|
||||
'End If
|
||||
AddHandler d.LostFocus, AddressOf remHandlerKey
|
||||
AddHandler d.MouseDown, AddressOf handleDGVContextMenue
|
||||
AddHandler d.MouseClick, AddressOf handleDGVClick
|
||||
AddHandler d.CellDoubleClick, AddressOf handleDGVDoubleClick
|
||||
setDGV(d)
|
||||
@@ -845,8 +852,8 @@ Public Class frmDienstplanVariabel
|
||||
usrCntlZeitenAendern1.Location = p
|
||||
End If
|
||||
Dim pt = New Point(thisDgv.Location.X, Panel1.PointToClient(Windows.Forms.Cursor.Position).Y + (row.Height * 0.75))
|
||||
If pt.y + usrCntlZeitenAendern1.Height > Me.Height Then
|
||||
pt.y -= (usrCntlZeitenAendern1.Height + (row.Height * 1.5))
|
||||
If pt.Y + usrCntlZeitenAendern1.Height > Me.Height Then
|
||||
pt.Y -= (usrCntlZeitenAendern1.Height + (row.Height * 1.5))
|
||||
End If
|
||||
usrCntlZeitenAendern1.Location = pt
|
||||
usrCntlZeitenAendern1.Visible = True
|
||||
@@ -891,18 +898,15 @@ Public Class frmDienstplanVariabel
|
||||
Try
|
||||
entryId_TMP = entryId
|
||||
|
||||
Dim row As DataRow = SQLDienst.loadDGV("SELECT dstetr_id, dstma_kuerzel + ' '+ dstetr_info as dstma_kuerzel,dstetr_info,dstma_id, dstetr_von,dstetr_bis,dstetr_art,dstetr_pause,dstetr_datum,dstma_mitId FROM tblDienstplanEintraege, tblDienstMitarb, tblMitarbeiter WHERE dstetr_dstmaId=dstma_id AND mit_id=dstma_mitId AND dstetr_id='" & entryId & "'").Rows(0)
|
||||
Dim row As DataRow = SQLDienst.loadDGV("SELECT dstetr_id, dstma_kuerzel + ' '+ dstetr_info as dstma_kuerzel,dstetr_info,dstma_id, dstetr_von,dstetr_bis,dstetr_art,dstetr_pause,dstetr_datum,dstma_mitId, dstetr_splitschicht FROM tblDienstplanEintraege, tblDienstMitarb, tblMitarbeiter WHERE dstetr_dstmaId=dstma_id AND mit_id=dstma_mitId AND dstetr_id='" & entryId & "'").Rows(0)
|
||||
|
||||
TextBox1.Text = row("dstetr_von").ToString
|
||||
TextBox2.Text = row("dstetr_bis").ToString
|
||||
TextBox3.Text = row("dstetr_info").ToString
|
||||
TextBox4.Text = row("dstetr_pause").ToString
|
||||
isSplitschicht = row("dstetr_splitschicht").ToString
|
||||
|
||||
|
||||
If row("dstetr_art").ToString = "ABKL" Or row("dstetr_art").ToString = "VORSCH" Then
|
||||
isSplitschicht = True
|
||||
Else
|
||||
isSplitschicht = False
|
||||
End If
|
||||
|
||||
Dim tatStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung)
|
||||
Dim schichtStd As Double = SQLDienst.getDstStunden(row("dstma_id").ToString, row("dstetr_datum").ToString, row("dstetr_datum").ToString, niederlassung, True)
|
||||
@@ -1020,7 +1024,7 @@ Public Class frmDienstplanVariabel
|
||||
Next
|
||||
End Sub
|
||||
Private Sub handleDGVContextMenue(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) 'Handles dgvZoll1_Mo.MouseDown
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("DP_Bearbeiten", Me) AndAlso isSplitschicht = False Then
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("DP_Bearbeiten", Me) Then
|
||||
|
||||
Dim thisDgv As DataGridView = DirectCast(sender, DataGridView)
|
||||
Dim ht As DataGridView.HitTestInfo
|
||||
@@ -1051,7 +1055,7 @@ Public Class frmDienstplanVariabel
|
||||
cti.Enabled = False
|
||||
For Each z In s.SCHICHT.ZEITEN
|
||||
'MsgBox(s.schicht_name)
|
||||
' MsgBox(thisDgv.Name & " _ " & getValuesDienstDGV(s, thisDgv.Name, "datum"))
|
||||
'MsgBox(thisDgv.Name & " _ " & getValuesDienstDGV(s, thisDgv.Name, "datum"))
|
||||
If z.dsz_woTag = week(CDate((getValuesDienstDGV(o, thisDgv.Name, "datum"))).DayOfWeek) Then 'Wochentag
|
||||
cti.Enabled = True ' wenn eintrag vorhanden, auswahl möglich
|
||||
End If
|
||||
@@ -1077,6 +1081,19 @@ Public Class frmDienstplanVariabel
|
||||
thisDgv.CurrentCell.Selected = True
|
||||
End If
|
||||
' ctxtDgvSchicht1.Items(0).Text = String.Format("This is the cell at {0}, {1}", ht.ColumnIndex, ht.RowIndex)
|
||||
|
||||
|
||||
If o.SCHICHT.dedet_Splitschicht = True Then
|
||||
thisDgv.ContextMenuStrip = ContextMenuStrip1
|
||||
If thisDgv.SelectedCells.Count = 0 Then
|
||||
thisDgv.CurrentCell = thisDgv(ht.ColumnIndex, ht.RowIndex)
|
||||
thisDgv.CurrentCell.Selected = True
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
Else
|
||||
RemoveHandler DirectCast(sender, DataGridView).KeyDown, AddressOf changeByKey
|
||||
@@ -1110,12 +1127,16 @@ Public Class frmDienstplanVariabel
|
||||
|
||||
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
|
||||
End If
|
||||
|
||||
For Each s In BEN_SCHICHTEN
|
||||
If e.KeyCode.ToString.ToUpper = s.SCHICHT.dedet_hotKey.ToUpper Then
|
||||
' MsgBox("OK")
|
||||
For Each z In s.SCHICHT.ZEITEN
|
||||
If z.dsz_woTag = week(CDate((getValuesDienstDGV(o, dgv.Name, "datum"))).DayOfWeek) Then 'Wochentag
|
||||
If z.dsz_woTag = week(CDate((getValuesDienstDGV(o, dgv.Name, "datum"))).DayOfWeek) AndAlso s.SCHICHT.dedet_Splitschicht = False Then 'Wochentag
|
||||
'Wenn Eintrag gefunden
|
||||
changeDGV(dgv, getDgvByDatArt(getValuesDienstDGV(o, dgv.Name, "datum"), s.schicht_name))
|
||||
Exit Sub
|
||||
@@ -1268,7 +1289,7 @@ Public Class frmDienstplanVariabel
|
||||
eintrag.dstetr_dstmaId = m.dstma_id
|
||||
eintrag.dstetr_datum = datum
|
||||
|
||||
If Not FT.isFeiertag(datum, SETTINGS.dpset_land) Then
|
||||
If Not FT.isFeiertag(datum, IIf(m.dstma_land <> "", m.dstma_land, SETTINGS.dpset_land)) Then
|
||||
If m.dstma_muster Then
|
||||
' MsgBox("HIER")
|
||||
|
||||
@@ -1529,12 +1550,147 @@ Public Class frmDienstplanVariabel
|
||||
End If
|
||||
Dim strFileName As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\tmp\tmp.xlsx"
|
||||
Try
|
||||
|
||||
If DPcontainsSplitschichten() Then
|
||||
|
||||
|
||||
With exclApp
|
||||
|
||||
.Visible = False
|
||||
Datei = .Workbooks.Open(AppDomain.CurrentDomain.BaseDirectory & "Resources\Dienstplan Variabel.xlsx")
|
||||
|
||||
Blatt = Datei.Worksheets("DIENSTPLAN")
|
||||
|
||||
Dim d As Date = CalendarWeek(aktWoche, aktJahr)
|
||||
Blatt.Range("B2").Value = "MONTAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("D2").Value = "DIENSTAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("F2").Value = "MITTWOCH, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("H2").Value = "DONNERSTAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("J2").Value = "FREITAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("L2").Value = "SAMSTAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
Blatt.Range("N2").Value = "SO, " & d.ToString("dd.MMM")
|
||||
|
||||
If SCHICHT.contains("ROT") Then
|
||||
Blatt.Range("A3").Font.Color = Color.Red
|
||||
Blatt.Range("H1").Font.Color = Color.Red
|
||||
Blatt.Range("H1").Value = "ROT"
|
||||
Else
|
||||
Blatt.Range("A3").Font.Color = Color.Blue
|
||||
Blatt.Range("H1").Font.Color = Color.Blue
|
||||
Blatt.Range("H1").Value = "BLAU"
|
||||
End If
|
||||
Blatt.Range("A2").Value = "KW " & aktWoche
|
||||
|
||||
Button4.Text = txt & " (10 %)"
|
||||
|
||||
|
||||
Dim pos As Integer = 0
|
||||
Dim zeilenheader = 1
|
||||
|
||||
'BORDER
|
||||
pos = 14
|
||||
For Each s In BEN_SCHICHTEN
|
||||
If s.SCHICHT.dedet_Hauptsplitschicht = True Then
|
||||
Blatt.Range("A" & pos).Value = s.SCHICHT.dedet_bezeichnungExcel
|
||||
' Blatt.Range("A" & pos).Style= = s.SCHICHT.dedet_bezeichnungExcel
|
||||
Blatt.Range("A" & pos + 1).Value = s.SCHICHT.dedet_bezeichnungExcel2
|
||||
Blatt.Range("A" & pos + 2).Value = s.SCHICHT.dedet_bezeichnungExcel3
|
||||
pos += s.SCHICHT.dedet_ZeilenExcel + zeilenheader
|
||||
End If
|
||||
|
||||
Try
|
||||
' MsgBox("A14:N" & pos - 1)
|
||||
Blatt.Range("A14:N" & pos - 1).BorderAround(Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous, Microsoft.Office.Interop.Excel.XlBorderWeight.xlMedium, Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexAutomatic, Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexAutomatic)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Next
|
||||
|
||||
'Zeilenheader
|
||||
pos = 14
|
||||
For Each s In BEN_SCHICHTEN
|
||||
For Each z In s.SCHICHT.ZEITEN
|
||||
Select Case z.dsz_woTag.ToUpper
|
||||
Case "MO" : Blatt.Range("B" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "DI" : Blatt.Range("D" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "MI" : Blatt.Range("F" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "DO" : Blatt.Range("H" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "FR" : Blatt.Range("J" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "SA" : Blatt.Range("L" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
Case "SO" : Blatt.Range("N" & pos).Value = " " & z.dsz_von & " - " & z.dsz_bis & " Uhr"
|
||||
End Select
|
||||
Next
|
||||
Blatt.Range("B" & pos & ":N" & pos).Interior.Color = Color.FromArgb(197, 217, 241)
|
||||
pos += s.SCHICHT.dedet_ZeilenExcel + zeilenheader
|
||||
Next
|
||||
|
||||
'MONTAG
|
||||
pos = 15
|
||||
For Each s In BEN_SCHICHTEN
|
||||
If s.SCHICHT.dedet_Hauptsplitschicht = True Then
|
||||
Dim z = s.SCHICHT.dedet_ZeilenExcel
|
||||
Dim Tag(z * 2 - 1) As String
|
||||
|
||||
For i = 0 To z - 1 : Tag(i) = "B" & i + pos : Next
|
||||
For i = 0 To z - 1 : Tag(i + z) = "C" & i + pos : Next
|
||||
|
||||
Blatt = fill(s.dgv_Mo, Tag, Blatt, "MO", s.SCHICHT)
|
||||
pos += z + zeilenheader
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Dim Zeile_ZA As Integer = 45
|
||||
Dim Zeile_URL As Integer = 47
|
||||
Dim Zeile_SO As Integer = 53
|
||||
Dim Zeile_KS As Integer = 55
|
||||
|
||||
Dim ZAMo(4) As String
|
||||
For i = 0 To 1 : ZAMo(i) = "B" & i + Zeile_ZA : Next
|
||||
For i = 0 To 1 : ZAMo(i + 2) = "C" & i + Zeile_ZA : Next
|
||||
|
||||
Dim UrlMo(8) As String
|
||||
For i = 0 To 3 : UrlMo(i) = "B" & i + Zeile_URL : Next
|
||||
For i = 0 To 3 : UrlMo(i + 4) = "C" & i + Zeile_URL : Next
|
||||
|
||||
Dim SOMo(4) As String
|
||||
For i = 0 To 1 : SOMo(i) = "B" & i + Zeile_SO : Next
|
||||
For i = 0 To 1 : SOMo(i + 2) = "C" & i + Zeile_SO : Next
|
||||
|
||||
Dim KSMo(6) As String
|
||||
For i = 0 To 2 : KSMo(i) = "B" & i + Zeile_KS : Next
|
||||
For i = 0 To 2 : KSMo(i + 3) = "C" & i + Zeile_KS : Next
|
||||
|
||||
|
||||
Blatt = fill(dgvZA_Mo, ZAMo, Blatt)
|
||||
Blatt = fill(dgvUrl_Mo, UrlMo, Blatt)
|
||||
Blatt = fill(dgvDR_Mo, SOMo, Blatt)
|
||||
Blatt = fill(dgvKS_Mo, KSMo, Blatt)
|
||||
|
||||
Button4.Text = txt & " (25 %)"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Button4.Text = txt & " (100 %)"
|
||||
|
||||
.Visible = True
|
||||
.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
|
||||
Try : Datei.SaveAs(strFileName) : Catch : End Try
|
||||
|
||||
End With
|
||||
|
||||
|
||||
|
||||
Else
|
||||
|
||||
|
||||
With exclApp
|
||||
.Visible = False
|
||||
Datei = .Workbooks.Open(AppDomain.CurrentDomain.BaseDirectory & "Resources\Dienstplan Variabel.xlsx")
|
||||
|
||||
Blatt = Datei.Worksheets("DIENSTPLAN")
|
||||
|
||||
Dim d As Date = CalendarWeek(aktWoche, aktJahr)
|
||||
Blatt.Range("B2").Value = "MONTAG, " & d.ToString("dd.MMM") : d = d.AddDays(1)
|
||||
@@ -1871,6 +2027,8 @@ Public Class frmDienstplanVariabel
|
||||
|
||||
End With
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("ERRDP 7: " & ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
@@ -1915,6 +2073,43 @@ Public Class frmDienstplanVariabel
|
||||
Return Blatt
|
||||
End Function
|
||||
|
||||
Function fillNew(dgv As DataGridView, s() As String, Blatt As Excel.Worksheet, Optional dayOweek As String = "", Optional SCHICHT As cDienstplanSchicht = Nothing) As Excel.Worksheet
|
||||
|
||||
With dgv
|
||||
If .RowCount > 0 Then
|
||||
Dim bg As Object = getBGFormSchichtSchichtArt(dayOweek, SCHICHT)
|
||||
If bg IsNot Nothing Then Blatt.Range(s(0), s(s.Length - 1)).Interior.Color = ColorTranslator.FromHtml(bg)
|
||||
|
||||
Dim cnt As Integer = 0
|
||||
For i = 0 To .RowCount - 1
|
||||
Dim r As DataGridViewRow = .Rows(i)
|
||||
MsgBox("DGV: " & dgv.Name & " RAGNE: " & s(i) & " VALUE: " & r.Cells(1).Value)
|
||||
Try
|
||||
If r.Cells(1).Style.ForeColor <> Color.Black Then Blatt.Range(s(i)).Font.Color = ColorTranslator.FromHtml(r.Cells(9).Value)
|
||||
Catch : End Try
|
||||
Try : Blatt.Range(s(i)).Value = r.Cells(1).Value : Catch : End Try
|
||||
If dayOweek = "SO" Then
|
||||
Try : Blatt.Range(s(i)).Font.Color = Color.Red : Catch : End Try
|
||||
End If
|
||||
|
||||
If i = 0 And (SCHICHT IsNot Nothing AndAlso SCHICHT.dedet_bezLeiter <> "") Then '(dgv.Name.Contains("Zoll1") Or dgv.Name.Contains("Zoll2")) Then
|
||||
Blatt.Range(s(i)).Value = Blatt.Range(s(i)).Value & " (" & SCHICHT.dedet_bezLeiter & ")"
|
||||
Dim start As Integer = Blatt.Range(s(i)).Value.ToString.Length - SCHICHT.dedet_bezLeiter.Length
|
||||
Blatt.Range(s(i)).Characters(Start:=start, Length:=SCHICHT.dedet_bezLeiter.Length).Font.Color = Color.Red
|
||||
End If
|
||||
'KASSE färblich
|
||||
If r.Cells(1).Value.ToString.EndsWith("(KASSE)") Then
|
||||
Dim start As Integer = Blatt.Range(s(i)).Value.ToString.Length - 5
|
||||
Blatt.Range(s(i)).Characters(Start:=start, Length:=5).Font.Color = Color.Red
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End With
|
||||
|
||||
Return Blatt
|
||||
End Function
|
||||
|
||||
Public Function getBGFormSchichtSchichtArt(dayOweek As String, Schicht_Tmp As cDienstplanSchicht) As Object
|
||||
If Schicht_Tmp IsNot Nothing Then
|
||||
If Schicht_Tmp.dedet_TagesWechsel Then
|
||||
@@ -2035,15 +2230,14 @@ Public Class frmDienstplanVariabel
|
||||
eintrag.dstetr_splitschicht = s.SCHICHT.dedet_Splitschicht
|
||||
eintrag.dstetr_hauptsplitschicht = s.SCHICHT.dedet_Hauptsplitschicht
|
||||
|
||||
Dim timeVontempDGV = getDefaultTimeBySchicht(vorherigeAbt, "von", datum.ToString("ddd", New CultureInfo("de-DE")).Replace(".", "").ToUpper)
|
||||
Dim timeBistempDGV = getDefaultTimeBySchicht(vorherigeAbt, "bis", datum.ToString("ddd", New CultureInfo("de-DE")).Replace(".", "").ToUpper)
|
||||
|
||||
Dim timeVontempDGV = getDgvByDatArt(getValuesDienstDGV(o, dgv_tmp.Name, "datum"), vorherigeAbt).CurrentRow.Cells("dstetr_von").Value
|
||||
Dim timeBistempDGV = getDgvByDatArt(getValuesDienstDGV(o, dgv_tmp.Name, "datum"), vorherigeAbt).CurrentRow.Cells("dstetr_bis").Value
|
||||
|
||||
Dim timeVon = getDefaultTimeBySchicht(abtSplitschicht, "von", datum.ToString("ddd", New CultureInfo("de-DE")).Replace(".", "").ToUpper)
|
||||
Dim timeBis = getDefaultTimeBySchicht(abtSplitschicht, "bis", datum.ToString("ddd", New CultureInfo("de-DE")).Replace(".", "").ToUpper)
|
||||
|
||||
|
||||
If checkUeberschneidungen(timeVontempDGV, timeVon) Or checkUeberschneidungen(timeBis, timeBistempDGV) Then
|
||||
If Not (checkUeberschneidungen(timeVon, timeVontempDGV) And checkUeberschneidungen(timeBis, timeVontempDGV) Xor checkUeberschneidungen(timeBistempDGV, timeVon) And checkUeberschneidungen(timeBistempDGV, timeBis)) Then
|
||||
If vbNo = MsgBox("ACHTUNG!" & vbCrLf & "Die Zeiten der Schicht " & s.schicht_name & " (" & timeVon & " - " & timeBis & ")" & vbCrLf & "überschneiden sich mit der Stammschicht " & vorherigeAbt & " (" & timeVontempDGV & " - " & timeBistempDGV & ")" & vbCrLf & "Trotzdem speichern?", vbYesNo) Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -2053,6 +2247,19 @@ Public Class frmDienstplanVariabel
|
||||
eintrag.dstetr_von = timeVon
|
||||
eintrag.dstetr_bis = timeBis
|
||||
|
||||
|
||||
If timeVon.Contains(":00") And timeBis.Contains(":00") Then
|
||||
eintrag.dstetr_info = timeVon.Replace(":00", "") & "-" & timeBis.Replace(":00", "") & "h"
|
||||
Else
|
||||
eintrag.dstetr_info = timeVon & "-" & timeBis
|
||||
End If
|
||||
|
||||
If SQLDienst.getCountEntrys(eintrag.dstetr_dstmaId, datum, datum, True, eintrag.dstetr_art) > 0 Then
|
||||
If vbYes = MsgBox("ACHTUNG!" & vbCrLf & "Es gibt bereits einen Eintrag für diesen Mitarbeiter für " & s.schicht_name & " am " & datum & vbCrLf & "Trotzdem anlegen?", vbYesNo) Then
|
||||
Dim latestDienstplanEintragNr = SQLDienst.getLatestDienstplanEintraegNr() + 1
|
||||
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung, SQLDienst.getLatestDienstplanEintraegNr())
|
||||
End If
|
||||
End If
|
||||
SQLDienst.updateInsertByDienstEintrag(eintrag, niederlassung)
|
||||
|
||||
Next
|
||||
@@ -2105,9 +2312,6 @@ Public Class frmDienstplanVariabel
|
||||
'Wenn hier drin, dann gibt es an dem Tag den bezogenen Schichteintrag
|
||||
For Each id In ids
|
||||
'Eintrag wird für alle IDs geändert
|
||||
If s.SCHICHT.dedet_Splitschicht Then
|
||||
MsgBox(s.schicht_name)
|
||||
End If
|
||||
SQLDienst.updateDienstEintragArtChangeByDstMaId(id, datumtmp, s.schicht_name, sz.dsz_von, sz.dsz_bis, "", sz.dsz_pause)
|
||||
Next
|
||||
End If
|
||||
@@ -2129,6 +2333,7 @@ Public Class frmDienstplanVariabel
|
||||
changeDGV(dgv_tmp, getDgvByDatArt(datumtmp, "FREI"))
|
||||
Next
|
||||
Case "ctiDienstreise"
|
||||
|
||||
For i = 0 To 6
|
||||
changeDGV(dgv_tmp, getDgvByDatArt(datumtmp, "DR"))
|
||||
Next
|
||||
@@ -2145,6 +2350,8 @@ Public Class frmDienstplanVariabel
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
' Sub changeDGVToDBL(dgv_sender As DataGridView)
|
||||
' Me.Cursor = Cursors.WaitCursor
|
||||
' Try
|
||||
@@ -2276,10 +2483,13 @@ Public Class frmDienstplanVariabel
|
||||
|
||||
SQLDienst.updateDienstEintragArtChange(r.Cells(0).Value, datum.ToShortDateString, abt, von, bis, pause)
|
||||
|
||||
If r.Cells("dstetr_hauptsplitschicht").Value AndAlso SQLDienst.getCountEntrys(r.Cells("dstma_id").Value, datum, datum, True) AndAlso
|
||||
If r.Cells("dstetr_hauptsplitschicht").Value Then
|
||||
If SQLDienst.getCountEntrys(r.Cells("dstma_id").Value, datum, datum, True) AndAlso
|
||||
(abt = "URL" Or abt = "DR" Or abt = "FREI" Or abt = "QS" Or abt = "KS" Or abt = "ZA") Then
|
||||
deleteSplitschichten(r.Cells("dstma_id").Value, datum, r.Cells(1).Value)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If abt.Contains("ZOLL") Or abt = "QS" And r.Cells("dstma_arbvh").Value = "TZ" Then
|
||||
checkMaTageIfTeilzeit(r.Cells("dstma_id").Value)
|
||||
@@ -2784,4 +2994,29 @@ Public Class frmDienstplanVariabel
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SchichtLöcshenToolStripMenuItem_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
If vbYes = MsgBox("Möchten Sie die Splitschicht wirklich löschen?", vbYesNo) Then
|
||||
SQLDienst.delDstEintraegeSplitschichtenId(entryId_TMP)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler beim Löschen des Eintrages.")
|
||||
End Try
|
||||
initDienstplan()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function DPcontainsSplitschichten() As Boolean
|
||||
For Each s In BEN_SCHICHTEN
|
||||
If s.SCHICHT.dedet_Splitschicht Then Return True
|
||||
|
||||
Next
|
||||
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
25
UID/Dienstplan/frmDiestAddMa.Designer.vb
generated
25
UID/Dienstplan/frmDiestAddMa.Designer.vb
generated
@@ -279,6 +279,8 @@ Partial Class frmDiestAddMa
|
||||
Me.Label57 = New System.Windows.Forms.Label()
|
||||
Me.txtStdFeiertagTZ = New System.Windows.Forms.TextBox()
|
||||
Me.Label58 = New System.Windows.Forms.Label()
|
||||
Me.lblLand = New System.Windows.Forms.Label()
|
||||
Me.cboLand = New System.Windows.Forms.ComboBox()
|
||||
Me.grpTeilzeit.SuspendLayout()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
Me.TabPage1.SuspendLayout()
|
||||
@@ -2839,12 +2841,33 @@ Partial Class frmDiestAddMa
|
||||
Me.Label58.TabIndex = 27
|
||||
Me.Label58.Text = "Abweichende WochenStd.:"
|
||||
'
|
||||
'lblLand
|
||||
'
|
||||
Me.lblLand.AutoSize = True
|
||||
Me.lblLand.Location = New System.Drawing.Point(411, 63)
|
||||
Me.lblLand.Name = "lblLand"
|
||||
Me.lblLand.Size = New System.Drawing.Size(66, 13)
|
||||
Me.lblLand.TabIndex = 28
|
||||
Me.lblLand.Text = "Land-Kürzel:"
|
||||
'
|
||||
'cboLand
|
||||
'
|
||||
Me.cboLand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.cboLand.FormattingEnabled = True
|
||||
Me.cboLand.Items.AddRange(New Object() {"", "ZOLL 1", "ZOLL 2", "ZOLL TAG", "QS"})
|
||||
Me.cboLand.Location = New System.Drawing.Point(408, 79)
|
||||
Me.cboLand.Name = "cboLand"
|
||||
Me.cboLand.Size = New System.Drawing.Size(72, 21)
|
||||
Me.cboLand.TabIndex = 29
|
||||
'
|
||||
'frmDiestAddMa
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.ClientSize = New System.Drawing.Size(503, 626)
|
||||
Me.Controls.Add(Me.cboLand)
|
||||
Me.Controls.Add(Me.lblLand)
|
||||
Me.Controls.Add(Me.Label58)
|
||||
Me.Controls.Add(Me.dgvAbwWStd)
|
||||
Me.Controls.Add(Me.Label57)
|
||||
@@ -3151,4 +3174,6 @@ Partial Class frmDiestAddMa
|
||||
Friend WithEvents txtStdFeiertagTZ As TextBox
|
||||
Friend WithEvents dgvAbwWStd As VERAG_PROG_ALLGEMEIN.MyDatagridview
|
||||
Friend WithEvents Label58 As Label
|
||||
Friend WithEvents lblLand As Label
|
||||
Friend WithEvents cboLand As ComboBox
|
||||
End Class
|
||||
|
||||
@@ -55,6 +55,10 @@ Public Class frmDiestAddMa
|
||||
cboFunktion.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Ferialpraktikant", "Ferialpraktikant"))
|
||||
cboFunktion.SelectedIndex = 0
|
||||
|
||||
cboLand.Items.Clear()
|
||||
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("AT", "AT"))
|
||||
cboLand.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("DE", "DE"))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -107,6 +111,11 @@ Public Class frmDiestAddMa
|
||||
' MsgBox(txtRotVonMo.Text)
|
||||
MusterErr = False
|
||||
If checkValues() Then
|
||||
If cboLand.Text = "" Then
|
||||
MsgBox("Bitte das Land eintragen")
|
||||
cboLand.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
If initMA() Then
|
||||
Dim tz As List(Of cDienstTeilzeit) = initArbVerh()
|
||||
If MusterErr Then MsgBox("Bei der Prüfung der Daten für die Muster-Vorlage ist ein Fehler aufgetreten! Bitte um Prüfung!") : Exit Sub
|
||||
@@ -375,11 +384,13 @@ Public Class frmDiestAddMa
|
||||
cboMyItemSelect(cboAbt, MA.dstma_abteilung)
|
||||
cboMyItemSelect(cboFunktion, MA.dstma_funktion)
|
||||
cboMyItemSelect(cboArbVerh, MA.dstma_arbvh)
|
||||
cboMyItemSelect(cboLand, MA.dstma_land)
|
||||
|
||||
txtWoStd.Text = MA.dstma_wochenStunden
|
||||
cboStammSchicht.Text = MA.dstma_stammSchicht
|
||||
txtKuerzel.Text = MA.dstma_kuerzel
|
||||
txtReihenfolge.Text = MA.dstma_reihenfolge
|
||||
'cboLand.Text = MA.dstma_land
|
||||
Button1.BackColor = ColorTranslator.FromHtml(MA.dstma_farbe)
|
||||
|
||||
If MA.dstma_TageProWoche >= 0 Then
|
||||
@@ -628,6 +639,7 @@ Public Class frmDiestAddMa
|
||||
MA.dstma_inaktiv = cbxInaktiv.Checked
|
||||
MA.dstma_4wo = cbx4WoRhythmus.Checked
|
||||
MA.dstma_TzFeiertageStd = Nothing
|
||||
MA.dstma_land = CType(cboLand.SelectedItem, VERAG_PROG_ALLGEMEIN.MyListItem).Value
|
||||
If IsNumeric(txtStdFeiertagTZ.Text) And txtStdFeiertagTZ.Visible Then MA.dstma_TzFeiertageStd = txtStdFeiertagTZ.Text
|
||||
|
||||
If IsNumeric(cboDaysPerWeek.Text) Then
|
||||
@@ -643,6 +655,7 @@ Public Class frmDiestAddMa
|
||||
End Function
|
||||
Private Sub cboMA_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboMA.SelectedIndexChanged
|
||||
' Dim oItem As VERAG_PROG_ALLGEMEIN.MyListItem = CType(cboMA.SelectedItem, VERAG_PROG_ALLGEMEIN.MyListItem)
|
||||
|
||||
End Sub
|
||||
|
||||
Function cboMyItemSelect(cbo As ComboBox, value As String) As Boolean
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Windows
|
||||
Imports Hardcodet.Wpf.TaskbarNotification.Interop
|
||||
|
||||
Public Class frmSchichtenZeiten
|
||||
Dim ADMIN As New cOptionenDAL
|
||||
@@ -200,12 +201,18 @@ Public Class frmSchichtenZeiten
|
||||
|
||||
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn.Click
|
||||
|
||||
MsgBox("Funktion noch nicht verfügbar!")
|
||||
|
||||
'dgvSchihten.AllowUserToAddRows = True
|
||||
'Dim row As New DataGridViewRow
|
||||
'dgvSchihten.Rows.Add()
|
||||
Dim input = InputBox("Bitte geben Sie die Bezeichnung der neuen Schicht ein:", "Schicht anlegen")
|
||||
If input <> "" Then
|
||||
If checkNameIsValid(input) Then
|
||||
DP.insertEintraegeDetails(input, niederlassung, True)
|
||||
initSchichten()
|
||||
Else
|
||||
MsgBox("Für die Niederlassung" & niederlassung.ToString & " existiert bereits eine Schicht " & input)
|
||||
End If
|
||||
|
||||
Else
|
||||
MsgBox("Keine Bezeichnung angegeben!")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -264,4 +271,22 @@ Public Class frmSchichtenZeiten
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function checkNameIsValid(name As String) As Boolean
|
||||
|
||||
If dgvSchihten.Rows.Count = 0 Then Return True
|
||||
|
||||
For Each row As DataGridViewRow In dgvSchihten.Rows
|
||||
If Not IsDBNull(row.Cells("dedet_info").Value) Then
|
||||
If row.Cells("dedet_info").Value.ToLower = name.ToLower Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -382,7 +382,7 @@ Public Class usrCntlDienstplan
|
||||
End Select
|
||||
|
||||
rpt.txtTag.ForeColor = Color.Black
|
||||
If FT.isFeiertag(datumKW, cDienstSettings.getLand(niederlassung)) Or datumKW.ToString("dd.MM.") = "31.12." Or datumKW.ToString("dd.MM.") = "24.12." Or datumKW.DayOfWeek = 0 Then 'Feiertag oder 1/2 Tag
|
||||
If FT.isFeiertag(datumKW, IIf(MA_DST.dstma_land <> "", MA_DST.dstma_land, cDienstSettings.getLand(niederlassung))) Or datumKW.ToString("dd.MM.") = "31.12." Or datumKW.ToString("dd.MM.") = "24.12." Or datumKW.DayOfWeek = 0 Then 'Feiertag oder 1/2 Tag
|
||||
rpt.txtTag.ForeColor = Color.Red
|
||||
rpt.Detail.BackColor = Color.FromArgb(220, 220, 220)
|
||||
End If
|
||||
|
||||
@@ -85,6 +85,7 @@ End Class
|
||||
Public Class cDienstMA
|
||||
Property dstma_id As Integer
|
||||
Property dstma_mitId As Integer
|
||||
Property dstma_land As String = ""
|
||||
Property dstma_abteilung As String = ""
|
||||
Property dstma_funktion As String = ""
|
||||
Property dstma_arbvh As String = ""
|
||||
@@ -96,7 +97,6 @@ Public Class cDienstMA
|
||||
Property dstma_muster As Boolean = False
|
||||
Property dstma_WEStdRegelAZ As Boolean = False
|
||||
Property dstma_4wo As Boolean = False
|
||||
|
||||
Property dstma_TageProWoche As Integer = -1
|
||||
Property dstma_inaktiv As Boolean = False
|
||||
Property dstma_TzFeiertageStd As Object = Nothing
|
||||
|
||||
@@ -915,11 +915,14 @@ Public Class cProgramFunctions
|
||||
|
||||
Dim UrlStd As Double = 8
|
||||
If StdFeiertag IsNot Nothing Then UrlStd = StdFeiertag
|
||||
Dim dMa As cDienstMA = SQLDienst.getDstMAByDstMaId(dstma_id)
|
||||
|
||||
For i = 0 To 6
|
||||
' Wochenstunden -= getWochenstundenTAG(datum, SCHICHT, dstma_id, dstma_muster, dstma_WEStdRegelAZ, dstma_arbvh, niederlassung)
|
||||
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(datum.Year)
|
||||
If FT.isFeiertag(datum, cDienstSettings.getLand(niederlassung)) Or datum.ToString("dd.MM.") = "31.12." Or datum.ToString("dd.MM.") = "24.12." Then 'Feiertag oder 1/2 Tag
|
||||
|
||||
|
||||
If FT.isFeiertag(datum, IIf(dMa.dstma_land <> "", dMa.dstma_land, cDienstSettings.getLand(niederlassung))) Or datum.ToString("dd.MM.") = "31.12." Or datum.ToString("dd.MM.") = "24.12." Then 'Feiertag oder 1/2 Tag
|
||||
Dim woTag = datum.ToString("ddd", New CultureInfo("de-DE")).ToUpper
|
||||
|
||||
If dstma_muster Then 'Wenn Muster, dann muss Feiertag bei VZ und TZ berüchsichtigt werden....
|
||||
@@ -976,7 +979,8 @@ Public Class cProgramFunctions
|
||||
|
||||
Dim FT As New VERAG_PROG_ALLGEMEIN.cFeiertage(datum.Year)
|
||||
Dim woTag = datum.ToString("ddd", New CultureInfo("de-DE")).ToUpper
|
||||
If FT.isFeiertag(datum, cDienstSettings.getLand(niederlassung)) Then 'Feiertag oder 1/2 Tag
|
||||
Dim dMa As cDienstMA = SQLDienst.getDstMAByDstMaId(dstma_id)
|
||||
If FT.isFeiertag(datum, IIf(dMa.dstma_land <> "", dMa.dstma_land, cDienstSettings.getLand(niederlassung))) Then 'Feiertag oder 1/2 Tag
|
||||
getWochenstundenTAG = 0
|
||||
ElseIf woTag = "SA" And woTag = "SO" Then
|
||||
getWochenstundenTAG = 0
|
||||
|
||||
110
UID/cSqlDb.vb
110
UID/cSqlDb.vb
@@ -1967,14 +1967,14 @@ Public Class cDienstplan
|
||||
" if exists (select * from tblDienstMitarb with (updlock,serializable) where dstma_id = @dstma_id ) " &
|
||||
" begin " &
|
||||
" UPDATE tblDienstMitarb " &
|
||||
" SET dstma_abteilung=@dstma_abteilung, dstma_funktion=@dstma_funktion, dstma_arbvh=@dstma_arbvh, dstma_wochenStunden=@dstma_wochenStunden, dstma_stammSchicht=@dstma_stammSchicht, dstma_kuerzel=@dstma_kuerzel, dstma_reihenfolge=@dstma_reihenfolge, dstma_farbe=@dstma_farbe, dstma_TageProWoche=@dstma_TageProWoche,dstma_niederlassung=@dstma_niederlassung,dstma_muster=@dstma_muster,dstma_4wo=@dstma_4wo,dstma_WEStdRegelAZ=@dstma_WEStdRegelAZ,dstma_inaktiv=@dstma_inaktiv,dstma_TzFeiertageStd=@dstma_TzFeiertageStd " &
|
||||
" SET dstma_abteilung=@dstma_abteilung, dstma_funktion=@dstma_funktion, dstma_arbvh=@dstma_arbvh, dstma_wochenStunden=@dstma_wochenStunden, dstma_stammSchicht=@dstma_stammSchicht, dstma_kuerzel=@dstma_kuerzel, dstma_reihenfolge=@dstma_reihenfolge, dstma_farbe=@dstma_farbe, dstma_TageProWoche=@dstma_TageProWoche,dstma_niederlassung=@dstma_niederlassung,dstma_muster=@dstma_muster,dstma_4wo=@dstma_4wo,dstma_WEStdRegelAZ=@dstma_WEStdRegelAZ,dstma_inaktiv=@dstma_inaktiv,dstma_TzFeiertageStd=@dstma_TzFeiertageStd, dstma_land=@dstma_land " &
|
||||
" WHERE dstma_id=@dstma_id " &
|
||||
" End " &
|
||||
" Else " &
|
||||
" begin " &
|
||||
"INSERT INTO tblDienstMitarb " &
|
||||
"( dstma_mitId, dstma_abteilung, dstma_funktion, dstma_arbvh, dstma_wochenStunden, dstma_stammSchicht,dstma_kuerzel,dstma_reihenfolge,dstma_farbe,dstma_TageProWoche,dstma_niederlassung, dstma_muster,dstma_4wo,dstma_WEStdRegelAZ,dstma_inaktiv ,dstma_TzFeiertageStd) VALUES " &
|
||||
"( @dstma_mitId, @dstma_abteilung, @dstma_funktion, @dstma_arbvh, @dstma_wochenStunden, @dstma_stammSchicht,@dstma_kuerzel,@dstma_reihenfolge,@dstma_farbe,@dstma_TageProWoche,@dstma_niederlassung, @dstma_muster ,@dstma_4wo,@dstma_WEStdRegelAZ,@dstma_inaktiv,@dstma_TzFeiertageStd) " &
|
||||
"( dstma_mitId, dstma_abteilung, dstma_funktion, dstma_arbvh, dstma_wochenStunden, dstma_stammSchicht,dstma_kuerzel,dstma_reihenfolge,dstma_farbe,dstma_TageProWoche,dstma_niederlassung, dstma_muster,dstma_4wo,dstma_WEStdRegelAZ,dstma_inaktiv ,dstma_TzFeiertageStd, dstma_land) VALUES " &
|
||||
"( @dstma_mitId, @dstma_abteilung, @dstma_funktion, @dstma_arbvh, @dstma_wochenStunden, @dstma_stammSchicht,@dstma_kuerzel,@dstma_reihenfolge,@dstma_farbe,@dstma_TageProWoche,@dstma_niederlassung, @dstma_muster ,@dstma_4wo,@dstma_WEStdRegelAZ,@dstma_inaktiv,@dstma_TzFeiertageStd, @dstma_land) " &
|
||||
" End " &
|
||||
" commit tran "
|
||||
|
||||
@@ -1998,6 +1998,7 @@ Public Class cDienstplan
|
||||
cmd.Parameters.AddWithValue("@dstma_WEStdRegelAZ", ma.dstma_WEStdRegelAZ)
|
||||
cmd.Parameters.AddWithValue("@dstma_inaktiv", ma.dstma_inaktiv)
|
||||
cmd.Parameters.AddWithValue("@dstma_TzFeiertageStd", If(ma.dstma_TzFeiertageStd Is Nothing, DBNull.Value, ma.dstma_TzFeiertageStd))
|
||||
cmd.Parameters.AddWithValue("@dstma_land", ma.dstma_land)
|
||||
|
||||
Try
|
||||
cmd.ExecuteNonQuery()
|
||||
@@ -3006,6 +3007,32 @@ Public Class cDienstplan
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function insertEintraegeDetails(dedet_info, dedet_niederlassung, dedet_aktiv) As Boolean
|
||||
|
||||
Dim sql As String = "INSERT INTO [tblDienstplanEintraegeDetails] " &
|
||||
"(dedet_info, dedet_niederlassung, dedet_aktiv ) VALUES " &
|
||||
"(@dedet_info, @dedet_niederlassung, @dedet_aktiv) "
|
||||
|
||||
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
Using cmd As New SqlCommand(sql, conn)
|
||||
|
||||
cmd.Parameters.AddWithValue("@dedet_info", dedet_info)
|
||||
cmd.Parameters.AddWithValue("@dedet_niederlassung", dedet_niederlassung)
|
||||
cmd.Parameters.AddWithValue("@dedet_aktiv", dedet_aktiv)
|
||||
|
||||
Try
|
||||
cmd.ExecuteNonQuery()
|
||||
Return True
|
||||
Catch ex As SqlException
|
||||
MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Datensatz kann nicht gespeichert werden!" & vbCrLf & vbCrLf & ex.Message, vbExclamation, "Fehler beim Speichern Data")
|
||||
End Try
|
||||
End Using
|
||||
End Using
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function updateEintraegeDetails_Benuterdef(dedet_id, dedet_bezeichnungDP, dedet_ProzentGrafik, dedet_bezeichnungExcel, dedet_bezeichnungExcel2, dedet_bezeichnungExcel3, dedet_ZeilenExcel, dedet_benutzerdefinierteSchicht, dedet_stdWieArbeitszeit, dedet_reihenfolge, dedet_TagesWechsel, dedet_WechselZuSchicht, dedet_HotKey, dedet_bgAlternativeFarbe, dedet_ExcelBgFarbe, dedet_bezLeiter, dedet_ExcelMonatFarbe, dedet_ExcelMonatBezeichnung, dedet_aktiv, dedet_splitschicht, dedet_hauptsplitschicht) As Boolean
|
||||
Dim hAuswahl As String = ""
|
||||
@@ -3030,7 +3057,6 @@ Public Class cDienstplan
|
||||
cmd.Parameters.AddWithValue("@dedet_ZeilenExcel", dedet_ZeilenExcel)
|
||||
cmd.Parameters.AddWithValue("@dedet_benutzerdefinierteSchicht", dedet_benutzerdefinierteSchicht)
|
||||
cmd.Parameters.AddWithValue("@dedet_stdWieArbeitszeit", dedet_stdWieArbeitszeit)
|
||||
|
||||
cmd.Parameters.AddWithValue("@dedet_reihenfolge", dedet_reihenfolge)
|
||||
cmd.Parameters.AddWithValue("@dedet_TagesWechsel", dedet_TagesWechsel)
|
||||
cmd.Parameters.AddWithValue("@dedet_WechselZuSchicht", dedet_WechselZuSchicht)
|
||||
@@ -3158,6 +3184,7 @@ Public Class cDienstplan
|
||||
d.dstma_muster = dr.Item("dstma_muster")
|
||||
d.dstma_4wo = dr.Item("dstma_4wo")
|
||||
d.dstma_WEStdRegelAZ = dr.Item("dstma_WEStdRegelAZ")
|
||||
d.dstma_land = dr.Item("dstma_land")
|
||||
|
||||
|
||||
If Not dr.Item("dstma_TageProWoche") Is DBNull.Value Then d.dstma_TageProWoche = dr.Item("dstma_TageProWoche")
|
||||
@@ -3439,7 +3466,7 @@ Public Class cDienstplan
|
||||
Try
|
||||
Dim d As New cDienstMA
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
Using cmd As New SqlCommand(" SELECT dstma_id,dstma_mitId,dstma_kuerzel, dstma_abteilung,dstma_funktion,dstma_arbvh,dstma_wochenStunden,dstma_stammSchicht,dstma_reihenfolge,dstma_farbe,dstma_TageProWoche,dstma_muster,dstma_4wo,dstma_WEStdRegelAZ,dstma_inaktiv,dstma_TzFeiertageStd FROM tblDienstMitarb INNER JOIN tblMitarbeiter ON mit_id=dstma_mitId WHERE dstma_id=" & maId & " ", conn)
|
||||
Using cmd As New SqlCommand(" SELECT dstma_id,dstma_mitId,dstma_kuerzel, dstma_abteilung,dstma_funktion,dstma_arbvh,dstma_wochenStunden,dstma_stammSchicht,dstma_reihenfolge,dstma_farbe,dstma_TageProWoche,dstma_muster,dstma_4wo,dstma_WEStdRegelAZ,dstma_inaktiv,dstma_TzFeiertageStd, dstma_land FROM tblDienstMitarb INNER JOIN tblMitarbeiter ON mit_id=dstma_mitId WHERE dstma_id=" & maId & " ", conn)
|
||||
'cmd.Parameters.AddWithValue("@semi_id", id)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
While dr.Read
|
||||
@@ -3455,6 +3482,7 @@ Public Class cDienstplan
|
||||
d.dstma_muster = dr.Item("dstma_muster")
|
||||
d.dstma_4wo = dr.Item("dstma_4wo")
|
||||
d.dstma_WEStdRegelAZ = dr.Item("dstma_WEStdRegelAZ")
|
||||
d.dstma_land = dr.Item("dstma_land")
|
||||
|
||||
If Not dr.Item("dstma_TageProWoche") Is DBNull.Value Then d.dstma_TageProWoche = dr.Item("dstma_TageProWoche")
|
||||
|
||||
@@ -3559,13 +3587,16 @@ Public Class cDienstplan
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function delOnlyDstEintraegeSplitschichtenMaId(datum, niederlassung, dstetr_dstmaId) As Boolean
|
||||
Public Function delOnlyDstEintraegeSplitschichtenMaId(datum, niederlassung, dstetr_dstmaId, Optional dstetr_id = -1) As Boolean
|
||||
|
||||
|
||||
Dim sql = "DELETE FROM tblDienstplanEintraege " &
|
||||
"WHERE dstetr_niederlassung= '" & niederlassung & "' AND dstetr_datum = @datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_splitschicht = 1"
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
Using cmd As New SqlCommand(sql, conn)
|
||||
cmd.Parameters.AddWithValue("@datum", datum)
|
||||
cmd.Parameters.AddWithValue("@dstetr_dstmaId", dstetr_dstmaId)
|
||||
cmd.Parameters.AddWithValue("@dstetr_id", dstetr_id)
|
||||
Try
|
||||
cmd.ExecuteNonQuery()
|
||||
Return True
|
||||
@@ -3578,6 +3609,26 @@ Public Class cDienstplan
|
||||
End Function
|
||||
|
||||
|
||||
Public Function delDstEintraegeSplitschichtenId(dstetr_id) As Boolean
|
||||
|
||||
Dim sql = "DELETE FROM tblDienstplanEintraege " &
|
||||
"WHERE dstetr_id = @dstetr_id AND dstetr_splitschicht = 1"
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
Using cmd As New SqlCommand(sql, conn)
|
||||
cmd.Parameters.AddWithValue("@dstetr_id", dstetr_id)
|
||||
Try
|
||||
cmd.ExecuteNonQuery()
|
||||
Return True
|
||||
Catch ex As SqlException
|
||||
MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Datensatz kann nicht gelöscht werden!" & vbCrLf & vbCrLf & ex.Message, vbExclamation, "Fehler beim löschen")
|
||||
End Try
|
||||
End Using
|
||||
End Using
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Function getMaIDFromMitID(mit_id As Integer) As String
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
@@ -3662,13 +3713,20 @@ Public Class cDienstplan
|
||||
End Function
|
||||
|
||||
|
||||
Public Function updateInsertByDienstEintrag(ByVal daten As cDienstEintrag, niederlassung As String) As Boolean
|
||||
Public Function updateInsertByDienstEintrag(ByVal daten As cDienstEintrag, niederlassung As String, Optional dstetr_id As Integer = -1) As Boolean
|
||||
|
||||
Dim SQLclause As String = ""
|
||||
|
||||
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) " & 'AND dstetr_art=@dstetr_art hinzugefügt!
|
||||
" 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 & ") " &
|
||||
" 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 " &
|
||||
" WHERE dstetr_datum = @dstetr_datum AND dstetr_dstmaId=@dstetr_dstmaId AND dstetr_niederlassung=@dstetr_niederlassung AND dstetr_art=@dstetr_art" & SQLclause &
|
||||
" End " &
|
||||
" Else " &
|
||||
" begin " &
|
||||
@@ -4087,10 +4145,13 @@ Public Class cDienstplan
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
Public Function getCountEntrys(maId As Integer, datum_von As Date, datum_bis As Date, Optional onlySplitschichten As Boolean = False) As Integer
|
||||
Public Function getCountEntrys(maId As Integer, datum_von As Date, datum_bis As Date, Optional onlySplitschichten As Boolean = False, Optional art As String = "") As Integer
|
||||
|
||||
Dim sqlWhere As String = ""
|
||||
If onlySplitschichten Then sqlWhere &= "AND dstetr_splitschicht = 1"
|
||||
If onlySplitschichten Then
|
||||
sqlWhere &= "AND dstetr_splitschicht = 1 AND dstetr_art = '"
|
||||
sqlWhere &= art & "'"
|
||||
End If
|
||||
Try
|
||||
Dim stunden As Integer
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
@@ -4116,7 +4177,6 @@ Public Class cDienstplan
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function getCountDays(maId As Integer, datum_von As Date, datum_bis As Date) As Integer
|
||||
Try
|
||||
Dim stunden As Integer
|
||||
@@ -4166,6 +4226,32 @@ Public Class cDienstplan
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Function getLatestDienstplanEintraegNr() As Integer
|
||||
|
||||
Try
|
||||
Using conn As SqlConnection = cSqlDb.GetNewOpenConnection()
|
||||
Using cmd As New SqlCommand(" select MAX([dstetr_id]) as MaxId from tblDienstplanEintraege ", conn)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
Dim cPF As New cProgramFunctions
|
||||
If dr.HasRows Then
|
||||
dr.Read()
|
||||
Return dr.Item("MaxId")
|
||||
End If
|
||||
dr.Close()
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
Dim antwort As MsgBoxResult = MsgBox(ex.Message, CType(MsgBoxStyle.RetryCancel + MsgBoxStyle.Exclamation, MsgBoxStyle), "Problem in Function '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'")
|
||||
If antwort <> MsgBoxResult.Retry Then
|
||||
MsgBox(System.Reflection.MethodInfo.GetCurrentMethod.Name & ": Programm wird aufgrund eines kritischen Problems beendet.", vbInformation)
|
||||
End If
|
||||
End Try
|
||||
|
||||
Return -1
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user