-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdated
167 lines (162 loc) · 6.43 KB
/
updated
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
from tkinter import *
from tkinter import ttk
import os
import time
from db import *
def main_account_screen():
global main_screen
main_screen = Tk() # create a GUI window
main_screen.geometry("300x250") # set the configuration of GUI window
main_screen.title("XYZ Super Market") # set the title of GUI window
#login_screen.geometry("300x250")
Label(main_screen, text="Please enter details below to login").pack()
Label(main_screen, text="").pack()
global username_verify
global password_verify
username_verify = StringVar()
password_verify = StringVar()
Label(main_screen, text="Username ").pack()
username_login_entry = Entry(main_screen, textvariable=username_verify)
username_login_entry.pack()
Label(main_screen, text="").pack()
Label(main_screen, text="Password ").pack()
password__login_entry = Entry(main_screen, textvariable=password_verify, show= '*')
password__login_entry.pack()
Label(main_screen, text="").pack()
Button(main_screen, text="Login", width=10, height=1, command=verify).pack()
main_screen.mainloop()
def verify():
if(username_verify.get()=="hello" and password_verify.get()=="world"):
home_page()
else:
messagebox.showinfo("Title","invalid password")
main_screen.withdraw()
main_account_screen()
def home_page():
global screen
screen=Toplevel(main_screen)
screen.geometry("300x250")
Label(screen, text="Home Page").pack()
Label(screen, text="").pack()
Button(screen, text="ITEM",width=20, height=3,bd=10,command=item_page ).pack()
Button(screen, text="CUSTOMER", width=20, height=3,bd=10,command=customer_page).pack()
Button(screen, text="LOG OUT", width=10,height=1,command=main_account_screen).pack()
def item_page():
global item_screen
item_screen=Toplevel(main_screen)
item_screen.geometry("500x500")
Label(item_screen, text="Item Page").pack()
Button(item_screen, text="INSERT",width=20, height=3,bd=10,command=item_page_form).pack()
Button(item_screen, text="UPDATE",width=20, height=3,bd=10,command=update_item_form).pack()
Button(item_screen, text="DISPLAY",width=20, height=3,bd=10,command=None).pack()
Button(item_screen, text="DELETE",width=20, height=3,bd=10,command=delete_item_form).pack()
Button(item_screen, text="DISPLAY ALL",width=20, height=3,bd=10,command=display_item_form).pack()
Button(item_screen, text="Back",width=10,height=2,command=home_page).pack()
def customer_page():
global cus_screen
cus_screen=Toplevel(main_screen)
cus_screen.geometry("600x500")
Label(cus_screen, text="Customer Page").pack()
Button(cus_screen, text="INSERT",width=20, height=3,bd=10,command=customer_page_form).pack()
Button(cus_screen, text="UPDATE",width=20, height=3,bd=10,command=update_customer_form).pack()
Button(cus_screen, text="DISPLAY",width=20, height=3,bd=10,command=None).pack()
Button(cus_screen, text="DELETE",width=20, height=3,bd=10,command=delete_customer_form).pack()
Button(cus_screen, text="DISPLAY ALL",width=20, height=3,bd=10,command=display_customer_form).pack()
Button(cus_screen, text="UPDATE BALANCE",width=20, height=3,bd=10).pack()
Button(cus_screen, text="Back",width=10,height=2,command=home_page).pack()
def item_page_form():
global it
it=Toplevel(main_screen)
it.geometry("300x450")
Label(it,text="Item id").pack()
it_id=StringVar()
id1=Entry(it,textvariable=it_id).pack()
Label(it,text="Item name").pack()
it_name=StringVar()
id1=Entry(it,textvariable=it_name).pack()
Label(it,text="Item cost").pack()
it_cost=StringVar()
id1=Entry(it,textvariable=it_cost).pack()
Label(it,text="Item qnty").pack()
it_qnty=StringVar()
id1=Entry(it,textvariable=it_qnty).pack()
Button(it,text="Submit",width=10,height=2).pack()
#insert_item(it_id,it_name,it_cost,it_qnty)
def update_item_form():
global uit
uit=Toplevel(main_screen)
uit.geometry("300x250")
Label(uit,text="Item id").pack()
uit_id=StringVar()
id1=Entry(uit,textvariable=uit_id).pack()
Label(uit,text="Item name").pack()
uit_name=StringVar()
uid1=Entry(uit,textvariable=uit_name).pack()
Label(uit,text="Item cost").pack()
uit_cost=StringVar()
id1=Entry(uit,textvariable=uit_cost).pack()
Label(uit,text="Item qnty").pack()
uit_qnty=StringVar()
uid1=Entry(uit,textvariable=uit_qnty).pack()
Button(uit,text="Submit",width=10,height=2).pack()
def delete_item_form():
global dit
dit=Toplevel(main_screen)
dit.geometry("300x250")
Label(dit,text="Item id").pack()
dit_id=StringVar()
dit1=Entry(dit,textvariable=dit_id).pack()
Button(dit,text="Delete",width=10,height=2).pack()
def customer_page_form():
global ct
ct=Toplevel(main_screen)
ct.geometry("300x250")
Label(ct,text="customer id").pack()
ct_id=StringVar()
cd1=Entry(ct,textvariable=ct_id).pack()
Label(ct,text="customer name").pack()
ct_name=StringVar()
cd1=Entry(ct,textvariable=ct_name).pack()
Label(ct,text="customer mob").pack()
ct_mob=StringVar()
cd1=Entry(ct,textvariable=ct_mob).pack()
Label(ct,text="customer balance").pack()
ct_bal=StringVar()
cd1=Entry(ct,textvariable=ct_bal).pack()
Button(ct,text="Submit",width=10,height=2,command=ct.withdraw).pack()
#insert_customer(ct_id,ct_name,ct_mob,ct_bal)
def update_customer_form():
global uct
uct=Toplevel(main_screen)
uct.geometry("300x250")
Label(uct,text="customer id").pack()
uct_id=StringVar()
cd1=Entry(uct,textvariable=uct_id).pack()
Label(uct,text="customer name").pack()
uct_name=StringVar()
cd1=Entry(uct,textvariable=uct_name).pack()
Label(uct,text="customer mob").pack()
uct_mob=StringVar()
cd1=Entry(uct,textvariable=uct_mob).pack()
Button(uct,text="Submit",width=10,height=2).pack()
def delete_customer_form():
global dt
dt=Toplevel(main_screen)
dt.geometry("300x250")
Label(dt,text="customer id").pack()
dt_id=StringVar()
dd1=Entry(dt,textvariable=dt_id).pack()
Button(dt,text="Delete",width=10,height=2).pack()
def display_item_form():
global dif
dif=Toplevel(main_screen)
dif.geometry("300x250")
var = StringVar()
msg = Message(dif,text=display_item).pack()
def display_customer_form():
global dcf
dcf=Toplevel(main_screen)
dcf.geometry("300x250")
var = StringVar()
msg = Message(dcf,text=Display_customer).pack()
main_account_screen()