Esempio n. 1
0
        public void newSale()
        {
            Console.WriteLine("Enter Tea Flavour:");
            Console.WriteLine("1. Pink Tea.");
            Console.WriteLine("2. Green Tea.");
            Console.WriteLine("3. English Tea.");
            int option1 = int.Parse(Console.ReadLine());

            if (option1 == 1)
            {
                flavourProperty = "Pink Tea";
            }
            else if (option1 == 2)
            {
                flavourProperty = "Green Tea";
            }
            else if (option1 == 3)
            {
                flavourProperty = "English Tea";
            }
            else
            {
                Console.WriteLine("Invalid Input");
            }

            Console.WriteLine("Enter Refreshment Name:");
            Console.WriteLine("1. Muffins.");
            Console.WriteLine("2. Pastries.");
            Console.WriteLine("3. Biscuits.");
            int option2 = int.Parse(Console.ReadLine());

            if (option2 == 1)
            {
                flavourProperty = "Muffins";
            }
            else if (option2 == 2)
            {
                refreshmentProperty = "Pastries";
            }
            else if (option2 == 3)
            {
                refreshmentProperty = "Biscuits";
            }
            else
            {
                Console.WriteLine("Invalid Input");
            }

            Console.WriteLine("Enter Customer Name:");
            customerNameProperty = Console.ReadLine();

            localDate = DateTime.Now;

            Console.WriteLine("Enter Cash Returned:");
            cashReturnedProperty = int.Parse(Console.ReadLine());

            totalCostProperty = (40 + 50);

            bool check = true;

            while (check)
            {
                Console.WriteLine("Enter Cash Received:");
                cashReceivedProperty = int.Parse(Console.ReadLine());
                if (cashReceived < totalCost)
                {
                    Console.WriteLine("ERROR!!! Enter Correct Amount");
                }
                else
                {
                    check = false;
                }
            }

            cashReturnedProperty = (cashReceived - totalCost);

            printInvoice();
            saleFileHandling sale = new saleFileHandling();

            sale.saveNewSale(this);
        }
Esempio n. 2
0
        public ArrayList getAllSales()
        {
            saleFileHandling obj = new saleFileHandling();

            return(obj.collectAllSale());
        }