Esempio n. 1
0
        private void bestellijstBtn_Click(object sender, EventArgs e)
        {
            BestelLijstFrom form = new BestelLijstFrom(tafel, order, employee);

            Hide();
            form.ShowDialog(Owner);
            Close();
        }
Esempio n. 2
0
        private void bestelBtn_Click(object sender, EventArgs e)
        {
            List <Dish>  dishes = new List <Dish>();
            List <Drink> drinks = new List <Drink>();

            if (product.Dish.Name != null)
            {
                if (product.Dish.Stock == 0)
                {
                    MessageBox.Show("Niet op voorraad", "Attentie", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (order.Dishes == null)
                {
                    order = new Order(0, DateTime.Now, DateTime.Now, dishes, drinks, 0, tafel.Number, OrderState.Started, "");
                    order.Dishes.Add(product.Dish);
                }
                else
                {
                    product.Dish.Description = opmerkingenTxt.Text;
                    order.Dishes.Add(product.Dish);
                }
            }
            else if (product.Drink.Name != null)
            {
                if (product.Drink.Stock == 0)
                {
                    MessageBox.Show("Niet op voorraad", "Attentie", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (order.Drinks == null)
                {
                    order = new Order(0, DateTime.Now, DateTime.Now, dishes, drinks, 0, tafel.Number, OrderState.Started, "");
                    order.Drinks.Add(product.Drink);
                }
                else
                {
                    order.Drinks.Add(product.Drink);
                }
            }
            Hide();
            BestelLijstFrom form = new BestelLijstFrom(tafel, order, employee);

            form.ShowDialog(Owner);
            Close();
        }