-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession12(a).py
More file actions
54 lines (34 loc) · 1.06 KB
/
session12(a).py
File metadata and controls
54 lines (34 loc) · 1.06 KB
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
from tkinter import *
# import Session12
from session12 import Customer
from session12 import DBHelper
#from Session12 import *
# cRef = Session12.Customer("John", "+91 99999 88888", "john@example.com")
# cRef.showCustomerDetails()
def onClick():
print("Button Clicked")
cRef = Customer(None, None, None)
cRef.name = entryName.get()
cRef.phone = entryPhone.get()
cRef.email = entryEmail.get()
cRef.showCustomerDetails()
db = DBHelper()
db.saveCustomerInDB(cRef)
window = Tk()
lblTitle = Label(window, text="Add Customer Details")
lblTitle.pack()
lblName = Label(window, text="Enter Customer Name")
lblName.pack()
entryName = Entry(window)
entryName.pack()
lblPhone = Label(window, text="Enter Customer Phone")
lblPhone.pack()
entryPhone = Entry(window)
entryPhone.pack()
lblEmail = Label(window, text="Enter Customer Email")
lblEmail.pack()
entryEmail = Entry(window)
entryEmail.pack()
btnAddCustomer = Button(window, text="Add Customer", command=onClick)
btnAddCustomer.pack()
window.mainloop() # Keep on running the program/process