Пример #1
0
        public static Estante operator -(Estante e, Producto p)
        {
            Estante estanteAux = e;

            for (int i = 0; i < (estanteAux.productos.Length); i++)
            {
                if (e == p)
                {
                    estanteAux.productos[i] = null;
                }
            }
            return(estanteAux);
        }
Пример #2
0
        public static string MostrarEstante(Estante e)
        {
            string returnAux = string.Empty;

            foreach (Producto productoAux in e.productos)
            {
                if (!(object.ReferenceEquals(productoAux, null)))
                {
                    returnAux += Producto.MostarProdcuto(productoAux) + "\n";
                }
            }
            return(returnAux);
        }