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; } }
public void AddToSale(Sale NewSaleToAdd) { SaleNode NewProductNode = new SaleNode(); NewProductNode.sale = NewSaleToAdd; if (HeadNodeSale == null) { HeadNodeSale = NewProductNode; } else { SaleNode last = HeadNodeSale; while (last.Next != null) { last = last.Next; } last.Next = NewProductNode; } }