static void Main(string[] args)
        {
            //INSTANCIA
            var jugador = new Persona();

            Console.WriteLine("Nombre de jugador:");
            Console.WriteLine(jugador.nombre = "Leonel");

            var juez = new Persona();

            Console.WriteLine("Nombre de Arbitro:");
            Console.WriteLine(juez.nombre = "Omar");

            Cancha Old = new Cancha();

            Old.Sostener();

            Camiseta Manchester = new Camiseta();

            Manchester.Vestir();

            Botines Nike = new Botines();

            Nike.Proteger();

            Console.WriteLine("Clase MyFutbol");
            Balon adidas = new Balon();

            adidas.Inflar();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Sneakers s1 = new Sneakers("JORDAN AJ1 ", 10, 200, EProcedencia.Afganistan);
            Sneakers s2 = new Sneakers("OZZWEGO ", 10, 2000, EProcedencia.EstadosUnidos);
            Sneakers s3 = new Sneakers("OZZWEGO ", 10, 2000, EProcedencia.EstadosUnidos);

            Botines b1 = new Botines("ADIDAS F50", 9, 500, true);
            Botines b2 = new Botines("PUMA RXT", 8, 1000, false);

            Cliente auxCliente = new Cliente("Prueba", 958893, "salta654", 500, EMetodoPago.Efectivo);

            Carrito c1 = new Carrito();
            Carrito c2 = new Carrito();

            c1 += s1;
            c1 += s2;


            c1 += b1;

            if (s2 == s3)
            {
                Console.WriteLine("     ********* SON IGUALES  ***************");
            }

            Console.WriteLine(c1.ToString());
            Console.ReadLine();
            Console.WriteLine(c2.ToString()); // no deberia mostrar
            Console.ReadLine();
        }
Exemplo n.º 3
0
        public void MaximoBotines_Test()
        {
            // arrange
            Botines botin1   = new Botines("Adidas", 10, 500, true);
            Botines botin2   = new Botines("Nike", 9, 300, false);
            Carrito carrito1 = new Carrito();

            //act
            carrito1 += botin1;
            carrito1 += botin2;
            //assert
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Clase MyFutbol");
            Balon adidas = new Balon();

            adidas.Inflar();


            Futbolista Messi = new Futbolista();

            Messi.Jugar();

            Cancha Old = new Cancha();

            Old.Sostener();

            Camiseta Manchester = new Camiseta();

            Manchester.Vestir();

            Botines Nike = new Botines();

            Nike.Proteger();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Evento encargado de almacenar el producto seleccionado de la grilla con toda su informacion.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AgregarCarrito_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.GrillaSneakers.CurrentRow != null && this.GrillaBotines.CurrentRow != null)
                {
                    //deselecciono las filas de los botines.
                    this.GrillaBotines.ClearSelection();
                    this.GrillaBotines.CurrentCell = null;

                    this.GrillaSneakers.ClearSelection();
                    this.GrillaSneakers.CurrentCell = null;

                    this.car.MaximoCompra.Invoke(car, EventArgs.Empty);
                }
                // pregunto si hay alguna fila seleccionada en la grilla sneakers
                if (this.GrillaSneakers.CurrentRow != null)
                {
                    this.GrillaBotines.ClearSelection();
                    int indexSneaker = this.GrillaSneakers.SelectedRows[0].Index;    // guardo el numero de la fila index

                    DataRow filaSneaker = this.dataTableSneakers.Rows[indexSneaker]; //obtengo la fila

                    int    id          = int.Parse(filaSneaker["Id_Zapatilla"].ToString());
                    string marca       = filaSneaker["Marca"].ToString();
                    float  talla       = float.Parse(filaSneaker["Talla"].ToString());
                    float  precio      = float.Parse(filaSneaker["Precio"].ToString());
                    string procedencia = filaSneaker["Procedencia"].ToString();

                    this.precioAcumulado += precio;

                    Sneakers sneaker = new Sneakers(marca, talla, precio, Sneakers.StringToProcedencia(procedencia));

                    car += sneaker;

                    MessageBox.Show("Se  agrego correctamente !");

                    this.FinalizarPagobutton.Enabled = true;
                    this.VerCarritobutton.Enabled    = true;

                    this.filas.Add(indexSneaker);
                }
                // si hay algun producto de tipo botin seleccionado
                else if (this.GrillaBotines.CurrentRow != null)
                {
                    this.GrillaSneakers.ClearSelection();

                    int     indexBotin = this.GrillaBotines.SelectedRows[0].Index;
                    DataRow filaBotin  = this.dataTableBotines.Rows[indexBotin];

                    int    id           = int.Parse(filaBotin["ID_Botin"].ToString());
                    string marca        = filaBotin["Marca"].ToString();
                    float  talla        = float.Parse(filaBotin["Talla"].ToString());
                    float  precio       = float.Parse(filaBotin["Precio"].ToString());
                    bool   multiterreno = bool.Parse(filaBotin["Multiterreno"].ToString());

                    this.precioAcumulado += precio;

                    Botines botin = new Botines(marca, talla, precio, multiterreno);

                    car += botin;

                    MessageBox.Show("Se  agrego correctamente !");

                    this.indexBotinDelete            = indexBotin;
                    this.FinalizarPagobutton.Enabled = true;
                    this.VerCarritobutton.Enabled    = true;
                }
            }
            catch (SneakerRepetidoExcepcion sE)
            {
                MessageBox.Show(sE.Message);
            }
            catch (MaximoBotinesExcepcion mBE)
            {
                MessageBox.Show(mBE.Message);
            }
        }