コード例 #1
0
ファイル: CreateOrder.py プロジェクト: Amonty638/NTD-Database
def create_new_customer():
    customer = Customer()
    print("Pleas enter the following information: ")
    print("Customer first name")
    customer.set_fname(input())

    print("Customer last name")
    customer.set_lname(input())

    print("Customer street address")
    customer.set_saddress(input())

    print("Customer city")
    customer.set_city(input())

    print("Customer zip code")
    customer.set_zip(input())

    print("Customer state")
    customer.set_state(input())

    print("Customer phone number")
    customer.set_phone(input())

    print("Customer email")
    customer.set_email(input())

    customer_dao = CustomerDAO()
    customer_dao.insert_customer(customer)
    print("|------------------------|")
    print("|      Create Order      |")
    print("|------------------------|")
    print("")
    create_order()
コード例 #2
0
def addCustomer():

    customerDao = CustomerDAO()

    while True:
        print("Enter the Phone# of a customer you would like to add")

        phone_num = input()

        customer_exists = verifyPhoneNum(phone_num)

        if customer_exists == True:
            print(
                "A customer with that phone# already exists, please try again")
            print("")

        else:
            customer = Customer()
            print("Enter customer's first name")
            fname = input()
            print("Enter customer's last name")
            lname = input()
            print("Enter customer's city")
            city = input()
            print("Enter customer's state")
            state = input()
            print("Enter customer's zip code")
            zip = input()
            print("Enter customer's street address")
            saddress = input()
            print("Enter customer's email")
            email = input()

            customer.set_fname(fname)
            customer.set_lname(lname)
            customer.set_city(city)
            customer.set_state(state)
            customer.set_zip(zip)
            customer.set_saddress(saddress)
            customer.set_email(email)
            customer.set_phone(phone_num)

            customerDao.insert_customer(customer)
            break