Пример #1
0
 public static void StartSession()
 {
     inputInt = conCom.AskInputNumber("Write down the number of songs you want in your playlist and press Enter");
     //CREATE SESSION
     if (!(inputInt <= 0))
     {
         var traingSession = new SessionList();
         traingSession.DisplaySongs(inputInt);
     }
     else
     {
         Console.WriteLine($"Not a valid number!\n");
     }
 }
Пример #2
0
        public static void StartSession()
        {
            Console.WriteLine("Write down the number of songs you want in your playlist and press Enter");
            string input = Console.ReadLine();

            try {
                int number = int.Parse(input.ToString());
                if (!(number <= 0))
                {
                    var traingSession = new SessionList();
                    traingSession.DisplaySongs(number);
                }
                else
                {
                    Console.WriteLine($"{ input } is not a valid number!\n");
                }
            } catch {
                Console.WriteLine($"{ input } in not a valid number!\n");
            }
        }