def add_product_associate(): insert_dict = {} for column in cc.get_columns(): insert_dict[column] = input(f'{column}: ') divider() product_associate = cc.add_product_associate(insert_dict)
def add_shop_storage(): insert_dict = {} for column in cc.get_columns(): insert_dict[column] = input(f'{column}: ') divider() shop_storage = cc.add_shop_storage(insert_dict)
def add_product_internal_order(): insert_dict = {} for column in cc.get_columns(): insert_dict[column] = input(f'{column}: ') divider() product_internal_order = cc.add_product_internal_order(insert_dict)
def add_compatibility(): insert_dict = {} for column in cc.get_columns(): insert_dict[column] = input(f'{column}: ') divider() compatibility = cc.add_compatibility(insert_dict)
def add_employee(): insert_dict = {} for column in cc.get_columns(): if column != "id": insert_dict[column] = input(f'{column}: ') divider() employee = cc.add_employee(insert_dict)
def add_order(): insert_dict = {} for column in cc.get_columns(): if column != "id": insert_dict[column] = input(f'{column}: ') divider() order = cc.add_order(insert_dict)
def add_internal_order(): insert_dict = {} for column in cc.get_columns(): if column != "id": if column == "lead_time": insert_dict[column] = datetime.datetime.now() else: insert_dict[column] = input(f'{column}: ') divider() internal_order = cc.add_internal_order(insert_dict)
def add_car(): insert_dict = {} for column in cc.get_columns(): if column != "id": insert_dict[column] = input(f'{column}: ') car = cc.add_car(insert_dict) if car: print_tablerow(car) divider() return car
def add_customer_car(): insert_dict = {} for column in cc.get_columns(): insert_dict[column] = input(f'{column}: ') divider() customer_car = cc.add_customer_car(insert_dict) if customer_car: refresh_row(customer_car) print_tablerow(customer_car) divider()
def combine_customer_car(customer_id, car_id): insert_dict = {"CustomerId": customer_id, "CarId": car_id} for column in cc.get_columns(): if column != "CustomerId" and column != "CarId": insert_dict[column] = input(f'{column}: ') divider() customer_car = cc.add_customer_car(insert_dict) if customer_car: refresh_row(customer_car) print_tablerow(customer_car)
def add_associate(): insert_dict = {} for column in ac.get_columns(): if column != "id": insert_dict[column] = input(f'{column}: ') if column == 'contact_person_id': contact_person = create_contact_person() insert_dict[column] = contact_person.id divider() associate = ac.add_associate(insert_dict) if associate: print_tablerow(associate)
def add_customer(): def inner(customer): return lambda: add_customer_car(customer) insert_dict = {} for column in cc.get_columns(): if column != "id": insert_dict[column] = input(f'{column}: ') divider() customer = cc.add_customer(insert_dict) if customer: print_tablerow(customer) menu({ "1": { "info": "add car", "func": inner(customer) } })