Example #1
0
        private static void MainMenu()
        {
            try
            {
                var personBirthday = new Birthday();

                Write("Enter your year birthday: ");
                personBirthday.Year = int.Parse(ReadLine());

                Write("Enter your month birthday: ");
                personBirthday.Month = int.Parse(ReadLine());

                Write("Enter your day birthday: ");
                personBirthday.Day = int.Parse(ReadLine());

                personBirthday.BirthDay();
                personBirthday.NextBirthDay();
            }
            catch (Exception exception)
            {
                WriteLine($"Error: {exception.Message}");
                WriteLine();
                WriteLine("Try again.Enter any key...");
                ReadKey();
                Clear();
                MainMenu();
            }
        }