def CreateNewAccount(): gender_check_count = 3 while True: fullname = input("Enter FullName: ") username = input("Enter username: "******"Enter password : "******"Enter M or F: ") if gender not in ["M", "F"]: while True: gender_check_count -= 1 print("You must enter M or F") gender = input("Enter M or F: ") if gender_check_count <= 1: print("Try again later!!!") return False elif gender in ["M", "F"]: print(gender) pass #return gender #continue email = input("Enter your email: ") date_of_birth = input("Enter of bith: YYYY-MM--DD: ") account_type = input("Enter Savings or Current: ") opening_amount = int(input("Enter Initial opening amount: ")) query.query_db(query.insert_cusomer_data_query, fullname, username, password, gender, email, date_of_birth) query.query_db(query.insert_account_type, account_type, opening_amount) print("Your account is all set. Check Your email: ") print("Thank You Banking with US!!!") # SendEmail() exit(1)
def Cash_DepositDeposit(): account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] amount = input("Enter amount to deposit: ") query.query_db(query.transfer_to_query, amount, account_number) account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] print( "Your account has been credited with $ {} and your new balance is $ {}" .format(amount, balance))
def Cash_withdrawal(): account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] amount = input("Enter amount to Withdraw: ") if amount > balance: query.query_db(query.transfer_from_query, amount, account_number) account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] print( "Your account has been debited with $ {} and your new balance is $ {}" .format(amount, balance)) else: print("Insufficient Balance")
def display_dashboard(): #username,password=atmLogin() account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] print("**" * 15, "Welcome to CAS BANK", "**" * 20) print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print("**" * 15, datetime.now().strftime("%Y-%m-%d %H:%M"), "**" * 21) print('*', ' ' * 87, '*') print('*' * 5, 'Customername: {}'.format(fullname), '*' * 58) print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print('*' * 5, 'Acccount Number: {}'.format(account_number), '*' * 15, 'Balance: {}'.format(balance), '*' * 30) print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print("*" * 22, "Choose the below options for your Transcations", "*" * 21) print('*', ' ' * 87, '*') print("*" * 5, "Check Balance:1", "**" * 20, "Withdraw:2", "*" * 15) print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print("*" * 11, "Tranfer:3", "**" * 20, "Cash Deposit:4", "*" * 13) print('*', ' ' * 87, '*') print('*', ' ' * 87, '*') print("*" * 39, "THANK YOU {}", "*" * 30) print('*', ' ' * 87, '*') print("*" * 90)
def Cash_Transfer(): account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] amount = input("Enter Transfer Amount: ") receving_account = input("Enter Receiving account: ") receiver_name = query.query_db(query.receiver_name_query, receving_account) if amount < balance: query.query_db(query.transfer_to_query, amount, receving_account) query.query_db(query.transfer_from_query, amount, account_number) account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] print( "You have successfullly transfered ${} to {} and your new balance is ${}" .format(amount, receiver_name, balance)) else: print("Insufficient Balance")
def Check_bal(): account_number, balance, fullname, email = query.query_db( query.customer_info_query, 'kaka', 'kaka')[0] new_balance = query.query_db(query.balance_query, account_number) print("Your Balance is ${}".format(new_balance))