def create_worker_menu(worker_id, shop_id, name, surname, position): con.create_label("worker_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(worker_id, 2, 4) con.create_label("shop_id", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(shop_id, 2, 5) con.create_label("name", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(name, 2, 6) con.create_label("surname", label_height, 2, 1, 7, 1, 1, "white") con.create_entry(surname, 2, 7) con.create_label("position", label_height, 2, 1, 8, 1, 1, "white") con.create_entry(position, 2, 8)
def create_customer_menu(customer_id, name, raiting, worker_id): con.create_label("customer_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(customer_id, 2, 4) con.create_label("name", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(name, 2, 5) con.create_label("raiting", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(raiting, 2, 6) con.create_label("worker_id", label_height, 2, 1, 7, 1, 1, "white") con.create_entry(worker_id, 2, 7)
def create_assortment_menu(assortment_id, commodity_id, shop_id): con.create_label("assortment_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(assortment_id, 2, 4) con.create_label("commodity_id", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(commodity_id, 2, 5) con.create_label("shop_i", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(shop_id, 2, 6)
def create_shop_menu(shop_id, monthly_profit, address): con.create_label("shop_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(shop_id, 2, 4) con.create_label("monthly_profit", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(monthly_profit, 2, 5) con.create_label("address", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(address, 2, 6)
def create_order_menu(customer_id, order_id, assortment_id): con.create_label("customer_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(customer_id, 2, 4) con.create_label("order_id", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(order_id, 2, 5) con.create_label("assortment_id", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(assortment_id, 2, 6)
def create_commodity_menu(commodity_id, name, price): con.create_label("commodity_id", label_height, 2, 1, 4, 1, 1, "white") con.create_entry(commodity_id, 2, 4) con.create_label("name", label_height, 2, 1, 5, 1, 1, "white") con.create_entry(name, 2, 5) con.create_label("price", label_height, 2, 1, 6, 1, 1, "white") con.create_entry(price, 2, 6)
def create_delete_menu(): remove_unused_elements() delete_part_fields = { con.Assortment_str: 'assortment_id', con.Commodity_str: 'commodity_id', con.Order_str: 'order_id', con.Worker_str: 'worker_id', con.Shop_str: 'shop_id', con.Customer_str: 'customer_id' } current_field_name = delete_part_fields[con.current_table] value = StringVar() def delete_statement(): status, result = con.execute_query( con.delete_query.format(table=con.current_table, field=current_field_name, value=value.get())) con.text_label['text'] = status con.create_label(current_field_name, label_height, 2, 1, 4, 1, 1, "white") con.create_entry(value, 2, 4) con.create_button('delete', delete_statement, 1, 5)