()
| 267 | |
| 268 | |
| 269 | def withdraw(): |
| 270 | frame1.grid_forget() |
| 271 | |
| 272 | def search_in_database(): |
| 273 | def go_page2(): |
| 274 | search_frame.grid_forget() |
| 275 | page2() |
| 276 | |
| 277 | global result |
| 278 | global acc_no |
| 279 | acc_no = entry11.get() |
| 280 | r = check_string_in_account_no(acc_no) |
| 281 | if len(acc_no) != 0 and r: |
| 282 | result = backend.check_acc_no(acc_no) |
| 283 | print(result) |
| 284 | if not result: |
| 285 | label = Label(search_frame, text="invalid account number") |
| 286 | label.grid(pady=2) |
| 287 | button = Button(search_frame, text="Exit", command=go_page2) |
| 288 | button.grid() |
| 289 | mainloop() |
| 290 | else: |
| 291 | |
| 292 | def deduct_money(): |
| 293 | new_money = entry12.get() |
| 294 | result = backend.deduct_balance(new_money, acc_no) |
| 295 | if result: |
| 296 | add_frame.grid_forget() |
| 297 | page2() |
| 298 | else: |
| 299 | label = Label(search_frame, text="Insufficient Balance") |
| 300 | label.grid(row=4) |
| 301 | |
| 302 | button = Button(search_frame, text="Exit", command=go_page2) |
| 303 | button.grid(row=5) |
| 304 | |
| 305 | mainloop() |
| 306 | |
| 307 | search_frame.grid_forget() |
| 308 | global add_frame |
| 309 | add_frame = Frame(tk) |
| 310 | add_frame.grid(padx=400, pady=300) |
| 311 | detail = backend.get_detail(acc_no) |
| 312 | |
| 313 | label = Label( |
| 314 | add_frame, text="Account holder name: {}".format(detail[0][0]) |
| 315 | ) |
| 316 | label.grid(row=0, pady=3) |
| 317 | |
| 318 | label = Label( |
| 319 | add_frame, text="Current amount: {}".format(detail[0][1]) |
| 320 | ) |
| 321 | label.grid(row=1, pady=3) |
| 322 | |
| 323 | label = Label(add_frame, text="Enter Money") |
| 324 | label.grid(row=2, pady=3) |
| 325 | global entry12 |
| 326 | entry12 = Entry(add_frame) |
nothing calls this directly
no test coverage detected