Ejemplo n.º 1
0
        public void PrintStock()
        {
            ProductNode pruduct = HeadNodeProduct;

            while (pruduct != null)
            {
                Console.WriteLine($"Product name: {pruduct.product.Name} - Units available: {pruduct.product.Stock}");
                pruduct = pruduct.Next;
            }
        }
Ejemplo n.º 2
0
        public void PrintProduct()
        {
            ProductNode pruduct = HeadNodeProduct;

            while (pruduct != null)
            {
                Console.WriteLine($"Product name: {pruduct.product.Name} - Id: {pruduct.product.ID} - Price: {pruduct.product.Price} - Stock: {pruduct.product.Stock}");
                pruduct = pruduct.Next;
            }
        }
Ejemplo n.º 3
0
        public void InsertAfterClient(Product newProduct, Product after)
        {
            ProductNode pruduct = HeadNodeProduct;

            while (pruduct != null && pruduct.product != after)
            {
                pruduct = pruduct.Next;
            }
            ProductNode NewProductNode = new ProductNode();

            NewProductNode.product = newProduct;

            NewProductNode.Next = pruduct.Next;
            pruduct.Next        = NewProductNode;
        }
Ejemplo n.º 4
0
        public void PrintSales()
        {
            ClientNode  client  = HeadNodeClient;
            ProductNode pruduct = HeadNodeProduct;
            SaleNode    SalE    = HeadNodeSale;

            while (SalE != null && pruduct != null && SalE != null)
            {
                Console.WriteLine($"Name: {client.client.NameClient} - Age: {client.client.Age} - Id: {client.client.Id} - Cell: {client.client.Cell} - Email: {client.client.Email} ");
                client = client.Next;

                Console.WriteLine($"Product name: {pruduct.product.Name} - Id: {pruduct.product.ID} - Price: {pruduct.product.Price} - Stock: {pruduct.product.Stock}");
                pruduct = pruduct.Next;
                SalE    = SalE.Next;
            }
        }
Ejemplo n.º 5
0
        public void AddToProduct(Product NewProductToAdd)
        {
            ProductNode NewProductNode = new ProductNode();

            NewProductNode.product = NewProductToAdd;

            if (HeadNodeProduct == null)
            {
                HeadNodeProduct = NewProductNode;
            }
            else
            {
                ProductNode last = HeadNodeProduct;
                while (last.Next != null)
                {
                    last = last.Next;
                }
                last.Next = NewProductNode;
            }
        }
Ejemplo n.º 6
0
 public void removeProduct()
 {
     HeadNodeProduct = HeadNodeProduct.Next;
 }