コード例 #1
0
ファイル: frontend.py プロジェクト: SilvesSun/Python
def page1():
    def back_to_main2():
        admin_frame.grid_forget()
        global frame
        frame = Frame(tk, bg='black')
        frame.grid(padx=500, pady=250)

        button = Button(frame, text="Admin", command=admin_login)
        button.grid(row=0, pady=20)

        button = Button(frame, text="Employee", command=employee_login)
        button.grid(row=1, pady=20)

        button = Button(frame, text="Exit", command=tk.destroy)
        button.grid(row=2, pady=20)
        tk.mainloop()

        mainloop()

    name=entry1.get()
    password=entry2.get()
    if len(name)!=0 and len(password)!=0:
        result=backend.check_admin(name,password)
        print(result)
        if result:
            admin_frame.grid_forget()

            global page1_frame
            page1_frame = Frame(tk, bg='black')
            page1_frame.grid(padx=500, pady=200)

            button10 = Button(page1_frame, text="New Employee", command=create_employee, width=20, height=2)
            button10.grid(row=0, pady=6)

            button11 = Button(page1_frame, text="Update detail", command=update_employee, width=20, height=2)
            button11.grid(row=1, pady=6)

            button13 = Button(page1_frame, text="Show All Employee", command=show_employee, width=20, height=2)
            button13.grid(row=2, pady=6)

            button11 = Button(page1_frame, text="Total Money", command=Total_money, width=20, height=2)
            button11.grid(row=3, pady=6)

            button12 = Button(page1_frame, text="Back", command=back_to_main, width=20, height=2)
            button12.grid(row=4, pady=6)

            mainloop()
        else:
            label=Label(admin_frame,text="Invalid id and pasasword")
            label.grid(row=6,pady=10)
            button=Button(admin_frame,text='Exit',command=back_to_main2)
            button.grid(row=7)
            mainloop()
    else:
        label = Label(admin_frame, text="Please fill All Entries")
        label.grid(row=6, pady=10)
        button = Button(admin_frame, text='Exit', command=back_to_main2)
        button.grid(row=7)
        mainloop()
コード例 #2
0
def page1():
    def back_to_main2():
        admin_frame.grid_forget()
        global frame
        frame = Frame(tk, bg='black')
        frame.grid(padx=500, pady=250)

        button = Button(frame, text="Admin", command=admin_login)
        button.grid(row=0, pady=20)

        button = Button(frame, text="Employee", command=employee_login)
        button.grid(row=1, pady=20)

        button = Button(frame, text="Exit", command=tk.destroy)
        button.grid(row=2, pady=20)
        tk.mainloop()

        mainloop()

    name = entry1.get()
    password = entry2.get()
    if len(name) != 0 and len(password) != 0:
        result = backend.check_admin(name, password)
        print(result)
        if result:
            admin_frame.grid_forget()

            global page1_frame
            page1_frame = Frame(tk, bg='black')
            page1_frame.grid(padx=500, pady=200)

            button10 = Button(page1_frame,
                              text="New Employee",
                              command=create_employee,
                              width=20,
                              height=2)
            button10.grid(row=0, pady=6)

            button11 = Button(page1_frame,
                              text="Update detail",
                              command=update_employee,
                              width=20,
                              height=2)
            button11.grid(row=1, pady=6)

            button13 = Button(page1_frame,
                              text="Show All Employee",
                              command=show_employee,
                              width=20,
                              height=2)
            button13.grid(row=2, pady=6)

            button11 = Button(page1_frame,
                              text="Total Money",
                              command=Total_money,
                              width=20,
                              height=2)
            button11.grid(row=3, pady=6)

            button12 = Button(page1_frame,
                              text="Back",
                              command=back_to_main,
                              width=20,
                              height=2)
            button12.grid(row=4, pady=6)

            mainloop()
        else:
            label = Label(admin_frame, text="Invalid id and pasasword")
            label.grid(row=6, pady=10)
            button = Button(admin_frame, text='Exit', command=back_to_main2)
            button.grid(row=7)
            mainloop()
    else:
        label = Label(admin_frame, text="Please fill All Entries")
        label.grid(row=6, pady=10)
        button = Button(admin_frame, text='Exit', command=back_to_main2)
        button.grid(row=7)
        mainloop()