private void GoToShowCommands() { if ("all" == commands[1].ToLower()) { if (dataStore is IShow) { IShow store = (IShow)dataStore; Console.Clear(); Console.WriteLine("| ID\t| NAME\t|\tAGE\t|\tPHONE\t\t|"); Console.WriteLine(new string('-', 65)); foreach (Person person in store.ShowAll()) { Console.WriteLine(person); } Console.ReadLine(); } else { throw new ArgumentException("Wrong object"); } } else if (Int32.Parse(commands[1]) > 0) { if (dataStore is IShow) { IShow store = (IShow)dataStore; Console.Clear(); Console.WriteLine("| ID\t| NAME\t|\tAGE\t|\tPHONE\t\t|"); Console.WriteLine(new string('-', 65)); Console.WriteLine(store.ShowOnePerson(Int32.Parse(commands[1]))); Console.ReadLine(); } else { throw new ArgumentException("Wrong object"); } } else { throw new ArgumentException("Input command is incorrect"); } }