def submit_Function():
    name = uname.get()
    department = udepart.get()
    doj = udoj.get()
    salary = usal.get()
    id = uid.get()
    password = upass.get()
    import re
    pattern1 = "^[a-zA-z0-9!@#$%^&*]{8,}"
    if re.match(pattern1, password):
        a = dbo.emp_registration(name, department, doj, salary, id, password)
        if a == 1:
            tkmsg.showinfo(title="SUCCESSFUL",
                           message="REGISTRATION DONE SUCCESSFULLY!")
            destroy_window()
            emp_options.vp_start_gui()
        elif a == 2:
            tkmsg.showerror(title="ERROR", message="REGISTRATION FAILED!")
            clear_Function()
        elif a == 3:
            tkmsg.showerror(
                title="ERROR",
                message="EMPLOYEE ID ALREADY EXISTS! PLEASE USE ANOTHER ID!")
            clear_Function()
    else:
        tkmsg.showerror(
            title="INVALID FORMAT",
            message=
            "Entered password must contain one alphabet, one non-alphanumeric chracter, one numric character and size of password should not be less than 8"
        )
        clear_Function()
    sys.stdout.flush()
def submit_Function():
    title = btitle.get()
    subject = bsub.get()
    author = bauthor.get()
    a = dbo.book_registration(title, subject, author)
    if a == 1:
        tkmsg.showinfo(title="SUCCESSFUL",
                       message="NEW BOOK ADDED TO RECORD\nTHANK YOU!")
    elif a == 0:
        tkmsg.showerror(title="ERROR", message="BOOK CANNOT BE ADDED")
    destroy_window()
    emp_options.vp_start_gui()
    sys.stdout.flush()
def return_Function():
    id = bid.get()
    roll = sroll.get()
    a = dbo.return_book(id, roll)
    if a == 1:
        tkmsg.showinfo(title="RETURNED",
                       message="BOOK RETURNED TO LIBRARY SUCCESSFULLY!")
        destroy_window()
        emp_options.vp_start_gui()
    elif a == 0:
        tkmsg.showerror(title="ERROR", message="BOOK CANNOT BE RETURNED!")
        clear_Function()
    sys.stdout.flush()
Beispiel #4
0
def login_Function():
    id = uid.get()
    password = upassword.get()
    import Db_Operations as dbo
    a = dbo.login(id,password)
    import tkMessageBox as tkmsg
    if a == 1:
        tkmsg.showinfo(title="SUCCESSFUL",message="LOGIN SUCCESSFUL")
        destroy_window()
        emp_options.vp_start_gui()
    elif a == 0:
        tkmsg.showerror(title="LOGIN ERROR",message="LOGIN ID OR PASSWORD INCORRECT")
        clear_Function()
    sys.stdout.flush()
def issue_Function():
    id = bid.get()
    roll = sroll.get()
    a = dbo.issue(id, roll)
    if a == 1:
        tkmsg.showinfo(title="GRANTED", message="BOOK ISSUED TO '%s'" % (roll))
        destroy_window()
        emp_options.vp_start_gui()
    elif a == 2:
        tkmsg.showinfo(title="ERROR", message="BOOK DOESN'T EXIST IN LIBRARY!")
        clear_Function()
    elif a == 3:
        tkmsg.showinfo(title="ERROR",
                       message="STUDENT NOT REGISTERED IN LIBRARY!")
        clear_Function()
    elif a == 4:
        tkmsg.showerror(title="ERROR", message="BOOK ALREADY ISSUED!!")
    sys.stdout.flush()
def delete_Function():
    id = bid.get()
    a = dbo.delete_book(id)
    if a == 1:
        tkmsg.showinfo(title="STATUS", message="BOOK DELETED SUCCESSFULLY!")
        destroy_window()
        emp_options.vp_start_gui()
    elif a == 2:
        tkmsg.showerror(title="STATUS", message="BOOK DOESN'T EXIST!")
        destroy_window()
        emp_options.vp_start_gui()
    elif a == 3:
        tkmsg.showerror(title="ERROR", message="BOOK CAN'T BE DELETED!")
        destroy_window()
        emp_options.vp_start_gui()
    sys.stdout.flush()
def back_Function():
    destroy_window()
    emp_options.vp_start_gui()
    sys.stdout.flush()