def sign_up():

    customer = Customer()
    first_name = input("Enter First Name\n")
    last_name = input("Enter Last Name\n")
    address = input("Enter Address\n")
    password = input("Enter password (min 8 char and max 20 char)\n")
    while len(password) < 8 or len(password) > 20:
        print("Please Enter password in given range\n")
        password = input()

    customer.set_first_name(first_name)
    customer.set_last_name(last_name)
    customer.set_password(password)
    customer.set_address(address)
    database.sign_up_customer(customer)
Esempio n. 2
0
def sign_up():
    print("\n\t-- SIGN UP --\n")
    customer = Customer()
    first_name = input("First Name: ")
    last_name = input("Last Name: ")
    add_line1 = input("Address Line 1: ")
    add_line2 = input("Address Line 2(optional): ")
    if not add_line2:
        add_line2 = ' '
    city = input("City: ")
    state = input("State: ")
    try:
        pincode = int(input("Pincode: "))
        while pincode < 100000 or pincode > 999999:
            print("ERROR: Invalid Pincode")
            pincode = int(input("Pincode: "))

    except:
        print("ERROR: Pincode only contains Numbers")
        pincode = int(input("Pincode: "))

    password = input("Choose a password (min 8 char and max 20 char): ")
    while len(password) < 8 or len(password) > 20:
        print("ERROR: Password should be in the given range\n")
        password = input()

    customer.set_first_name(first_name)
    customer.set_last_name(last_name)
    customer.set_password(password)
    customer.set_status("open")
    customer.set_login_attempts(3)

    addr = Address()
    addr.set_line_1(add_line1)
    addr.set_line_2(add_line2)
    addr.set_city(city)
    addr.set_state(state)
    addr.set_pincode(pincode)

    customer.set_address(addr)
    database.sign_up_customer(customer)
    print("\nNOTE: Keep this ID and Dont share it with anyone!")
    input("Press any key to continue ...")
    system('CLS')
    print("\n##### Welcome To ONLINE BANKING TERMINAL #####\n")
def sign_up():

    customer = Customer()
    first_name = input("Enter First Name\n")
    last_name = input("Enter Last Name\n")
    add_line1 = input("Enter Address Line 1\n")
    add_line2 = input("Enter Address Line 2\n")
    city = input("Enter City\n")
    state = input("Enter State\n")
    try:
        pincode = int(input("Enter Pincode\n"))
        if pincode < 100000 or pincode > 999999:
            print("Invalid Pincode")
            return
    except:
        print("Invalid Pincode")
        return

    password = input("Enter password (min 8 char and max 20 char)\n")
    while len(password) < 8 or len(password) > 20:
        print("Please Enter password in given range\n")
        password = input();

    customer.set_first_name(first_name)
    customer.set_last_name(last_name)
    customer.set_password(password)
    customer.set_status("open")
    customer.set_login_attempts(3)

    addr = Address()
    addr.set_line_1(add_line1)
    addr.set_line_2(add_line2)
    addr.set_city(city)
    addr.set_state(state)
    addr.set_pincode(pincode)

    customer.set_address(addr)

    database.sign_up_customer(customer)
Esempio n. 4
0
def sign_up():

    customer = Customer()
    first_name = input("Enter First Name\n")
    if len(first_name) == 0:
        print("Field can't be blank")
        return
    last_name = input("Enter Last Name\n")
    if len(last_name) == 0:
        print("Field can't be blank")
        return
    add_line1 = input("Enter Address Line 1\n")
    if len(add_line1) == 0:
        print("Field can't be blank")
        return
    add_line2 = input("Enter Address Line 2\n")
    if len(add_line2) == 0:
        print("Field can't be blank")
        return
    city = input("Enter City\n")
    if len(city) == 0:
        print("Field can't be blank")
        return
    state = input("Enter State\n")
    if len(state) == 0:
        print("Field can't be blank")
        return
    try:
        pincode = int(input("Enter Pincode\n"))
        if pincode < 100000 or pincode > 999999:
            print("Invalid Pincode")
            return
    except:
        print("Invalid Pincode")
        return

    password = input("Enter password (min 8 char and max 20 char)\n")
    while len(password) < 8 or len(password) > 20:
        print("Please Enter password in given range\n")
        password = input()

    customer.set_first_name(first_name)
    customer.set_last_name(last_name)
    customer.set_password(password)
    customer.set_status("open")
    customer.set_login_attempts(3)

    addr = Address()
    addr.set_line_1(add_line1)
    addr.set_line_2(add_line2)
    addr.set_city(city)
    addr.set_state(state)
    addr.set_pincode(pincode)

    customer.set_address(addr)
    try:
        database.sign_up_customer(customer)
    except cx_Oracle.DatabaseError as e:
        print("Sorry something went Wrong")
        print(e)
        con.rollback()
        return