-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperations.py
More file actions
148 lines (141 loc) · 4.95 KB
/
Operations.py
File metadata and controls
148 lines (141 loc) · 4.95 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
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
import Book
import User
import Admin
import Tables
import mysql.connector
class Operations:
def __init__(self,cursor):
self.cursor = cursor
def BookManagement():
while True:
print("\t\t\t Book Record Management\n")
print("==============================================================")
print("1. Add Book Record")
print("2. Display Book Records")
print("3. Search Book Record")
print("4. Delete Book Record")
print("5. Update Book Record")
print("6. Return to Main Menu")
print("===============================================================")
choice=int(input("Enter any options: "))
if choice==1:
Book.insertBook()
elif choice==2:
Book.displayBook()
elif choice==3:
Book.searchBook()
elif choice==4:
Book.deleteBook()
elif choice==5:
Book.updateBook()
elif choice==6:
return
else:
print("Wrong Choice......Enter Your Choice again")
x=input("Press Enter to continue...")
def UserManagement():
while True:
print("\t\t\t User Record Management\n")
print("==============================================================")
print("1. Add User Record")
print("2. Display User Records")
print("3. Search User Record")
print("4. Delete User Record")
print("5. Update User Record")
print("6. Return to Main Menu")
print("===============================================================")
choice=int(input("Enter any options: "))
if choice==1:
User.insertUser()
elif choice==2:
User.displayUser()
elif choice==3:
User.searchUser()
elif choice==4:
User.deleteUser()
elif choice==5:
User.updateUser()
elif choice==6:
return
else:
print("Wrong Choice......Enter Your Choice again")
x=input("Press Enter to continue...")
def AdminManagement():
while True:
print("\t\t\t Admin Record Management\n")
print("==============================================================")
print("1. Add Admin Record")
print("2. Display Admin Records")
print("3. Search Admin Record")
print("4. Delete Admin Record")
print("5. Update Admin Record")
print("6. Return to Main Menu")
print("===============================================================")
choice=int(input("Enter any options : "))
if choice==1:
Admin.insertAdmin()
elif choice==2:
Admin.displayAdmin()
elif choice==3:
Admin.searchAdmin()
elif choice==4:
Admin.deleteAdmin()
elif choice==5:
Admin.updateAdmin()
elif choice==6:
return
else:
print("Wrong Choice......Enter Your Choice again")
x=input("Press Enter to continue...")
def FeedbackTable():
print()
print("User Feebacks and Ratings: \n")
mycursor.execute("SELECT * from Feedback")
records=mycursor.fetchall()
row_no=0
for rows in records :
row_no+=1
print("******************************","Row no.",row_no,"******************************")
print("\t Feedbacks: ", rows[0])
print("\t Rating out of 10: ", rows[1])
print()
def BookCentre():
while True:
print("\t\t\t Book Centre \n")
print("==============================================================")
print("1. List of all Books ")
print("2. Issue Book ")
print("3. Display Issued Book Records ")
print("4. Return Issued Book ")
print("5. Return to Main Menu ")
print("===============================================================")
choice=int(input("Enter any options: "))
if choice==1:
Book.BookList()
elif choice==2:
Book.IssueBook()
elif choice==3:
Book.ShowIssuedBook()
elif choice==4:
Book.returnBook()
elif choice==5:
return
else:
print("Wrong Choice......Enter Your Choice again")
x=input("Press Enter to continue...")
def Feedback():
while True:
data=()
print("\t\t\t Feedbacks and Ratings\n")
print("==============================================================")
Feedback=input("Enter your Review and tell us how can we improve to make our service better!!:))---->")
Ratings=input("Rate us out of 10:")
data=(Feedback,Ratings)
query="INSERT INTO Feedback VALUES (%s, %s)"
mycursor.execute(query,data)
mydb.commit()
print()
print("Thank you for your valuable Feedback!!")
return
mydb=mysql.connector.connect(host="localhost",user="root",passwd="",database="Library")
mycursor=mydb.cursor()