static bool CheckAdmClient(IСustomer user) { if (user is Admin) { return(true); } return(false); }
public static void ShowDisplay(IСustomer user) { Console.WriteLine("\tMain screen."); if (CheckAdmClient(user)) { Console.WriteLine("Hello, Admin!"); while (true) { Console.WriteLine("Select an action by choosing number."); Console.WriteLine("1. Withdraw money. 2. Show balance. 3. Delete Client. 4. Exit."); string actionAdmin = Console.ReadLine(); switch (actionAdmin) { case "1": //some break; case "2": //some break; case "3": //some break; case "4": return; default: Console.WriteLine("Invalid command. Try again."); break; } } } else { Console.WriteLine("Hello, Client!"); while (true) { Console.WriteLine("Select an action by choosing number."); Console.WriteLine("1. Withdraw money. 2. Show balance. 3. Exit."); string actionAdmin = Console.ReadLine(); switch (actionAdmin) { case "1": //some break; case "2": //some break; case "3": return; default: Console.WriteLine("Invalid command. Try again."); break; } } } }