Esempio n. 1
0
        static void Main(string[] args)
        {
            while (true)
            {
                ProgrammActions.ShowMenu();
                int.TryParse(Console.ReadLine(), out int userInput);
                switch (userInput)
                {
                case 1:
                {
                    ProgrammActions.AddUser();
                    break;
                }

                case 2:
                {
                    ProgrammActions.RemoveUser();
                    break;
                }

                case 3:
                {
                    ProgrammActions.DoExersize();
                    break;
                }

                case 4:
                {
                    ProgrammActions.GetStatistics();
                }
                break;

                case 5:
                {
                    ProgrammActions.ShowAllUsers();
                }
                break;

                default:
                {
                    Console.WriteLine("Command doesn't exists:");
                }
                break;
                }
                Console.WriteLine();
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            while (true)
            {
                ProgrammActions.ShowMenu();
                int.TryParse(Console.ReadLine(), out int userInput);
                switch (userInput)
                {
                case 1:
                {
                    ProgrammActions.InputAnimal();
                    break;
                }

                case 2:
                {
                    ProgrammActions.DeleteAnimal();
                    break;
                }

                case 3:
                {
                    ProgrammActions.GetAnimal();
                    break;
                }

                case 4:
                {
                    ProgrammActions.GetAllAnimals();
                    break;
                }

                case 5:
                {
                    Environment.Exit(0);
                }
                break;

                default:
                {
                    Console.WriteLine("Команда не найдена:");
                }
                break;
                }
                Console.WriteLine();
            }
        }
        static void Main()
        {
            Console.WriteLine("Welcome to the app!");
            while (true)
            {
                ProgrammActions.ShowMenu();
                int.TryParse(Console.ReadLine(), out int userInput);
                switch (userInput)
                {
                case 1:
                {
                    ProgrammActions.ShowAllCurrenciesAsync().GetAwaiter().GetResult();
                    break;
                }

                case 2:
                {
                    ProgrammActions.ShowCurrencyAsync().GetAwaiter().GetResult();
                    break;
                }

                case 3:
                {
                    ProgrammActions.ShowAllRatesToBynAsync().GetAwaiter().GetResult();
                    break;
                }

                case 4:
                {
                    ProgrammActions.ShowBynRateAsync().GetAwaiter().GetResult();
                    break;
                }

                case 5:
                {
                    ProgrammActions.ShowBynRateToDateAsync().GetAwaiter().GetResult();
                    break;
                }

                case 6:
                {
                    ProgrammActions.ShowAllBynRatesToDateAsync().GetAwaiter().GetResult();
                    break;
                }

                case 7:
                {
                    ProgrammActions.ShowRecordedDataAsync().GetAwaiter().GetResult();
                    break;
                }

                case 8:
                {
                    ProgrammActions.ClearAllDataAsync().GetAwaiter().GetResult();
                    break;
                }

                case 9:
                {
                    Environment.Exit(0);
                    break;
                }

                default:
                {
                    Console.WriteLine("Command doesn't exists:");
                }
                break;
                }
                Console.WriteLine();
            }
        }