Essensbestellung, nun kann in EssensbestellungenAdmin manuell Tage bis Bestelllimit gesetzt werden.
This commit is contained in:
@@ -27,9 +27,9 @@ Public Class frmEssensbestellungenAdministration
|
||||
cboAbteilung.fillWithSQL("SELECT DISTINCT(eb_abteilung) FROM [tblEssensbestellungen]", False, "AVISO", True)
|
||||
cboAbteilung.changeItem("")
|
||||
|
||||
cbKW.fillWithSQL("SELECT DISTINCT(eb_kw) FROM [tblEssensbestellungen] ORDER BY eb_kw desc", False, "AVISO", True)
|
||||
cbKW.fillWithSQL("SELECT DISTINCT(eb_kw) FROM [tblEssensbestellungen] UNION SELECT (REPLACE(MenuTitel,'Wochenkarte ','')) + ' - ' + Convert(varchar, Year(MenuDateVon)) as kwDateNew FROM [tblEBMenu] where MenuDateVon > GETDATE()ORDER BY eb_kw desc", False, "AVISO", True)
|
||||
|
||||
cbxMailKW.Items.AddRange(cbKW.Items.Cast(Of VERAG_PROG_ALLGEMEIN.MyListItem).ToArray())
|
||||
cbxMailKW.fillWithSQL("SELECT DISTINCT(eb_kw) FROM [tblEssensbestellungen] ORDER BY eb_kw desc", False, "AVISO", True)
|
||||
cbxMailKW.changeItem("")
|
||||
|
||||
cbxMailGebäude.changeItem("")
|
||||
@@ -530,16 +530,21 @@ Public Class frmEssensbestellungenAdministration
|
||||
|
||||
Private Sub cbKW_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbKW.SelectedValueChanged
|
||||
|
||||
If cbKW._value Is Nothing Or cbKW._value = "" Then Exit Sub
|
||||
If cbKW._value Is Nothing Or cbKW._value = "" Then
|
||||
txtBestelllimit.Text = ""
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
dt.Clear()
|
||||
End If
|
||||
|
||||
dt = SQL.loadDgvBySql("SELECT Top 1 * from (SELECT (REPLACE(MenuTitel,'Wochenkarte ','')) + ' - ' + Convert(varchar, Year(MenuDateVon)) as kwDate, MenuDateVon, MenuDateBis FROM tblEBMenu) kwDate where kwDate = '" & cbKW._value & "'", "AVISO", 100, True)
|
||||
dt = SQL.loadDgvBySql("SELECT Top 1 * from (SELECT (REPLACE(MenuTitel,'Wochenkarte ','')) + ' - ' + Convert(varchar, Year(MenuDateVon)) as kwDate, MenuDateVon, MenuDateBis, MenuBestellungBisTageVorher FROM tblEBMenu) kwDate where kwDate = '" & cbKW._value & "'", "AVISO", 100, True)
|
||||
|
||||
txtBestelllimit.Text = ""
|
||||
|
||||
If dt.Rows.Count > 0 Then
|
||||
|
||||
txtBestelllimit.Text = dt.Rows(0).Item("MenuBestellungBisTageVorher").ToString
|
||||
txtBestellDat.Text = CDate(dt.Rows(0).Item("MenuDateVon")).ToString("dd.MM.yyyy")
|
||||
txtBestellDatBis.Text = CDate(dt.Rows(0).Item("MenuDateBis")).ToString("dd.MM.yyyy")
|
||||
btnSuche.PerformClick()
|
||||
@@ -547,7 +552,6 @@ Public Class frmEssensbestellungenAdministration
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click
|
||||
@@ -734,4 +738,38 @@ Public Class frmEssensbestellungenAdministration
|
||||
|
||||
txtMarkierteDS._value = countSumme.ToString
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub txtBestelllimit_KeyDown(sender As Object, e As KeyEventArgs) Handles txtBestelllimit.KeyDown
|
||||
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
|
||||
If IsNumeric(txtBestelllimit.Text) And txtBestelllimit.Text > 0 Then
|
||||
SQL.doSQL("UPDATE tblEBMenu SET MenuBestellungBisTageVorher='" & txtBestelllimit.Text & "' WHERE MenuDateVon = '" & dt.Rows(0).Item("MenuDateVon").ToString() & "'", "AVISO")
|
||||
e.Handled = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub txtBestelllimit_ValueChanged() Handles txtBestelllimit.TextChanged
|
||||
If cbKW._value Is Nothing Or cbKW._value = "" Then
|
||||
txtBestelllimit.Enabled = False
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If dt.Rows.Count > 0 Then
|
||||
If CDate(dt.Rows(0).Item("MenuDateVon")).ToString("dd.MM.yyyy") < Today Then
|
||||
|
||||
txtBestelllimit.Enabled = False
|
||||
Else
|
||||
txtBestelllimit.Enabled = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user