Esempio n. 1
0
        // Zdarzenie obsługujące tworzenie obiektu danie główne
        private void MainDishClickEvent(object sender, EventArgs e)
        {
            Button    button   = sender as Button;
            IMainDish mainDish = MainDishFactory.CreateMainDish(button.Tag as FoodInformation);

            using (ToppingsForDinner toppings = new ToppingsForDinner(mainDish))
            {
                if (toppings.ShowDialog() == DialogResult.OK)
                {
                    uiClbShopingCard.Items.Add(toppings.MainDish);
                    _orderCost         += toppings.MainDish.Price();
                    uiTxtOrderCost.Text = _orderCost.ToString("C", _cultureInfo);
                }
            }
        }
Esempio n. 2
0
        // Zdarzenie obsługujące tworzenie obiektu pizza
        private void PizzaClickEvent(object sender, EventArgs e)
        {
            Button button = sender as Button;
            IPizza pizza  = PizzaFactory.CreatePizza(button.Tag as FoodInformation);

            using (ToppingsForDinner toppings = new ToppingsForDinner(pizza))
            {
                if (toppings.ShowDialog() == DialogResult.OK)
                {
                    uiClbShopingCard.Items.Add(toppings.Pizza);
                    _orderCost         += toppings.Pizza.Price();
                    uiTxtOrderCost.Text = _orderCost.ToString("C", _cultureInfo);
                }
            }
        }