コード例 #1
0
        private static void DisplayResult(string id)
        {
            Console.WriteLine($"\r\nYour input ID is: {id}");

            var accounts = AccountManagement.ReadAccounts();

            try
            {
                int result = Int32.Parse(id);
                Console.WriteLine(result);
                foreach (var account in accounts)
                {
                    if (result.Equals(account.Number))
                    {
                        //Console.WriteLine(account);
                        PrintAccount(account);
                    }
                }

                Console.Write("\r\nPress Enter to return to Main Menu");
                Console.ReadLine();
            }
            catch (FormatException)
            {
                Console.Clear();
                Console.WriteLine($"Unable to parse '{id}'");
                Console.Write("\r\nPress Enter to return to Main Menu");
                Console.ReadLine();
            }
        }
コード例 #2
0
        private static void ViewAccount()
        {
            Console.Clear();

            var accounts = AccountManagement.ReadAccounts();

            ConsoleTable.From <Account>(accounts).Write();


            ClickWhenDone();
        }