Professional Documents
Culture Documents
import sqlite3
mydb = sqlite3.connect('Products.db')
my_cursor = mydb.cursor()
#####################################################################################
#########
#####################################################################################
#########
root = Tk()
# All functions
def additem():
try:
e1 = entry1.get()
e2 = entry2.get()
e3 = entry3.get()
e4 = entry4.get()
e5 = entry5.get()
try:
if (e1 != "" and e2 != "" and e3 != "" and e4 != "" and e5 != "" ):
my_cursor.execute(
mydb.commit()
entry1.delete(0, END)
entry2.delete(0, END)
entry3.delete(0, END)
entry4.delete(0, END)
entry5.delete(0, END)
messagebox.showinfo(
else:
else:
except ValueError:
except:
messagebox.showerror(
"Duplicate", "You are trying to insert a item which is already present in database")
def delete1():
e6 = entry6.get()
my_cursor.execute(
data = my_cursor.fetchone()
if (data != None):
my_cursor.execute(
mydb.commit()
messagebox.showinfo(
else:
else:
def showdatabase():
root1 = Tk()
root1.configure(bg="Grey")
mytext1 = my_cursor.fetchall()
mytext.insert(
mytext.insert(END, " {0} \t\t {1} \t\t {2} \t\t {3} \t\t {4}\n".format(
mytext.pack(side=LEFT)
entry.delete(0, END)
entry.unbind('<Button-1>', on_click)
def searchitem():
entry1.delete(0, END)
entry2.delete(0, END)
entry3.delete(0, END)
entry4.delete(0, END)
entry5.delete(0, END)
e6 = entry6.get()
if e6 == "SEARCH" or e6 == "":
messagebox.showwarning(
"Warning", "Please first enter item name for search")
else:
my_cursor.execute(
mytext1 = my_cursor.fetchone()
exist")
else:
entry1.insert(0, mytext1[0])
entry2.insert(0, mytext1[1])
entry3.insert(0, mytext1[2])
entry4.insert(0, mytext1[3])
entry5.insert(0, mytext1[4])
def update():
entry1.delete(0, END)
entry2.delete(0, END)
entry3.delete(0, END)
entry4.delete(0, END)
entry5.delete(0, END)
entry6.delete(0, END)
root2 = Tk()
root2.title("About")
root2.configure(width=900, height=500, bg="Grey")
text = '''This is a GUI application which can be used to maintain the Stationary Items.\n
In this, a Shopkeeper can maintain his purchased Items. He can add Items whenever he want by
adding all the writing all Details of the Item and clicking on the ADD ITEM and automatically all items
in database, he or she can delete by specifying the details which he or she wants to delete and
If Shopkeeper wants to View the Items he or She has Purchased or bought by just clicking on the
If Shopkeeper wants to check whether the item is already been loaded or not or to check the details
of the item, he or she can Type the Name of the Item(which is located on the top of search button)
and clicking the search Button and all the details will be displayed.\n
While entering any Details of an item, if Shopkeeper wrote wrong details, he or she can click on
CLEAR SCREEN button to clear all current entries written by the Shopkeeper. \n
If a Shopkeeper wants to exit the Application, he or she can click EXIT button to close the Application.'''
entry1.delete(0, END)
entry2.delete(0, END)
entry3.delete(0, END)
entry4.delete(0, END)
entry5.delete(0, END)
entry6.delete(0, END)
def qExit():
qExit=messagebox.askyesno(
"Quit System", "Do you want to quit? \n Project By :\n Arpit Dadhich\n Thank You....!!")
if qExit > 0:
root.destroy()
return
buttoncolor="#49D810"
buttonfg="black"
entry6.insert(0, "SEARCH")