Пример #1
0
        public static void GenerateGuessMenu()
        {
            var generateMenu      = new GenerateMenu();
            var accountController = new AccountController();

            while (true)
            {
                try
                {
                    Console.Clear();
                    Console.WriteLine("—— Ngân hàng Spring Hero Bank ——");
                    Console.WriteLine("1. Đăng ký tài khoản.");
                    Console.WriteLine("2. Đăng nhập hệ thống.");
                    Console.WriteLine("3. Thoát.");
                    Console.WriteLine("--------------------------------");
                    Console.WriteLine("Nhập lựa chọn của bạn (1, 2, 3): ");
                    var choice = int.Parse(Console.ReadLine());
                    switch (choice)
                    {
                    case 1:
                        accountController.Register();
                        break;

                    case 2:
                        accountController.Login();
                        break;

                    case 3:
                        Console.WriteLine("Goodbye!!!");
                        Environment.Exit(0);
                        break;

                    default:
                        Console.WriteLine("Chọn 1, 2 hoặc 3");
                        break;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                Console.ReadLine();
            }
        }
Пример #2
0
        public static void GenerateUserMenu()
        {
            var transactionController = new TransactionController();
            var accountController     = new AccountController();
            var generateMenu          = new GenerateMenu();

            while (true)
            {
                try
                {
                    Console.Clear();
                    Console.WriteLine("—— Ngân hàng Spring Hero Bank ——");
                    Console.WriteLine(
                        $"Chào mừng {AccountController.currentAccount.Fullname} quay trở lại. Vui lòng chọn thao tác:");
                    Console.WriteLine("1. Gửi tiền.");
                    Console.WriteLine("2. Rút tiền.");
                    Console.WriteLine("3. Chuyển khoản.");
                    Console.WriteLine("4. Truy vấn số dư.");
                    Console.WriteLine("5. Thay đổi thông tin cá nhân.");
                    Console.WriteLine("6. Thay đổi thông tin mật khẩu.");
                    Console.WriteLine("7. Truy vấn lịch sử giao dịch.");
                    Console.WriteLine("8. Đăng xuất");
                    Console.WriteLine("9. Thoát.");
                    Console.WriteLine("--------------------------------");
                    Console.WriteLine("Nhập lựa chọn của bạn (1-8): ");
                    var choice = int.Parse(Console.ReadLine());
                    switch (choice)
                    {
                    case 1:
                        transactionController.Deposit();
                        break;

                    case 2:
                        transactionController.Withdraw();
                        break;

                    case 3:
                        transactionController.Transfer();
                        break;

                    case 4:
                        accountController.BalanceQty();
                        break;

                    case 5:
                        accountController.UpdateAccountInfor();
                        break;

                    case 6:
                        accountController.UpdateAccountPassword();
                        break;

                    case 7:
                        transactionController.PrintListTransaction();
                        break;

                    case 8:
                        Console.WriteLine("Dang xuat");
                        break;

                    case 9:
                        Console.WriteLine("Goodbye!!!");
                        Environment.Exit(0);
                        break;

                    default:
                        Console.WriteLine("Chọn 1 - 9");
                        break;
                    }

                    if (choice == 8)
                    {
                        AccountController.currentAccount = null;
                        generateMenu.GetMenu(AccountController.currentAccount);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
                Console.ReadLine();
            }
        }
Пример #3
0
        public static void GenerateAdminMenu()
        {
            var generateMenu          = new GenerateMenu();
            var accountController     = new AccountController();
            var transactionController = new TransactionController();

            while (true)
            {
                try
                {
                    Console.Clear();
                    Console.WriteLine("—— Ngân hàng Spring Hero Bank ——");
                    Console.WriteLine(
                        $"Chào mừng Admin {AccountController.currentAccount.Fullname} quay trở lại. Vui lòng chọn thao tác:");
                    Console.WriteLine("1. Danh sách người dùng.");
                    Console.WriteLine("2. Danh sách lịch sử giao dịch.");
                    Console.WriteLine("3. Tìm kiếm người dùng theo tên.");
                    Console.WriteLine("4. Tìm kiếm người dùng theo số tài khoản.");
                    Console.WriteLine("5. Tìm kiếm người dùng theo số điện thoại.");
                    Console.WriteLine("6. Thêm người dùng mới.");
                    Console.WriteLine("7. Khoá và mở tài khoản người dùng.");
                    Console.WriteLine("8. Tìm kiếm lịch sử giao dịch theo số tài khoản.");
                    Console.WriteLine("9. Thay đổi thông tin tài khoản.");
                    Console.WriteLine("10. Thay đổi thông tin mật khẩu.");
                    Console.WriteLine("11. Đăng xuất.");
                    Console.WriteLine("12. Thoát.");
                    Console.WriteLine("--------------------------------");
                    Console.WriteLine("Nhập lựa chọn của bạn (1-12): ");
                    var choice = int.Parse(Console.ReadLine());
                    switch (choice)
                    {
                    case 1:
                        accountController.ListUser();
                        break;

                    case 2:
                        transactionController.PrintlistTransactionHistory();
                        break;

                    case 3:
                        accountController.FindUserByUsername();
                        break;

                    case 4:
                        accountController.FindUserByAccountNumber();
                        break;

                    case 5:
                        accountController.FindUserByPhone();
                        break;

                    case 6:
                        accountController.Register();
                        break;

                    case 7:
                        accountController.UpdateAccountStatus();
                        break;

                    case 8:
                        transactionController.PrintListTransaction();
                        break;

                    case 9:
                        accountController.UpdateAccountInfor();
                        break;

                    case 10:
                        accountController.UpdateAccountPassword();
                        break;

                    case 11:
                        Console.WriteLine("Đăng xuất");
                        break;

                    case 12:
                        Console.WriteLine("Goodbye!");
                        Environment.Exit(0);
                        break;

                    default:
                        Console.WriteLine("Hãy nhập từ 1 đến 12");
                        break;
                    }

                    if (choice == 11)
                    {
                        AccountController.currentAccount = null;
                        generateMenu.GetMenu(AccountController.currentAccount);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
                Console.ReadLine();
            }
        }
Пример #4
0
        public static void GenerateAdminMenu()
        {
            var generateMenu = new GenerateMenu();

            while (true)
            {
                try
                {
                    Console.Clear();
                    Console.WriteLine("—— Ngân hàng Spring Hero Bank ——");
                    Console.WriteLine(
                        $"Chào mừng Admin {AccountController.CurrentAccount.Fullname} quay trở lại. Vui lòng chọn thao tác:");
                    Console.WriteLine("1. Danh sách người dùng.");
                    Console.WriteLine("2. Danh sách lịch sử giao dịch.");
                    Console.WriteLine("3. Tìm kiếm người dùng theo tên.");
                    Console.WriteLine("4. Tìm kiếm người dùng theo số tài khoản.");
                    Console.WriteLine("5. Tìm kiếm người dùng theo số điện thoại.");
                    Console.WriteLine("6. Thêm người dùng mới.");
                    Console.WriteLine("7. Khoá và mở tài khoản người dùng.");
                    Console.WriteLine("8. Tìm kiếm lịch sử giao dịch theo số tài khoản.");
                    Console.WriteLine("9. Thay đổi thông tin tài khoản.");
                    Console.WriteLine("10. Thay đổi thông tin mật khẩu.");
                    Console.WriteLine("11. Đăng xuất.");
                    Console.WriteLine("12. Thoát.");
                    Console.WriteLine("--------------------------------");
                    Console.WriteLine("Nhập lựa chọn của bạn (1-12): ");
                    var choice = int.Parse(Console.ReadLine());
                    switch (choice)
                    {
                    case 1:
                        Console.WriteLine("Danh sách người dùng");
                        break;

                    case 2:
                        Console.WriteLine("Danh sách lịch sử giao dịch");
                        break;

                    case 3:
                        Console.WriteLine("Tìm kiếm người dùng theo tên");
                        break;

                    case 4:
                        Console.WriteLine("Tim kiem nguoi dung theo stk");
                        break;

                    case 5:
                        Console.WriteLine("Tìm kiếm người dùng theo số điện thoại");
                        break;

                    case 6:
                        Console.WriteLine("Them nguoi dung moi");
                        break;

                    case 7:
                        Console.WriteLine("Khoa va mo tai khoan nguoi dung");
                        break;

                    case 8:
                        Console.WriteLine("Tim kiem lich su giao dich theo stk");
                        break;

                    case 9:
                        Console.WriteLine("Thay doi thong tin tai khoan");
                        break;

                    case 10:
                        Console.WriteLine("Thay doi thong tin mat khau");
                        break;

                    case 11:
                        Console.WriteLine("Dang xuat");

                        break;

                    case 12:
                        Console.WriteLine("Thoat");
                        break;

                    default:
                        Console.WriteLine("Hãy nhập từ 1 đến 12");
                        break;
                    }

                    if (choice == 12)
                    {
                        break;
                    }

                    if (choice == 1)
                    {
                        AccountController.CurrentAccount = null;
                        generateMenu.GetMenu();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Bạn phải nhập vào 1 số");
                }
            }
        }