Beispiel #1
0
    def signUp(self, pesel, name, surname, income, current=None):
        print('Registration requested by: ' + str(pesel))
        if any([pesel == account.pesel for account in accounts]):
            raise Bank.AccountException('Already signed up!')

        account = Bank.Account(
            pesel, name, surname, income, Bank.AccountType.PREMIUM
            if income >= premiumThreshold else Bank.AccountType.STANDARD,
            getNewPassword())
        accounts.append(account)

        return account.password
Beispiel #2
0
    def getState(self, current=None):
        print('Account state requested by: ' + current.ctx['pesel'])

        try:
            account = checkSignIn(int(current.ctx['pesel']),
                                  current.ctx['password'])
            if not account:
                raise Bank.AccountException(
                    'Please provide correct login info')
            else:
                return Bank.Account(account.pesel, account.name,
                                    account.surname, account.income,
                                    account.type, account.password)
        except ValueError:
            raise Bank.AccountException('Please provide correct arguments')
Beispiel #3
0
import tkinter as tk
import Bank
import Gui

a = Bank.Account(name='mishu1', balance=1250, num='12345')
b = Bank.Account(name='mishu2', balance=700, num='58304')
c = Bank.Account(name='mishu3', balance=2150, num='10385')
a.deposit(500)

root = tk.Tk()
root.geometry('300x450')
main_gui = Gui.Gui(tk, root=root)
main_gui.top.add_accounts(accounts=[a, b, c])
main_gui.show()