Example #1
0
        private void CalcularOrden()
        {
            if (rbtnChocolate.Checked)
            {
                Helado = new Chocolate();
                orden.AgregarHelado(Helado);
            }
            else
            {
                if (rbtnCrema.Checked)
                {
                    Helado = new Crema();
                    orden.AgregarHelado(Helado);
                }
                else
                {
                    if (rbtnFresa.Checked)
                    {
                        Helado = new Fresa();
                        orden.AgregarHelado(Helado);
                    }
                }
            }

            if (chkCaramelo.Checked)
            {
                Topping = new Caramelo();
                orden.AgregarTopping(Topping);
            }

            if (chkMani.Checked)
            {
                Topping = new Mani();
                orden.AgregarTopping(Topping);
            }

            if (chkOreo.Checked)
            {
                Topping = new Oreo();
                orden.AgregarTopping(Topping);
            }


            txtTotal.Text = orden.CalcularTotal().ToString();
        }
Example #2
0
 public void AgregarTopping(topping Topping)
 {
     cono.Topping.Add(Topping);
 }