Exemplo n.º 1
0
        private void UpdateDataGrid()
        {
            dataGridView1.Rows.Clear();

            Pizzaria.RemoveZeroes();

            foreach (Item item in Pizzaria.Checkout)
            {
                dataGridView1.Rows.Add(item.ToStringArray());
            }
        }
Exemplo n.º 2
0
        //adds a Pizza to Checkout
        private void AddPizzaButton_Click(object sender, EventArgs e)
        {
            IEnumerable <ItemProperty> i = from x in pizzaProperties.toppings
                                           where toppingBoxes.Any(y => y.Checked == true && x.name == y.Text)
                                           select x;

            if (i.Count() > 4)
            {
                return;
            }

            Pizzaria.AddPizza(MakePizza());

            Pizzaria.RemoveZeroes();

            f1.dataGridView1.Rows.Clear();

            foreach (Item item in Pizzaria.Checkout)
            {
                f1.dataGridView1.Rows.Add(item.ToStringArray());
            }
            Close();
        }
Exemplo n.º 3
0
        private void AddItemButton_Click(object sender, EventArgs e)
        {
            int i = ItemChoice();

            if (i > 0 && i < 50)
            {
                Pizzaria.AddPizza(MakePizza(ItemChoice()));
            }
            else if (i >= 50)
            {
                Pizzaria.AddDrink(MakeDrink(ItemChoice()));
            }
            else
            {
                return;
            }

            UpdateDataGrid();

            #region

            /*
             * Pizza selectedPizza = MakePizza(ItemChoice());
             *
             *
             *
             *
             * selectedPizza.Amount = Convert.ToInt32(PizzaAmount.Value);
             *
             * List<PizzaProperty> pizza1 = new List<PizzaProperty>();
             * List<PizzaProperty> pizza2 = new List<PizzaProperty>();
             *
             * pizza1.AddRange(selectedPizza.Ingredients);
             *
             * foreach (var item in pizzaria.Checkout)
             * {
             *  item.Ingredients
             * }
             *
             * selectedPizza.Ingredients.Sort(delegate (PizzaProperty property1, PizzaProperty property2) { return property1.name.CompareTo(property2.name); }) ;
             *
             * Pizza pizza3 = pizzaria.Pizzas.Find(x => x.Id == 3);
             * Pizza pizza4 = pizzaria.Pizzas.Find(x => x.Id == 4);
             *
             * pizza3.Ingredients.
             */
            #endregion

            #region

            /*
             * Control.ControlCollection controlCollection = panel1.Controls;
             * Control[] controls = new Control[controlCollection.Count];
             * List<Control> controlsList = new List<Control>();
             *
             * controlCollection.CopyTo(controls, 0);
             *
             *
             * controlsList.AddRange(controls);
             */
            #endregion
        }