()
| 443 | page2() |
| 444 | |
| 445 | def show_all_updateble_content(): |
| 446 | def back_to_page2_from_update(): |
| 447 | update_customer_frame.grid_forget() |
| 448 | page2() |
| 449 | |
| 450 | # defining a function whose makes a update entry and submit butoon side to name button |
| 451 | def update_name(): |
| 452 | # def a function eho updates name in database |
| 453 | def update_name_in_database(): |
| 454 | new_name = entry_name.get() |
| 455 | r = check_string_in_account_no(new_name) |
| 456 | if len(new_name) != 0: |
| 457 | # function in backend that updates name in table |
| 458 | backend.update_name_in_bank_table(new_name, acc_no) |
| 459 | entry_name.destroy() |
| 460 | submit_button.destroy() |
| 461 | name_label.destroy() |
| 462 | else: |
| 463 | tkinter.messagebox.showinfo("Error", "Please fill blanks") |
| 464 | entry_name.destroy() |
| 465 | submit_button.destroy() |
| 466 | name_label.destroy() |
| 467 | |
| 468 | global entry_name |
| 469 | global name_label |
| 470 | name_label = Label(update_customer_frame, text="Enter new name") |
| 471 | name_label.grid(row=1, column=1) |
| 472 | entry_name = Entry(update_customer_frame) |
| 473 | entry_name.grid(row=1, column=2, padx=2) |
| 474 | global submit_button |
| 475 | submit_button = Button( |
| 476 | update_customer_frame, text="Update", command=update_name_in_database |
| 477 | ) |
| 478 | submit_button.grid(row=1, column=3) |
| 479 | |
| 480 | # defing a function who make gui fro age |
| 481 | def update_age(): |
| 482 | # def a function eho updates name in database |
| 483 | def update_age_in_database(): |
| 484 | new_age = entry_name.get() |
| 485 | r = check_string_in_account_no(new_age) |
| 486 | if len(new_age) != 0 and r: |
| 487 | # function in backend that updates name in table |
| 488 | backend.update_age_in_bank_table(new_age, acc_no) |
| 489 | entry_name.destroy() |
| 490 | submit_button.destroy() |
| 491 | age_label.destroy() |
| 492 | else: |
| 493 | tkinter.messagebox.showinfo("Error", "Please enter age") |
| 494 | entry_name.destroy() |
| 495 | submit_button.destroy() |
| 496 | age_label.destroy() |
| 497 | |
| 498 | global age_label |
| 499 | age_label = Label(update_customer_frame, text="Enter new Age:") |
| 500 | age_label.grid(row=2, column=1) |
| 501 | global entry_name |
| 502 | entry_name = Entry(update_customer_frame) |
nothing calls this directly
no test coverage detected