Example #1
0
    def search_in_database():
        def back_page2():
            search_frame.grid_forget()
            page2()

        global result
        global acc_no
        acc_no = entry11.get()
        r = check_string_in_account_no(acc_no)

        if len(acc_no) != 0 and r:
            result = backend.check_acc_no(acc_no)
            print(result)
            if not result:
                label = Label(search_frame, text="invalid account number")
                label.grid(pady=2)
                button = Button(search_frame, text="Exit", command=back_page2)
                button.grid()
                mainloop()
            else:

                def delete_check_frame():
                    check_frame.grid_forget()
                    page2()

                search_frame.grid_forget()
                balance = backend.check_balance(acc_no)
                global check_frame
                check_frame = Frame(tk)
                check_frame.grid(padx=500, pady=300)

                label = Label(check_frame,
                              text="Balance Is:{}".format(balance),
                              font="bold")
                label.grid(row=0, pady=4)

                button = Button(
                    check_frame,
                    text="Back",
                    command=delete_check_frame,
                    width=20,
                    height=2,
                    bg="red",
                )
                button.grid(row=1)

                mainloop()
        else:
            label = Label(search_frame, text="Enter correct entry")
            label.grid(pady=2)
            button = Button(search_frame, text="Exit", command=back_page2)
            button.grid()
            mainloop()
Example #2
0
    def search_in_database():
        def back_page2():
            search_frame.grid_forget()
            page2()
        global result
        global acc_no
        acc_no = entry11.get()
        r=check_string_in_account_no(acc_no)

        if len(acc_no)!=0 and r:
            result = backend.check_acc_no(acc_no)
            print(result)
            if not result:
                label = Label(search_frame, text="invalid account number")
                label.grid(pady=2)
                button = Button(search_frame, text="Exit", command=back_page2)
                button.grid()
                mainloop()
            else:
                def delete_check_frame():
                    check_frame.grid_forget()
                    page2()
                search_frame.grid_forget()
                balance=backend.check_balance(acc_no)
                global check_frame
                check_frame=Frame(tk)
                check_frame.grid(padx=500,pady=300)

                label=Label(check_frame,text='Balance Is:{}'.format(balance),font='bold')
                label.grid(row=0,pady=4)

                button=Button(check_frame,text='Back',command=delete_check_frame,width=20,height=2,bg='red')
                button.grid(row=1)

                mainloop()
        else:
            label = Label(search_frame, text="Enter correct entry")
            label.grid(pady=2)
            button = Button(search_frame, text="Exit", command=back_page2)
            button.grid()
            mainloop()