Esempio n. 1
0
        public static Estante operator -(Estante e, Producto prod)
        {
            Estante estanteAuxiliar = new Estante();

            foreach (Producto p in e._productos)
            {
                if (p != prod)
                {
                    estanteAuxiliar._productos.Add(p);
                }
            }
            return(estanteAuxiliar);
        }
Esempio n. 2
0
        public static string MostrarEstante(Estante e)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("CAPACIDAD: " + e._capacidad);

            foreach (Producto p in e._productos)
            {
                sb.AppendLine(p.ToString());
                sb.AppendLine("");
            }

            return(sb.ToString());
        }