def associate_menu(): menu({ "1": { "info": "show all associates", "func": show_all_associates }, "2": { "info": "show associate by id", "func": show_associate_by_id }, "3": { "info": "search associate", "func": search_associates_menu }, "4": { "info": "update an associate or contact person by id and column", "func": update_menu }, "5": { "info": "add an associate", "func": add_associate }, "6": { "info": "delete associate by id", "func": drop_associate_by_id } })
def search_associates_menu(): ass_column = ac.get_columns() def inner(column): return lambda: show_associate_by_columnvalue(column) menu({str(i+1): {"info": a, "func": inner(a)} for i, a in enumerate(ass_column[0:-1])})
def product_menu(): menu({ "1": { "info": "Show all products", "func": get_all_products }, "2": { "info": "Get product by id", "func": get_product_by_id }, "3": { "info": "Get products by name", "func": get_products_by_name }, "4": { "info": "Filter & Search products by column", "func": search_products_menu }, "5": { "info": "Update product by ID and column", "func": update_product }, "6": { "info": "Add a product", "func": add_product }, "7": { "info": "Delete product", "func": delete_product_by_id } })
def order_menu(): menu({ "1": { "info": "get all orders", "func": get_all_orders }, "2": { "info": "get order by id", "func": get_order_by_id }, "3": { "info": "search orders", "func": search_orders_menu }, "4": { "info": "update a order by id and column", "func": update_order }, "5": { "info": "add a order", "func": add_order }, "6": { "info": "drop order by id", "func": drop_order_by_id } })
def shop_menu(): menu({ "1": { "info": "show all shops", "func": show_all_shops }, "2": { "info": "show shop by id", "func": show_shop_by_id }, "3": { "info": "search shops", "func": search_shops_menu }, "4": { "info": "update a shop by id and column", "func": update_shop }, "5": { "info": "add a shop", "func": add_shop }, "6": { "info": "drop shop by id", "func": drop_shop_by_id } })
def car_menu(): menu({ "1": { "info": "get all cars", "func": get_all_cars }, "2": { "info": "get car by license number", "func": get_car_by_licensenumber }, "3": { "info": "search cars", "func": search_cars_menu }, "4": { "info": "update a car by column", "func": update_car }, "5": { "info": "add a car", "func": add_car }, "6": { "info": "drop car", "func": drop_car_by_licensenumber } })
def compatibility_menu(): menu({ "1": { "info": "get all compatibilitys", "func": get_all_compatibilitys }, "2": { "info": "get compatibility by id", "func": get_compatibility_by_id }, "3": { "info": "search compatibilitys", "func": search_compatibilitys_menu }, "4": { "info": "update a compatibility by id and column", "func": update_compatibility }, "5": { "info": "add a compatibility", "func": add_compatibility }, "6": { "info": "drop compatibility by id", "func": drop_compatibility_by_id } })
def customer_menu(): menu({ "1": { "info": "get all customers", "func": get_all_customers }, "2": { "info": "get customer by id", "func": get_customer_by_id }, "3": { "info": "get customers by name", "func": get_customers_by_name }, "4": { "info": "search customers", "func": search_customers_menu }, "5": { "info": "update a customer by id and column", "func": update_customer }, "6": { "info": "add a customer", "func": add_customer }, "7": { "info": "drop customer by id", "func": drop_customer_by_id } })
def employee_menu(): menu({ "1": { "info": "get all employees", "func": get_all_employees }, "2": { "info": "get employee by id", "func": get_employee_by_id }, "3": { "info": "get employees by name", "func": get_employees_by_name }, "4": { "info": "search employees", "func": search_employees_menu }, "5": { "info": "update a employee by id and column", "func": update_employee }, "6": { "info": "add a employee", "func": add_employee }, "7": { "info": "drop employee by id", "func": drop_employee_by_id } })
def internal_order_menu(): menu({ "1": { "info": "get all internal_orders", "func": get_all_internal_orders }, "2": { "info": "get internal_order by id", "func": get_internal_order_by_id }, "3": { "info": "search internal_orders", "func": search_internal_orders_menu }, "4": { "info": "update a internal_order by id and column", "func": update_internal_order }, "5": { "info": "add a internal_order", "func": add_internal_order }, "6": { "info": "drop internal_order by id", "func": drop_internal_order_by_id } })
def car_model_menu(): menu({ "1": { "info": "get all car_models", "func": get_all_car_models }, "2": { "info": "get car_model by id", "func": get_car_model_by_id }, "3": { "info": "search car_models", "func": search_car_models_menu }, "4": { "info": "update a car_model by column", "func": update_car_model }, "5": { "info": "add a car_model", "func": add_car_model }, "6": { "info": "drop car_model", "func": drop_car_model_by_id } })
def storage_menu(): menu({ "1": { "info": "get all storages", "func": get_all_storages }, "2": { "info": "get storage by id", "func": get_storage_by_id }, "3": { "info": "search storages", "func": search_storages_menu }, "4": { "info": "update a storage by id and column", "func": update_storage }, "5": { "info": "add a storage", "func": add_storage }, "6": { "info": "drop storage by id", "func": drop_storage_by_id } })
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_menu(): menu({ "1": { "info": "update associate", "func": update_associate, }, "2": { "info": "update contact person", "func": update_contact_person, } })
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 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 search_storages_menu(): def inner(column): return lambda: get_storages_by_columnvalue(column) menu({ str(i + 1): { "info": c, "func": inner(c) } for i, c in enumerate(cc.get_columns()) })
def update_car_model(): print("enter a car_model id: ") c_id = f_input() car_model = cc.get_car_model_by_id(c_id) def inner(column, car_model): return lambda: update_car_model_column(column, car_model) menu({ str(i + 1): { "info": c, "func": inner(c, car_model) } 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_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_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_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_shop(): print("enter a Shop id: ") shop_id = f_input() shop = sc.show_shop_by_id(shop_id) def inner(column, shop): return lambda: update_shop_column(column, shop) menu({ str(i + 1): { "info": s, "func": inner(s, shop) } for i, s in enumerate(sc.get_columns()) })
def update_product(): pass print("Enter a product id: ") product = pc.get_product_by_id(f_input()) def inner(column, product): return lambda: update_product_column(column, product) menu({ str(i + 1): { "info": p, "func": inner(p, product) } for i, p in enumerate(pc.get_columns()) })
def update_customer_car(): print("enter a license number: ") 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 add_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": bind_add_customer_car(customer) } })
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 product_associate_menu(): menu({ "1": { "info": "get all product_associates", "func": get_all_product_associates }, "2": { "info": "search product_associates", "func": search_product_associates_menu }, "3": { "info": "update a product_associate by id and column", "func": update_product_associate }, "4": { "info": "add a product_associate", "func": add_product_associate }, "5": { "info": "drop product_associate by id", "func": drop_product_associate_by_id } })
def order_product_menu(): menu({ "1": { "info": "get all order_products", "func": get_all_order_products }, "2": { "info": "search order_products", "func": search_order_products_menu }, "3": { "info": "update a order_product by id and column", "func": update_order_product }, "4": { "info": "add a order_product", "func": add_order_product }, "5": { "info": "drop order_product by id", "func": drop_order_product_by_id } })
def customer_car_menu(): menu({ "1": { "info": "get all customer_cars", "func": get_all_customer_cars }, "2": { "info": "search customer_cars", "func": search_customer_cars_menu }, "3": { "info": "update a customer_car by id and column", "func": update_customer_car }, "4": { "info": "add a customer_car", "func": add_customer_car }, "5": { "info": "drop customer_car by license number", "func": drop_customer_car_by_license_number } })