private static void GenerateTransactionMenu(GiaoDich giaoDich) { while (true) { Console.WriteLine("Please select the transaction type."); Console.WriteLine("=================================="); Console.WriteLine("1. Withdraw."); Console.WriteLine("2. Deposit."); Console.WriteLine("3. Transfer."); Console.WriteLine("4. Exit."); Console.WriteLine("==================================="); Console.WriteLine("Please enter your choice: "); var choice1 = int.Parse(Console.ReadLine()); switch (choice1) { case 1: giaoDich.Withdraw(); break; case 2: giaoDich.Deposit(); break; case 3: giaoDich.Transfer(); break; case 4: break; default: Console.WriteLine("Wrong choice, please try again!"); break; } if (choice1 == 4) { Console.WriteLine("Bye! see you again!"); currentLoggedInAccount = null; currentLoggedInAddress = null; break; } } }
private static void GenerateTransactionMenu(GiaoDich giaoDich) { while (true) { Console.Clear(); Console.WriteLine("Transaction Options"); Console.WriteLine("============================================"); Console.WriteLine("1. Withdraw."); Console.WriteLine("2. Deposit."); Console.WriteLine("3. Transfer."); Console.WriteLine("4. Exit."); Console.WriteLine("============================================"); Console.WriteLine("Enter your choice: "); var choice = int.Parse(Console.ReadLine()); switch (choice) { case 1: giaoDich.Withdrawal(); break; case 2: giaoDich.Deposit(); break; case 3: giaoDich.Transfer(); break; case 4: Console.WriteLine("Exit completed"); break; default: Console.WriteLine("Wrong option. Please try again."); break; } if (choice == 4) { break; } } }