Exemple #1
0
def add_new_account_func():
    print(" wer are going to add new account")
    newuser = User()
    uname = input("Please enter your name:")
    newuser.Name = uname
    print(f"Entered name is {uname}")

    uadress = input("please enter your adress:")
    newuser.Address = uadress
    print(f"entered adress is {uadress}")

    DOB = input("please enter your DOB:")  # string
    newuser.DOB = DOB  # convert DOB to datetime datatime
    print(f"entered DOB is {DOB}")

    umodel = newuser.AddToDB()
    typ = uaccounttypefunc()
    amodel = Account.AccountAddToDB(umodel, typ)

    uinitialdeposit = input(
        "please enter your initial amount of deposit (not less than 500):")
    print(f"entered initial amount of deposit is {uinitialdeposit}")
    t0 = Transaction()
    t0.amount = float(uinitialdeposit)
    t0.addTransactionToDB(amodel)
Exemple #2
0
    def whenPressed(self):

        u = User()
        u.Name = self.parent.uname.value
        u.Address = self.parent.address.value
        u.DOB = self.parent.dob.value

        umodel = u.AddToDB()

        amt = float(self.parent.initamount.value)

        atype = "SAVINGS"
        if self.parent.aType.values[0] == 0:
            atype = "SAVINGS"
        if self.parent.aType.values[0] == 1:
            atype = "CURRENTS"

        amodel = Account.AccountAddToDB(umodel, atype)

        # amt = float(self.initamount.value)
        t0 = Transaction()

        t0.amount = float(amt)
        t0.addTransactionToDB(amodel)