示例#1
0
        static void MainOptionsInput()
        {
            MAINOptionsDetails.MainOptionMessage = "-------------------------------------------------------------------\r\n" +
                                                   "         W E L C O M E   T O   P A Y R O L L   S Y S T E M\r\n" +
                                                   "-------------------------------------------------------------------\r\n" +
                                                   "PLEASE INPUT ANY OF THE FOLLOWING OPTIONS.\r\n";
            MAINOptionsDetails.Options = "A - Create Payroll\r\n" +
                                         "B - Employee Management\r\n" +
                                         "C - Log Out\r\n" +
                                         "D - Payroll History\r\n" +
                                         "E - User Reports";

            MAINOptions.DisplayMainOptions();

            Console.WriteLine("\n-------------------------------------------------------------------");
            Console.Write("INPUT: ");
            MAINOptionsDetails.Input = Convert.ToChar(Console.ReadLine().ToUpper());


            switch (MAINOptionsDetails.Input)
            {
            case 'A':
                var message = "A - Create Payroll";
                USERReports.AddActionReport(message);
                CreatePayroll();

                break;

            case 'B':
                message = "B - Manage Employees";
                USERReports.AddActionReport(message);
                ManageEmployees();
                break;

            case 'C':
                Console.Clear();
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("                         L O G G E D  O U T");
                Console.WriteLine("-------------------------------------------------------------------");
                System.Environment.Exit(0);
                break;

            case 'D':
                message = "D - Payroll History";
                USERReports.AddActionReport(message);
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("                   P A Y R O L L   H I S T O R Y");
                Console.WriteLine("-------------------------------------------------------------------\n");

                PAYROLLHISTORY.ShowPayrollHistory();

                Console.WriteLine("\n-------------------------------------------------------------------");
                Console.WriteLine("PLEASE PRESS ANY KEY TO GO BACK TO MAIN OPTIONS.");
                Console.ReadKey();

                MainOptionsInput();
                break;

            case 'E':
                message = "E - User Reports";
                USERReports.AddActionReport(message);
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("                        U S E R   R E P O R T S");
                Console.WriteLine("-------------------------------------------------------------------\n");

                USERReports.ShowReports();

                Console.WriteLine("\n-------------------------------------------------------------------");
                Console.WriteLine("PLEASE PRESS ANY KEY TO GO BACK TO MAIN OPTIONS.");
                Console.ReadKey();

                MainOptionsInput();
                break;

            default:
                Console.Clear();
                message = "Main Options Invalid Input";
                USERReports.AddResultReport(message);
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("                            E R R O R");
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("INVALID INPUT. PLEASE PRESS ANY KEY TO TRY AGAIN.\n");
                Console.ReadKey();

                MainOptionsInput();
                break;
            }
        }