def drop_associate_by_id(): print("Enter an Associate id to delete Associate") a_id = int(f_input()) associate = ac.show_associate_by_id(a_id) cp_id = associate.contact_person_id print('Do you want to delete contact person as well?\n' '1: Yes\n' '2: No') if int(f_input()) == 1: ac.drop_associate(a_id) cpc.drop_cp(cp_id) print(f'Successfully deleted {associate.name} & contact person') print('========================================================') elif int(f_input()) == 2: ac.drop_associate(a_id) print(f'Successfully deleted {associate.name}') else: return
def get_product_associates_by_columnvalue(column_name): print(f"enter searchvalue for {column_name}") name = f_input() product_associates = cc.get_product_associates_by_columnvalue( column_name, name) print_list_of_tablerows(product_associates) print_amount_matches(product_associates)
def get_car_by_id(): print("Enter a id") c_id = f_input() car = cc.get_car_by_id(c_id) if car: print_tablerow(car) else: print("not found")
def show_associate_by_id(): print("Enter an Associate Id") a_id = f_input() associate = ac.show_associate_by_id(a_id) if associate: print_tablerow(associate) cp_id = associate.contact_person_id print(f'Do you want to show >{associate.name}s< contact person?\n' '1: Yes\n' '2: No') if int(f_input()) == 1: contact_person = cpc.show_cp_by_id(cp_id) print_tablerow(contact_person) else: return
def update_employee(): print("enter a employee id: ") c_id = f_input() employee = cc.get_employee_by_id(c_id) def inner(column, employee): return lambda: update_employee_column(column, employee) menu({str(i + 1): {"info": c, "func": inner(c, employee)} for i, c in enumerate(cc.get_columns())})
def update_storage(): print("enter a storage id: ") c_id = f_input() storage = cc.get_storage_by_id(c_id) def inner(column, storage): return lambda: update_storage_column(column, storage) menu({ str(i + 1): { "info": c, "func": inner(c, storage) } for i, c in enumerate(cc.get_columns()) })
def update_order_product(): print("enter a id: ") c_id = f_input() order_product = cc.get_order_product_by_id(c_id) def inner(column, order_product): return lambda: update_order_product_column(column, order_product) menu({ str(i + 1): { "info": c, "func": inner(c, order_product) } for i, c in enumerate(cc.get_columns()) })
def update_customer_car(): print("id: ") c_id = f_input() customer_car = cc.get_customer_car_by_id(c_id) def inner(column, customer_car): return lambda: update_customer_car_column(column, customer_car) menu({ str(i + 1): { "info": c, "func": inner(c, customer_car) } for i, c in enumerate(cc.get_columns()) })
def update_internal_order(): print("enter a internal_order id: ") c_id = f_input() internal_order = cc.get_internal_order_by_id(c_id) def inner(column, internal_order): return lambda: update_internal_order_column(column, internal_order) menu({ str(i + 1): { "info": c, "func": inner(c, internal_order) } for i, c in enumerate(cc.get_columns()) })
def update_compatibility(): print("enter a compatibility id: ") c_id = f_input() compatibility = cc.get_compatibility_by_id(c_id) def inner(column, compatibility): return lambda: update_compatibility_column(column, compatibility) menu({ str(i + 1): { "info": c, "func": inner(c, compatibility) } for i, c in enumerate(cc.get_columns()) })
def update_product_associate(): print("enter a id: ") c_id = f_input() product_associate = cc.get_product_associate_by_id(c_id) def inner(column, product_associate): return lambda: update_product_associate_column(column, product_associate) menu({ str(i + 1): { "info": c, "func": inner(c, product_associate) } for i, c in enumerate(cc.get_columns()) })
def update_associate(): print("enter an Associate id: ") a_id = f_input() associate = ac.show_associate_by_id(a_id) ass_column = ac.get_columns() def inner(column, associate): return lambda: update_associate_column(column, associate) menu({ str(i + 1): { "info": a, "func": inner(a, associate) } for i, a in enumerate(ass_column[0:-1]) })
def update_contact_person(): print("enter an Associate id: ") a_id = f_input() associate = ac.show_associate_by_id(a_id) cp_id = associate.contact_person_id contact_person = cpc.show_cp_by_id(cp_id) def inner(column, contact_person): return lambda: update_contact_person_column(column, contact_person) menu({ str(i + 1): { "info": cp, "func": inner(cp, contact_person) } for i, cp in enumerate(cpc.get_columns()) })
def drop_product_internal_order_by_id(): print("Enter a id to delete product_internal_order") c_id = int(f_input()) cc.drop_product_internal_order_by_id(c_id)
def update_product_internal_order_column(column, product_internal_order): print("Enter new value: ") value = f_input() cc.update_product_internal_order_column(product_internal_order, column, value) print_tablerow(product_internal_order)
def drop_internal_order_by_id(): print("Enter a internal_order id to delete internal_order") c_id = int(f_input()) cc.drop_internal_order(c_id)
def get_internal_orders_by_columnvalue(column_name): print(f"enter searchvalue for {column_name}") name = f_input() internal_orders = cc.get_internal_orders_by_columnvalue(column_name, name) print_list_of_tablerows(internal_orders) print_amount_matches(internal_orders)
def get_internal_order_by_id(): print("Enter a InternalOrder Id") c_id = f_input() internal_order = cc.get_internal_order_by_id(c_id) print_tablerow(internal_order)
def get_orders_by_name(): print("Enter a Order Name") c_name = f_input() orders = cc.get_orders_by_name(c_name) print_list_of_tablerows(orders) print_amount_matches(orders)
def update_employee_column(column, employee): print("Enter new value: ") value = f_input() cc.update_employee_column(employee, column, value) print_tablerow(employee)
def update_car_column(column, car): print("Enter new value: ") value = f_input() cc.update_car_column(car, column, value) print_tablerow(car)
def get_employees_by_columnvalue(column_name): print(f"enter searchvalue for {column_name}") name = f_input() employees = cc.get_employees_by_columnvalue(column_name, name) print_list_of_tablerows(employees) print_amount_matches(employees)
def drop_car_by_id(): print("Enter a id to delete car") c_id = f_input() cc.drop_car(c_id)
def update_product_associate_column(column, product_associate): print("Enter new value: ") value = f_input() cc.update_product_associate_column(product_associate, column, value) print_tablerow(product_associate)
def update_order_column(column, order): print("Enter new value: ") value = f_input() cc.update_order_column(order, column, value) print_tablerow(order)
def drop_employee_by_id(): print("Enter a employee id to delete employee") c_id = int(f_input()) cc.drop_employee(c_id)
def get_employee_by_id(): print("Enter a Employee Id") c_id = f_input() employee = cc.get_employee_by_id(c_id) print_tablerow(employee)
def get_order_by_id(): print("Enter a Order Id") c_id = f_input() order = cc.get_order_by_id(c_id) print_tablerow(order)
def drop_product_associate_by_id(): print("Enter a id to delete product_associate") c_id = int(f_input()) cc.drop_product_associate_by_id(c_id)
def get_employees_by_name(): print("Enter a Employee Name") c_name = f_input() employees = cc.get_employees_by_name(c_name) print_list_of_tablerows(employees) print_amount_matches(employees)