MCPcopy Index your code
hub / github.com/geekcomputers/Python / on_search_submit

Function on_search_submit

bank_managment_system/QTFrontend.py:1545–1566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1543 name_field, balance_field, action_button = form_widgets
1544
1545 def on_search_submit():
1546 try:
1547 account_number = int(search_input.text().strip())
1548 except ValueError:
1549 show_popup_message(
1550 stacked_widget, "Please enter a valid account number.", search_index
1551 )
1552 return
1553
1554 if backend.check_acc_no(account_number):
1555 account_data = backend.get_details(account_number)
1556 name_field.setText(str(account_data[1]))
1557 balance_field.setText(str(account_data[4]))
1558 stacked_widget.setCurrentIndex(page_index)
1559 else:
1560 show_popup_message(
1561 stacked_widget,
1562 "Account not found",
1563 search_index,
1564 show_cancel=True,
1565 cancel_page=EMPLOYEE_MENU_PAGE,
1566 )
1567
1568 def on_action_submit():
1569 try:

Callers

nothing calls this directly

Calls 3

show_popup_messageFunction · 0.85
check_acc_noMethod · 0.80
get_detailsMethod · 0.80

Tested by

no test coverage detected