예제 #1
0
 static void Main(string[] args)
 {
     Console.WriteLine("\nWelcome, Please choose a command:\n");
     MainMenu obj = new MainMenu();
     obj.DisplayMainMenu();
     // MainMenu.DisplayMainMenu();
 }//Main method closing
예제 #2
0
        public static void DisplayVacationMenu()
        {
            MainMenu obj1 = new MainMenu();

            Console.WriteLine("*****You Are at Vacations Menu******");
            Console.WriteLine("Press 1 to view vacation days");
            Console.WriteLine("Press 2 add vacation days");
            Console.WriteLine("Press 3 to Update vacation days");
            Console.WriteLine("Press 4 to Delete vacations");
            Console.WriteLine("Press 5 to return to the main menu");


            Console.WriteLine("");
            Console.WriteLine("Enter your choice:");

            Console.WriteLine("");
            int option = Program.GetUserChoice(5);

            if (option == 1 || option == 2 || option == 3 || option == 4 || option == 5)
            {
                switch (option)

                {
                case 1:
                    Program.DisplayVacaitosData();
                    DisplayVacationMenu();
                    break;

                case 2:
                    Program.AddVacations();
                    Program.DisplayVacaitosData();
                    DisplayVacationMenu();
                    break;

                case 3:
                    Program.UpdateVacations();
                    Program.DisplayVacaitosData();
                    DisplayVacationMenu();
                    break;

                case 4:
                    Program.DeleteVacations();
                    Program.DisplayVacaitosData();
                    DisplayVacationMenu();
                    break;

                case 5:
                    MainMenu obj = new MainMenu();
                    obj.DisplayMainMenu();
                    break;
                }  //Switch
            }      //if

            else
            {
                Console.WriteLine("Inavlid Input!\n\n");
                DisplayVacationMenu();
            }
        } //DisPlay Vacation Menu
        public static void DisplayEmployeeMenu()
        {
            MainMenu obj1 = new MainMenu();

            Console.WriteLine("\n***You Are at Employee Menu***\n");
            Console.WriteLine("Press 1 to list all employees");
            Console.WriteLine("Press 2 to add a new employee");
            Console.WriteLine("Press 3 to update an employee");
            Console.WriteLine("Press 4 to delete an employee");
            Console.WriteLine("Press 5 to return to the main menu");

            Console.WriteLine("");
            Console.WriteLine("Enter your choice:");


            Console.WriteLine("");
            int option = Program.GetUserChoice(5);

            if (option == 1 || option == 2 || option == 3 || option == 4 || option == 5)
            {
                switch (option)

                {
                case 1:
                    Program.DisplayAllEmployees();
                    DisplayEmployeeMenu();
                    break;

                case 2:
                    Program.AddNewEmployee();
                    Program.DisplayAllEmployees();
                    DisplayEmployeeMenu();
                    break;

                case 3:
                    Program.UpdateEmployee();
                    Program.DisplayAllEmployees();
                    DisplayEmployeeMenu();
                    break;

                case 4:
                    Program.DeleteEmployee();
                    Program.DisplayAllEmployees();
                    DisplayEmployeeMenu();
                    break;

                case 5:
                    obj1.DisplayMainMenu();
                    break;
                } //Switch
            }     //if
            else
            {
                Console.WriteLine("Inavlid Input!\n\n");
                DisplayEmployeeMenu();
            } //else
        }
        };//PaYroll menu



        public static void DisplayPayRollMenu()
        {
            MainMenu obj1 = new MainMenu();

            Console.WriteLine("******You Are at PayRoll Menu*******");
            Console.WriteLine("Press 1 to insert new payroll entry");
            Console.WriteLine("Press 2 view payroll history for an employee");
            Console.WriteLine("Press 3 to Update Payroll");
            Console.WriteLine("Press 4 to Delete Payroll");
            Console.WriteLine("Press 5 to return to the main menu");


            Console.WriteLine("");
            Console.WriteLine("Enter your choice:");

            Console.WriteLine("");
            int option = Program.GetUserChoice(5);

            if (option == 1 || option == 2 || option == 3 || option == 4 || option == 5)
            {
                switch (option)

                {
                case 1:
                    Program.AddPayrollEntry();
                    DisplayPayRollMenu();
                    break;

                case 2:
                    Program.ViewAllPayrolls();
                    DisplayPayRollMenu();
                    break;

                case 3:
                    Program.UpdatePayroll();
                    Program.ViewAllPayrolls();
                    DisplayPayRollMenu();
                    break;

                case 4:
                    Program.DeletePayroll();
                    Program.ViewAllPayrolls();
                    DisplayPayRollMenu();
                    break;

                case 5:
                    MainMenu obj = new MainMenu();
                    obj.DisplayMainMenu();
                    break;
                }  //Switch
            }      //if
            else
            {
                Console.WriteLine("Inavlid Input!\n\n");
                DisplayPayRollMenu();
            }
        } //DisplayPayRollMenu