NEU
This commit is contained in:
230
UID/Dienstplan/frmSchichtenZeiten.vb
Normal file
230
UID/Dienstplan/frmSchichtenZeiten.vb
Normal file
@@ -0,0 +1,230 @@
|
||||
Public Class frmSchichtenZeiten
|
||||
Dim ADMIN As New cOptionenDAL
|
||||
Dim DP As New cDienstplan
|
||||
Public niederlassung As String = ""
|
||||
Private Sub frmSchichtenZeiten_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
initSchichten()
|
||||
End Sub
|
||||
|
||||
Sub initSchichten()
|
||||
With dgvSchihten
|
||||
.DataSource = ADMIN.AnzeigeTabelle(" SELECT dedet_id,dedet_info FROM [tblDienstplanEintraegeDetails] WHERE [dedet_niederlassung] = '" & niederlassung.ToUpper & "' ORDER BY dedet_reihenfolge")
|
||||
If .Columns.Count = 0 Then Exit Sub
|
||||
.Columns("dedet_id").Visible = False
|
||||
.Columns("dedet_info").HeaderText = "Bezeichnung"
|
||||
.Columns("dedet_info").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
End With
|
||||
End Sub
|
||||
|
||||
Private Sub dgvSchihten_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSchihten.SelectionChanged
|
||||
cbxRotMo.Checked = False
|
||||
txtRotVonMo.Text = "00:00"
|
||||
txtRotBisMo.Text = "00:00"
|
||||
txtRotPauseMo.Text = "0"
|
||||
|
||||
cbxRotDi.Checked = False
|
||||
txtRotVonDi.Text = "00:00"
|
||||
txtRotBisDi.Text = "00:00"
|
||||
txtRotPauseDi.Text = "0"
|
||||
|
||||
cbxRotMi.Checked = False
|
||||
txtRotVonMi.Text = "00:00"
|
||||
txtRotBisMi.Text = "00:00"
|
||||
txtRotPauseMi.Text = "0"
|
||||
|
||||
cbxRotDo.Checked = False
|
||||
txtRotVonDo.Text = "00:00"
|
||||
txtRotBisDo.Text = "00:00"
|
||||
txtRotPauseDo.Text = "0"
|
||||
|
||||
cbxRotFr.Checked = False
|
||||
txtRotVonFr.Text = "00:00"
|
||||
txtRotBisFr.Text = "00:00"
|
||||
txtRotPauseFr.Text = "0"
|
||||
|
||||
cbxRotSa.Checked = False
|
||||
txtRotVonSa.Text = "00:00"
|
||||
txtRotBisSa.Text = "00:00"
|
||||
txtRotPauseSa.Text = "0"
|
||||
|
||||
cbxRotSo.Checked = False
|
||||
txtRotVonSo.Text = "00:00"
|
||||
txtRotBisSo.Text = "00:00"
|
||||
txtRotPauseSo.Text = "0"
|
||||
|
||||
If dgvSchihten.SelectedRows.Count > 0 Then
|
||||
|
||||
Dim SCHICHT As New cDienstplanSchicht(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value)
|
||||
For Each z In SCHICHT.ZEITEN
|
||||
Select Case z.dsz_woTag
|
||||
Case "MO" : cbxRotMo.Checked = True
|
||||
txtRotVonMo.Text = z.dsz_von
|
||||
txtRotBisMo.Text = z.dsz_bis
|
||||
txtRotPauseMo.Text = z.dsz_pause
|
||||
Case "DI" : cbxRotDi.Checked = True
|
||||
txtRotVonDi.Text = z.dsz_von
|
||||
txtRotBisDi.Text = z.dsz_bis
|
||||
txtRotPauseDi.Text = z.dsz_pause
|
||||
Case "MI" : cbxRotMi.Checked = True
|
||||
txtRotVonMi.Text = z.dsz_von
|
||||
txtRotBisMi.Text = z.dsz_bis
|
||||
txtRotPauseMi.Text = z.dsz_pause
|
||||
Case "DO" : cbxRotDo.Checked = True
|
||||
txtRotVonDo.Text = z.dsz_von
|
||||
txtRotBisDo.Text = z.dsz_bis
|
||||
txtRotPauseDo.Text = z.dsz_pause
|
||||
Case "FR" : cbxRotFr.Checked = True
|
||||
txtRotVonFr.Text = z.dsz_von
|
||||
txtRotBisFr.Text = z.dsz_bis
|
||||
txtRotPauseFr.Text = z.dsz_pause
|
||||
Case "SA" : cbxRotSa.Checked = True
|
||||
txtRotVonSa.Text = z.dsz_von
|
||||
txtRotBisSa.Text = z.dsz_bis
|
||||
txtRotPauseSa.Text = z.dsz_pause
|
||||
Case "SO" : cbxRotSo.Checked = True
|
||||
txtRotVonSo.Text = z.dsz_von
|
||||
txtRotBisSo.Text = z.dsz_bis
|
||||
txtRotPauseSo.Text = z.dsz_pause
|
||||
End Select
|
||||
Next
|
||||
|
||||
cbxBenutzerdefinierteSchicht.Checked = SCHICHT.dedet_benutzerdefinierteSchicht
|
||||
cbxSchichtArbeitszeit.Checked = SCHICHT.dedet_stdWieArbeitszeit
|
||||
txtDPBezeichnung.Text = SCHICHT.dedet_bezeichnungDP
|
||||
txtProzent.Text = SCHICHT.dedet_ProzentGrafik
|
||||
txtExcelBezeichnung.Text = SCHICHT.dedet_bezeichnungExcel
|
||||
txtExcelBezeichnung2.Text = SCHICHT.dedet_bezeichnungExcel2
|
||||
txtExcelBezeichnung3.Text = SCHICHT.dedet_bezeichnungExcel3
|
||||
txtExcelZeilen.Text = SCHICHT.dedet_ZeilenExcel
|
||||
txtReihenfolge.Text = SCHICHT.dedet_reihenfolge
|
||||
cbxTagesSchichtWechsel.Checked = SCHICHT.dedet_TagesWechsel
|
||||
txtSchichtWechselZu.Text = SCHICHT.dedet_WechselZuSchicht
|
||||
txtHotKey.Text = SCHICHT.dedet_hotKey
|
||||
|
||||
If SCHICHT.dedet_bgAlternativeFarbe IsNot Nothing Then
|
||||
Button2.BackColor = ColorTranslator.FromHtml(SCHICHT.dedet_bgAlternativeFarbe)
|
||||
CheckBox1.Checked = True
|
||||
Else
|
||||
Button2.BackColor = Color.Black
|
||||
CheckBox1.Checked = False
|
||||
End If
|
||||
|
||||
txtExcelMonat.Text = SCHICHT.dedet_ExcelMonatBezeichnung
|
||||
|
||||
txtZusatzAL.Text = SCHICHT.dedet_bezLeiter
|
||||
|
||||
If SCHICHT.dedet_ExcelBgFarbe IsNot Nothing Then
|
||||
btnExcelColor.BackColor = ColorTranslator.FromHtml(SCHICHT.dedet_ExcelBgFarbe)
|
||||
CheckBox2.Checked = True
|
||||
Else
|
||||
btnExcelColor.BackColor = Color.Black
|
||||
CheckBox2.Checked = False
|
||||
End If
|
||||
|
||||
If SCHICHT.dedet_ExcelMonatFarbe IsNot Nothing Then
|
||||
frbBGExcelMonat.BackColor = ColorTranslator.FromHtml(SCHICHT.dedet_ExcelMonatFarbe)
|
||||
CheckBox3.Checked = True
|
||||
Else
|
||||
btnExcelColor.BackColor = Color.Black
|
||||
CheckBox3.Checked = False
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click
|
||||
If dgvSchihten.SelectedRows.Count > 0 Then
|
||||
DP.delDienstTeilzeitByDedetId(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value)
|
||||
|
||||
If cbxRotMo.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonMo.Text, txtRotBisMo.Text, txtRotPauseMo.Text, "MO")
|
||||
If cbxRotDi.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonDi.Text, txtRotBisDi.Text, txtRotPauseDi.Text, "DI")
|
||||
If cbxRotMi.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonMi.Text, txtRotBisMi.Text, txtRotPauseMi.Text, "MI")
|
||||
If cbxRotDo.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonDo.Text, txtRotBisDo.Text, txtRotPauseDo.Text, "DO")
|
||||
If cbxRotFr.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonFr.Text, txtRotBisFr.Text, txtRotPauseFr.Text, "FR")
|
||||
If cbxRotSa.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonSa.Text, txtRotBisSa.Text, txtRotPauseSa.Text, "SA")
|
||||
If cbxRotSo.Checked Then DP.insertDienstSchichtZeit(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtRotVonSo.Text, txtRotBisSo.Text, txtRotPauseSo.Text, "SO")
|
||||
|
||||
Dim bg As Object
|
||||
If CheckBox1.Checked Then
|
||||
bg = ColorTranslator.ToHtml(Button2.BackColor)
|
||||
Else
|
||||
bg = DBNull.Value
|
||||
End If
|
||||
|
||||
|
||||
Dim bgExcel As Object
|
||||
If CheckBox2.Checked Then
|
||||
bgExcel = ColorTranslator.ToHtml(btnExcelColor.BackColor)
|
||||
Else
|
||||
bgExcel = DBNull.Value
|
||||
End If
|
||||
|
||||
Dim bgExcelMonat As Object
|
||||
If CheckBox3.Checked Then
|
||||
bgExcelMonat = ColorTranslator.ToHtml(frbBGExcelMonat.BackColor)
|
||||
Else
|
||||
bgExcelMonat = DBNull.Value
|
||||
End If
|
||||
|
||||
DP.updateEintraegeDetails_Benuterdef(dgvSchihten.SelectedRows(0).Cells("dedet_id").Value, txtDPBezeichnung.Text, txtProzent.Text, txtExcelBezeichnung.Text, txtExcelBezeichnung2.Text, txtExcelBezeichnung3.Text, txtExcelZeilen.Text, cbxBenutzerdefinierteSchicht.Checked, cbxSchichtArbeitszeit.Checked,
|
||||
IIf(IsNumeric(txtReihenfolge.Text), txtReihenfolge.Text, 50), cbxTagesSchichtWechsel.Checked, txtSchichtWechselZu.Text, txtHotKey.Text, bg, bgExcel, txtZusatzAL.Text, bgExcelMonat, txtExcelMonat.Text)
|
||||
|
||||
End If
|
||||
' d.dedet_bezeichnungDP = dr.Item("dedet_bezeichnungDP")
|
||||
' d.dedet_ProzentGrafik = dr.Item("dedet_ProzentGrafik")
|
||||
'' d.dedet_bezeichnungExcel = dr.Item("dedet_bezeichnungExcel")
|
||||
' d.dedet_ZeilenExcel = dr.Item("dedet_ZeilenExcel")
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cbxBenutzerdefinierteSchicht_CheckedChanged(sender As Object, e As EventArgs) Handles cbxBenutzerdefinierteSchicht.CheckedChanged
|
||||
pnl.Enabled = cbxBenutzerdefinierteSchicht.Checked
|
||||
If sender.checked Then
|
||||
cbxSchichtArbeitszeit.Checked = False
|
||||
cbxSchichtArbeitszeit.Enabled = False
|
||||
Else
|
||||
cbxSchichtArbeitszeit.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn.Click
|
||||
MsgBox("Funktion noch nicht verfügbar!")
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
MsgBox("Funktion noch nicht verfügbar!")
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
|
||||
Button2.Visible = CheckBox1.Checked
|
||||
End Sub
|
||||
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
|
||||
btnExcelColor.Visible = CheckBox2.Checked
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
If ColorDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
|
||||
Button2.BackColor = ColorDialog1.Color
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnExcelColor_Click(sender As Object, e As EventArgs) Handles btnExcelColor.Click
|
||||
If ColorDialog2.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
|
||||
btnExcelColor.BackColor = ColorDialog2.Color
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
|
||||
frbBGExcelMonat.Visible = CheckBox3.Checked
|
||||
End Sub
|
||||
|
||||
Private Sub frbBGExcelMonat_Click(sender As Object, e As EventArgs) Handles frbBGExcelMonat.Click
|
||||
If ColorDialog3.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
|
||||
frbBGExcelMonat.BackColor = ColorDialog3.Color
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user