Ejemplo n.º 1
0
def customer_check(cs_details):
    if (cs_details['type'] == 'short'):
        return -1
    else:
        key = search_cs(cs_details)

    if (key != -1):
        return key
    else:
        try:
            s = CRUD.retrieve_lastcustomer()
            last_id = s[0][0]
            new_id = int(last_id) + 1
        except IndexError:
            new_id = 0
        CRUD.add_customer(new_id, cs_details['customerFirst'],
                          cs_details['customerLast'], cs_details['mobile'],
                          cs_details['address'])
        return new_id
Ejemplo n.º 2
0
def dummy():
    CRUD.add_customer(0, '-', '-', 0, '-')