def start_module():
    """
    Starts this module and displays its menu.
     * User can access default special features from here.
     * User can go back to main menu from here.

    Returns:
        None
    """
    exit_message = main.handle_menu()
    title = "Human resources manager"
    list_options = ['Show table Hr', 'Add user', 'remove' , 'update', 'Olders','Closeset Yesr' 'exit program' ]
    ui.print_manu(title, list_options, exit_message)

    table = data_manage.get
    inputs = ui.get_inputs(["Please enter a number: "], "")
    option = inputs[0]
    if option == "1":
        show_table(table)
    elif option == "2":
        add(table, id_)
    elif option == "3":
        remove(table, id_)
    elif option == "4":
        update(table)
    elif option == "5":
        get_oldest_person(table)
    elif option == "6":
        get_persons_closest_to_average(table)
    elif option == "0":
        main.handle_menu()
Пример #2
0
def start_module():
    exit_message = main.handle_menu()
    title= 'Sales'
    list_options = [
        "Show table", "Add new record", "Remove record", "Update record",
        "Lowest Price item","Which items are sold between two given dates?"
    ]
    ui.print_menu('Sales', list_options, exit_message)

    file_name = "sales.csv"
    inputs = ui.get_inputs(["number: "], "Choose menu option.")
    option = inputs[0]

    table = data_manager.get_table_from_file("accounting/items.csv")

    if option == ["1"]:
        show_table(table)
    elif option == ["2"]:
        add(table)
    elif option == ["3"]:
        ui.get_inputs(["id: "], "Enter id of record to be deleted.")
        id_ = ui.get_inputs(["id: "], "Enter id of record to be deleted.")[0]
    elif option == ["4"]:
        ui.get_inputs(["id: "], "Ented id of record to be updated")
        id_ = ui.get_inputs(["id: "], "Ented id of record to be updated")
        update(table, id_)
    elif option == ["5"]:
        get_lowest_price_item_id(table)
    elif option == ["6"]:
        get_items_sold_between(table, month_from, day_from, year_from, month_to, day_to, year_to)
    elif option == ["0"]:
        main.main()