Example #1
0
        public void BankLoginOptions()
        {
            employeeUI = new EmployeeUI(new EmployeeService());
            holderUI   = new AccountHolderUI(new AccountService());
            switch (EnumHelper.ConvertInEnum <LoginOption>(LoginUI.SelectLoginOption()))
            {
            case LoginOption.AdminLogin:
                bool result = adminUI.AdminLoginDisplay();
                if (result == true)
                {
                    EmployeeRelatedOption();
                }
                else
                {
                    BankLoginOptions();
                }
                break;

            case LoginOption.BankStaffLogin:

                bool Result = employeeUI.EmployeeLoginDisplay();
                if (Result == true)
                {
                    AccountHolderRelatedOption();
                }
                else
                {
                    BankLoginOptions();
                }
                break;

            case LoginOption.AccountHolderLogin:
                if (MasterBank.currentBank.accounts.Count == 0)
                {
                    DisplayHelper.PrintTextAtXY(65, 22, "THERE IS NO ACCOUNT HOLDER REGISTERED");
                    Thread.Sleep(1000);
                    BankLoginOptions();
                }
                else
                {
                    Result = holderUI.AccountLoginDisplay();
                    if (Result == true)
                    {
                        TransactionRelatedOption();
                    }
                    else
                    {
                        BankLoginOptions();
                    }
                }
                break;

            case LoginOption.ExitApplication:
                Thread.Sleep(1000);
                Environment.Exit(0);
                break;

            default:
                DisplayHelper.PrintTextAtXY(60, 22, "WRONG CHOICE ENTERED");
                Thread.Sleep(1000);
                BankLoginOptions();
                break;
            }
        }