def ReTry(): user = app.getEntry("User Name") session = ATM.Control(user) pwd = app.getEntry("Password") session.Login(pwd) if session.Login(pwd) == 2: app.addLabel("Wrong Password") ReTry() else: Manager()
def Dep(btn): if btn == "Deposit": amount = app.getEntry("Amount") session = ATM.Control(app.getEntry("User Name")) session.Login(app.getEntry("Password")) session = ATM.Accounts(app.getEntry("User Name")) session.Deposit(float(amount)) app.clearEntry("Amount") elif btn == "Withdraw": amount = app.getEntry("Amount") session = ATM.Control(app.getEntry("User Name")) session.Login(app.getEntry("Password")) session = ATM.Accounts(app.getEntry("User Name")) session.WithDraw(float(amount)) app.clearEntry("Amount") if session.WithDraw(float(amount)) == 4: print("Reeeeeee") app.addLabel("Not enough money") app.clearEntry("Amount") else: app.stop()
def LoginBtn(button): if button == "Cancel": app.stop() elif button == "Submit": user = app.getEntry("User Name") session = ATM.Control(user) pwd = app.getEntry("Password") session.Login(pwd) if session.Login(pwd) == 1: Manager() elif session.Login(pwd) == 2: app.addLabel("Wrong Password") ReTry() else: print('WTF') Sign()