def login_menu(): """ Login Menu - Create Account / Log In / Quit """ while True: view.print_login_menu() choice = view.login_menu_prompt().strip() if choice not in ("1", "2", "3"): """ bad input """ view.bad_login_input() return login_menu() elif choice == "3": """ 3. Quit """ view.goodbye() return None # return None for quit elif choice == "1": """ 1. Create Account """ create_account() elif choice == "2": """ 2. Log In """ account = view.login_account_num() pin = view.login_pin() account_data = model.login(account, pin) if account_data != None: return main_menu(account_data) else: view.bad_account_login()
def homepage(): while True: view.show_homepage() selection = view.get_input() if selection != '1' and selection != '2' and selection != '3': view.bad_selection() elif selection == '1': customer = get_user_info() if customer[2] != customer[3]: view.no_pin_match() else: new_customer = model.create_account(customer) logged_in_homepage(new_customer) return elif selection == '2': name = view.login_name() pin = view.login_pin() if model.login_user(name, pin): customer = model.login_user(name, pin) logged_in_homepage(customer) return else: view.invalid_login() pass elif selection == '3': view.goodbye() return
def mainmenu(selection): while True: if selection == '3': model.save() break ### this is not exiting the program elif selection == '1': firstname = view.First() lastname = view.Last() genpin = view.create_PIN() model.create_account(firstname,lastname,genpin) model.save() run() elif selection == '2': checkac = view.login_ac() checkpin = view.login_pin() if model.login_verify(checkac,checkpin) == True: secondary() else: run() else: view.bad_input() run()
def mainmenu(selection): while True: if selection == '3': bank.save() exit() elif selection == '1': firstname = view.First() lastname = view.Last() genpin = view.create_PIN() bank.create_account(firstname, lastname, genpin) bank.save() run() elif selection == '2': checkac = view.login_ac() checkpin = view.login_pin() if bank.login_verify(checkac, checkpin) == True: secondary() else: run() else: view.bad_input() run()
def login_menu(): while True: view.print_login_menu() choice = view.login_menu_prompt().strip() if choice not in ("1", "2", "3"): view.bad_login_input() return login_menu() elif choice == "3": view.goodbye() return None # return None for quit elif choice == "1": create_account() """ TODO: prompt for firstname, lastname, and pin, and confirm pin create the account and then tell the user what their new account number is """ elif choice == "2": """ TODO: prompt functions to ask for account and PIN, use try, except to check for bad login """ account = view.login_account_num() pin = view.login_pin() account_data = model.login(account, pin) return main_menu(account_data)