Пример #1
0
 public void PrintProducts()
 {
     ProductNodo PrProduct = Head01;
     while (PrProduct != null)
     {
         Console.WriteLine($"Nombre Product:  { PrProduct.Product.Name} -> Price Product: {PrProduct.Product.Price} -> Stock Product: {PrProduct.Product.Stock}");
         PrProduct = PrProduct.Next;
     }
 }
Пример #2
0
        public void InsertarProduct(Product newproduct, Product after)
        {
            ProductNodo tmp = Head01;
            while (tmp != null && tmp.Product != after)
            {
                tmp = tmp.Next;
            }
            ProductNodo newnodoP = new ProductNodo();
            newnodoP.Product = newproduct;

            newnodoP.Next = tmp.Next;
            tmp.Next = newnodoP;
        }
Пример #3
0
        public void AddProduct(Product productToAdd)
        {
            ProductNodo newproductNodo = new ProductNodo();
            newproductNodo.Product = productToAdd;

            if (Head01 == null)
            {
                Head01 = newproductNodo;
            }
            else
            {
                ProductNodo last = Head01;
                while (last.Next != null)
                {
                    last = last.Next;
                }
                last.Next = newproductNodo;
            }


        }