-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFunctions.py
106 lines (89 loc) · 2.77 KB
/
Functions.py
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
import pymysql
import pymysql.cursors
from add import *
from Retrievals import *
from Clear import *
from delete import *
def addOptions(cur, con):
try:
print("Choose an item to add info!!")
info = ["Events", "Order", "Menu",
"Furniture", "Staff"]
for var in range(len(info)):
print(var+1, ". ", info[var], sep="")
val = int(input("Enter your choice: "))
if(val == 1):
Add_Events(cur, con)
elif(val == 2):
Add_Order(cur, con)
elif(val == 3):
Add_Menu(cur, con)
elif(val == 4):
Add_Furniture(cur, con)
elif(val == 5):
Add_Staff(cur, con)
# elif(val == 6):
# Add_Raw_Materials(cur, con)
else:
print("Oops!! You Entered an invalid choice")
print("Press enter to continue ....")
return
except Exception as e:
print(e)
print(red("Try again!!"), 'bold')
return
def Retrievals(cur, con):
try:
clear()
print("Choose a Query type to Search information!!")
info = ["Select a row specific to some data", "Search by a particular attribute",
"Get information from entire columns", "Search by text", "Analysis on order"]
for var in range(len(info)):
print(var+1, ". ", info[var], sep="")
val = int(input("Enter your choice: "))
clear()
if(val == 1):
Selection(cur, con)
elif(val == 2):
Projection(cur, con)
elif(val == 3):
Aggregate(cur, con)
elif(val == 4):
Search(cur, con)
elif(val == 5):
Analysis(cur, con)
else:
print("Oops!! You Entered an invalid choice")
return
except Exception as e:
print(e)
print(red("Try again!!"), 'bold')
return
def deleteOptions(cur, con):
try:
print("Choose the table from which you like to delete")
tables_present = ["Events", "Order", "Menu",
"Furniture", "Staff", "Raw_Materials"]
count = 0
for i in tables_present:
count = count + 1
print(str(count) + '.' + i)
j = int(input("Enter your choice: "))
if(j == 1):
delete_event(cur, con)
elif(j == 2):
delete_order(cur, con)
elif(j == 3):
delete_MenuItem(cur, con)
elif(j == 4):
delete_Furniture(cur, con)
elif(j == 5):
delete_Staff(cur, con)
elif(j == 6):
delete_RawMaterials(cur, con)
else:
print("please select a valid choice")
except Exception as e:
print(e)
print(red("Try again!!"), 'bold')
return