def GMSVTableChoices(): while True: gmsv = ui.GMSVMenu('Display a table on...') if gmsv in ['1', '2', '3', '4', 'b']: break else: message('Please enter a valid selection') if gmsv == 'b': return else: createTable(gmsv)
def GMSVMenuChoices(choice): while True: if choice == '1': gmsv = ui.GMSVMenu('Add a new record on...') elif choice == '2': gmsv = ui.GMSVMenu('Update an existing record on...') elif choice == '3': gmsv = ui.GMSVMenu('Delete an existing record on...') if gmsv in ['1', '2', '3', '4', 'b']: break else: message('Please enter a valid selection') # If user selected back to main menu, exit function and back to main menu if gmsv == 'b': return if choice == '1': insertData(gmsv) elif choice == '2': updateData(gmsv) elif choice == '3': deleteData(gmsv)
def GMSVSearchChoices(): while True: gmsv = ui.GMSVMenu('Search on...') if gmsv in ['1', '2', '3', '4', 'b']: break else: message('Please enter a valid selection') if gmsv == 'b': return # games elif gmsv == '1': while True: gameSearch = ui.gamesSearchMenu() if gameSearch in ['1', '2', '3', 'b']: break else: message('Please enter a valid selection') if gameSearch == 'b': return # run search function(gameSearch) searchData(gmsv, gameSearch) # merchandise elif gmsv == '2': while True: mercSearch = ui.mercSearchMenu() if mercSearch in ['1', '2', '3', 'b']: break else: message('Please enter a valid selection') if mercSearch == 'b': return # run search function(mercSearch) searchData(gmsv, mercSearch) # sales elif gmsv == '3': while True: salesSearch = ui.salesSearchMenu() if salesSearch in ['1', '2', '3', 'b']: break else: message('Please enter a valid selection') if salesSearch == 'b': return # run search function(salesSearch) searchData(gmsv, salesSearch) # venues elif gmsv == '4': while True: venuesSearch = ui.venuesSearchMenu() if venuesSearch in ['1', '2', 'b']: break else: message('Please enter a valid selection') if venuesSearch == 'b': return # run search function(venuesSearch) searchData(gmsv, venuesSearch)