示例#1
0
def getMatch():

    game = Game()
    print('\nAVAILABLE MATCHES\n')
    game.viewGames()
    mID = int(input('Enter match you want to book for: '))
    if game.gameVerify(mID) != 1:
        print('The match id you entered is invalid!\nPlease Try Again!!\n')
        getMatch()

    return mID
示例#2
0
def manageGames():

    print(
        "\n\nWelcome To the stadium ticket booking system!\nAdmin Menu\nManage Games\n"
        "1. View all Games\n"
        "2. Add Game\n"
        "3. Remove Game\n"
        "4. Edit Game\n"
        "5. Reset\n"
        "6. Exit\n"
    )

    choice = int(input("Enter your choice: "))

    game = Game()

    if choice == 1:
        game.viewGames()

    elif choice == 2:
        gameName = input('Enter game Name: ')
        date = input('Enter game Date: ')
        time = input('Enter game Time: ')
        game.addGame(gameName,date,time)
    elif choice == 3:
        gID = input('Enter game ID to remove: ')
        try: 
            game.removeGame(gID)
        except:
            print('\nGame not found!\n')
    elif choice == 4:
        gID = input('Enter game ID to Edit: ')
        game.editGame(gID) 
    elif choice == 5:
        game.resetTable()
    elif choice == 6:
        return
    else:
        print('The Choice you entered is invalid!\nPlease Try Again!!\n')
        manageGames()
    manageGames()