-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetby.py
More file actions
151 lines (132 loc) · 4.01 KB
/
getby.py
File metadata and controls
151 lines (132 loc) · 4.01 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
149
150
import retrieve_id
from retrieve_id import *
import retrieve_other
from retrieve_other import *
def getStaff(cur,con):
while(1):
print("Get by:\n")
print("1. Staff ID")
print("2. Department")
print("3. Name")
print("4. Go back")
ch = int(input("Enter choice> "))
if ch==4:
return
elif ch==1:
staffid = input("Enter Staff ID: ")
retrieveStaffById(cur,con,staffid)
elif ch==2:
deptid = input("Enter Department ID: ")
retrieveStaffByDeptId(cur,con,deptid)
elif ch==3:
name = (input("Enter Name (Fname Lname): ")).split(' ')
fname = name[0]
lname = name[1]
retrieveStaffByName(cur,con,fname,lname)
def getDonor(cur,con):
while(1):
print("Get by:\n")
print("1. Donor ID")
print("2. Blood Type")
print("3. Name")
print("4. Go back")
ch = int(input("Enter choice> "))
if ch==4:
return
elif ch==1:
donorid = input("Enter Donor ID: ")
retrieveDonorById(cur,con,donorid)
elif ch==2:
bloodtype = input("Enter Blood Type: ")
retrieveDonorByBloodType(cur,con,bloodtype)
elif ch==3:
name = input("Enter Name (Fname Lname): ")
retrieveDonorByName(cur,con,name)
def getPlasma(cur,con):
while(1):
print("Get by:\n")
print("1. Donor ID")
print("2. Blood Type")
print("3. Used")
print("4. Go back")
ch = int(input("Enter choice> "))
if ch==4:
return
elif ch==1:
donorid = input("Enter Donor ID: ")
retrievePlasmaById(cur,con,donorid)
elif ch==2:
bloodtype = input("Enter Blood Type: ")
retrievePlasmaByBloodType(cur,con,bloodtype)
elif ch==3:
used = int(input("Used (0/1): "))
retrievePlasmaByUsed(cur,con,used)
def getOrder(cur,con):
while(1):
print("Get by:\n")
print("1. Order ID")
print("2. Hospital ID")
print("3. Accepted")
print("4. Go back")
ch = int(input("Enter choice> "))
if ch==4:
return
elif ch==1:
orderid = input("Enter Order ID: ")
retrieveOrderById(cur,con,orderid)
elif ch==2:
hospid = input("Enter Hospital ID: ")
retrieveOrderByHospId(cur,con,hospid)
elif ch==3:
accepted = int(input("Accepted (0/1): "))
retrieveOrderByAccepted(cur,con,accepted)
def getInv(cur,con):
while(1):
print("1. Get")
print("2. Go back")
ch = int(input("Enter choice> "))
if ch==2:
return
elif ch==1:
invid = input("Enter Inventory ID: ")
retrieveInvById(cur,con,invid)
def getVehi(cur,con):
while(1):
print("1. Get")
print("2. Go back")
ch = int(input("Enter choice> "))
if ch==2:
return
elif ch==1:
vehid = input("Enter Vehicle ID: ")
retrieveVehiById(cur,con,vehid)
def getDept(cur,con):
while(1):
print("1. Get")
print("2. Go back")
ch = int(input("Enter choice> "))
if ch==2:
return
elif ch==1:
deptid = input("Enter Department ID: ")
retrieveDeptById(cur,con,deptid)
def getDepen(cur,con):
while(1):
print("1. Get")
print("2. Go back")
ch = int(input("Enter choice> "))
if ch==2:
return
elif ch==1:
staffid = input("Enter Staff ID: ")
retrieveDepenByStaffId(cur,con,staffid)
def getPatient(cur,con):
while(1):
print("1. Get")
print("2. Go back")
ch = int(input("Enter choice> "))
if ch==2:
return
elif ch==1:
hospid = input("Enter Hospital ID: ")
retrievePatByHospId(cur,con,hospid)