Пример #1
0
        public void RunUserModule()
        {
            Console.Clear();

            while (option != exitValue)
            {
                DisplayUserMenu();

                Console.Write("\nChoose an option: ");
                input = Console.ReadLine();
                bool result = Int32.TryParse(input, out option);

                if (result)
                {
                    switch (option)
                    {
                    case 1:
                        Console.Clear();
                        DisplayInventory.ListInventory();
                        break;

                    case 2:
                        //Console.WriteLine("CREATE new invoice\n");
                        Console.Clear();
                        //grandTotal += NewInvoice.CreateNewInvoice(counter++);
                        bool invoiceCreated = NewInvoice.CreateNewInvoice();
                        if (invoiceCreated)
                        {
                            int invoiceCounter = NewInvoice.GetNumberOfInvoice();
                            NewInvoice.AddItemToInvoice(invoiceCounter);
                        }
                        break;

                    case 3:
                        //Console.WriteLine("DISPLAY invoice\n");
                        Console.Clear();
                        InvoicesReport.DisplayInvoicesReport();
                        break;

                    case 4:
                        Console.Clear();
                        Console.WriteLine("EXITING the application... Thank you!");
                        break;

                    default:
                        Console.Clear();
                        Console.WriteLine(">>> Invalid input. Please try again!\n");
                        break;
                    }
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine(">>> Invalid input. Please try again!\n");
                }
            }
        }
Пример #2
0
        public void RunAdminModule()
        {
            Console.Clear();
            Console.WriteLine(">>> You have been authenticated. Welcome ADMIN user!\n");

            while (option != exitValue)
            {
                DisplayAdminMenu();

                Console.Write("\nChoose an option: ");
                input = Console.ReadLine();
                bool result = Int32.TryParse(input, out option);

                if (result)
                {
                    switch (option)
                    {
                    case 1:
                        Console.Clear();
                        DisplayInventory.ListInventory();
                        break;

                    case 2:
                        Console.Clear();
                        NewItem.GetItemData();
                        break;

                    case 3:
                        Console.Clear();
                        ModifyItem.ModifyItemData();
                        break;

                    case 4:
                        Console.Clear();
                        RemoveItem.RemoveItemFromInventory();
                        break;

                    case 5:
                        Console.Clear();
                        Console.WriteLine("EXITING the application... Thank you!");
                        break;

                    default:
                        Console.Clear();
                        Console.WriteLine(">>> Invalid number. Please try again!\n");
                        break;
                    }
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine(">>> Invalid input. Please try again!\n");
                }
            }
        }