Ejemplo n.º 1
0
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
        }
    })
Ejemplo n.º 2
0
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
        }
    })
Ejemplo n.º 3
0
def customer_menu():
    menu({
        "1": {
            "info": "get all customers",
            "func": show_all_customers
        },
        "2": {
            "info": "get customer by id",
            "func": show_customer_by_id
        },
        "3": {
            "info": "get customers by name",
            "func": show_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
        },
        "8": {
            "info": "get a customers cars by id",
            "func": get_customers_cars
        }
    })
Ejemplo n.º 4
0
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
        }
    })
Ejemplo n.º 5
0
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
        }
    })
Ejemplo n.º 6
0
def car_menu():
    menu({
        "1": {
            "info": "get all cars",
            "func": get_all_cars
        },
        "2": {
            "info": "get car by id",
            "func": get_car_by_id
        },
        "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 by id",
            "func": drop_car_by_id
        }
    })
Ejemplo n.º 7
0
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
        }
    })
Ejemplo n.º 8
0
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
        }
    })
Ejemplo n.º 9
0
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
        }
    })
Ejemplo n.º 10
0
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
        }
    })
Ejemplo n.º 11
0
def update_customer():
    customer = get_customer_by_id()

    def inner(column, customer):
        return lambda: update_customer_column(column, customer)

    menu({str(i + 1): {"info": c, "func": inner(c, customer)} for i, c in enumerate(cc.get_columns())})
Ejemplo n.º 12
0
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())})
Ejemplo n.º 13
0
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())})
Ejemplo n.º 14
0
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())})
Ejemplo n.º 15
0
def search_internal_orders_menu():
    def inner(column):
        return lambda: get_internal_orders_by_columnvalue(column)

    menu({
        str(i + 1): {
            "info": c,
            "func": inner(c)
        }
        for i, c in enumerate(cc.get_columns())
    })
Ejemplo n.º 16
0
def search_shop_storages_menu():
    def inner(column):
        return lambda: get_shop_storages_by_columnvalue(column)

    menu({
        str(i + 1): {
            "info": c,
            "func": inner(c)
        }
        for i, c in enumerate(cc.get_columns())
    })
Ejemplo n.º 17
0
def search_product_associates_menu():
    def inner(column):
        return lambda: get_product_associates_by_columnvalue(column)

    menu({
        str(i + 1): {
            "info": c,
            "func": inner(c)
        }
        for i, c in enumerate(cc.get_columns())
    })
Ejemplo n.º 18
0
def update_menu():
    menu({
        "1": {
            "info": "update associate",
            "func": update_associate,
        },
        "2": {
            "info": "update contact person",
            "func": update_contact_person,
        }
    })
Ejemplo n.º 19
0
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])
    })
Ejemplo n.º 20
0
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())
    })
Ejemplo n.º 21
0
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())
    })
Ejemplo n.º 22
0
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())
    })
Ejemplo n.º 23
0
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())
    })
Ejemplo n.º 24
0
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())
    })
Ejemplo n.º 25
0
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())
    })
Ejemplo n.º 26
0
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())
    })
Ejemplo n.º 27
0
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])
    })
Ejemplo n.º 28
0
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)
            }
        })
Ejemplo n.º 29
0
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 product_internal_order_menu():
    menu({
        "1": {
            "info": "get all product_internal_orders",
            "func": get_all_product_internal_orders
        },
        "2": {
            "info": "search product_internal_orders",
            "func": search_product_internal_orders_menu
        },
        "3": {
            "info": "update a product_internal_order by id and column",
            "func": update_product_internal_order
        },
        "4": {
            "info": "add a product_internal_order",
            "func": add_product_internal_order
        },
        "5": {
            "info": "drop product_internal_order by id",
            "func": drop_product_internal_order_by_id
        }
    })