def run():
    """
    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
    """

    # your code
    options = ['Create',
               'Read',
               'Update',
               'Delete',
               'Show lowest prize item id',
               'Show items sold between given dates',
               'Show title by ID',
               'Show ID of the last sold item',
               'Show the sum of all item\'s prizes',
               'Show customer ID by sale ID',
               'Show all customer\'s ID',
               'Show all sales ID\'s for every customer ID',
               'Show number of sales per customer ID\'s']

    get_record_data = (['Title: ', 'Price: ', 'Month: ', 'Day: ', 'Year'], 'New title')
    title_list = ["id", "title", "price", "month", "day", "year"]
    file_name = 'model/sales/sales.csv'

    common.common_controlls(options, title_list, file_name, sales, get_record_data, True)
Esempio n. 2
0
def run():
    """
    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
    """

    # your code
    options = [
        'Create', 'Read', 'Update', 'Delete', 'Show oldest person',
        'Show closest person to avarage age in data'
    ]

    get_record_data = (['Person name: ', 'Birth year: '], 'New Person:')
    title_list = ["id", "name", "birth_year"]
    file_name = 'model/hr/persons.csv'

    common.common_controlls(options, title_list, file_name, hr,
                            get_record_data)
def run():
    """
    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
    """

    # your code
    options = ['Create',
               'Read',
               'Update',
               'Delete',
               'Show which items have not exceeded their durability',
               'Show avarage durability time for each manufacturer']

    get_record_data = (['Name: ', 'Manufacturer: ', 'Purchase year: ', 'Durability: '], 'New Record:')
    title_list = ["id", "name", "manufacturer", "purchase_year", "durability"]
    file_name = 'model/inventory/inventory.csv'

    common.common_controlls(options, title_list, file_name, inventory, get_record_data)
def run():
    """
    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
    """
    # your code
    options = [
        'Create', 'Read', 'Update', 'Delete',
        'Check how many different kinds of games in data',
        'Check avarage amount of games in stock of given manufacturer in data'
    ]

    get_record_data = (['Title: ', 'Manufacturer: ', 'Price: ',
                        'In stock: '], 'New Record:')
    title_list = ["id", "title", "manufacturer", "price", "in_stock"]
    file_name = 'model/store/games.csv'

    common.common_controlls(options, title_list, file_name, store,
                            get_record_data)
Esempio n. 5
0
def run():
    """
    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
    """

    # your code
    options = [
        'Create', 'Read', 'Update', 'Delete',
        'Show which year has the highest profit',
        'Show the avarage profit in given year for every transaction'
    ]
    get_record_data = (['Moth: ', 'Day: ', 'Year: ', 'Type: ',
                        'Amount'], 'New data:')
    title_list = ["id", "month", "day", "year", "type", "amount"]
    file_name = 'model/accounting/items.csv'

    common.common_controlls(options, title_list, file_name, accounting,
                            get_record_data)
Esempio n. 6
0
def run():
    """
    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
    """

    # your code
    options = [
        'Create', 'Read', 'Update', 'Delete',
        'Show the id of the customer with the longest name',
        'Show which customer has subcribed to the newsletter',
        'Show customer\'s name by ID'
    ]

    get_record_data = (['Name: ', 'Email: ', 'Subscribed: '], 'New person:')
    title_list = ["id", "name", "email", "subscribed"]
    file_name = 'model/crm/customers.csv'

    common.common_controlls(options, title_list, file_name, crm,
                            get_record_data, False)