Exemple #1
0
        public static void MainMenu()
        {
            int?menuChoice = null;

            do
            {
                menuChoice = MenuUtils.GetIntChoice(MenuUtils.BaseChoiceMenu(), 1, 4);
                switch (menuChoice)
                {
                case 1:
                    Menu.EmployeesMenu();
                    break;

                case 2:
                    Menu.ServicesMenu();
                    break;

                case 3:
                    Payroll();
                    break;

                case 4:
                    Console.WriteLine("Enter to close this application. Thank you and good bye.");
                    Console.ReadLine();
                    break;

                default:
                    MainMenu();
                    break;
                }
            } while (menuChoice != 4);
        }
Exemple #2
0
        public void MainMenu()
        {
            int?choice = null;

            do
            {
                choice = MenuUtils.GetIntChoice(MenuUtils.BaseChoiceMenu(), 1, 4);

                switch (choice)

                {
                case 1:

                    EmployeeMenu();

                    break;

                case 2:

                    ServiceMenu();

                    break;

                case 3:

                    using (var db = new EmployeeContext())

                    {
                        Console.WriteLine(db.Employees.AsNoTracking().Sum(x => x.Salary));
                    }

                    break;

                case 4:

                    Environment.Exit(0);

                    break;

                default:

                    break;
                }
            } while (true);
        }