Made the Check in function

This commit is contained in:
Josh Biltonen 2022-12-01 17:37:18 -08:00
parent 4b5e3eb1f0
commit 01189ce159
2 changed files with 14 additions and 3 deletions

View File

@ -1 +1 @@
{"_default": {"1": {"Serial Number": "1", "Brand": "3", "Grade": "8", "Name": "9"}}}
{"_default": {"1": {"Serial Number": "1", "Brand": "3", "Grade": "", "Name": ""}}}

15
main.py
View File

@ -134,7 +134,6 @@ def main():
G = window["Grade"].get()
N = window["Name"].get()
Table = window["table"].get()
print(Table)
for row in Table:
if SN == row[0]:
row[2] = G
@ -143,7 +142,19 @@ def main():
query=Query()
db.update({"Grade": G, "Name": N}, query["Serial Number"] == SN)
elif event == "Check In":
SN = window["Serial Number"].get()
Table = window["table"].get()
for row in Table:
if SN == row[0]:
row[2] = ""
row[3] = ""
window["table"].update(Table)
window["Grade"].update("")
window["Name"].update("")
query=Query()
db.update({"Grade": "", "Name": ""}, query["Serial Number"] == SN)
# Finish up by removing from the screen
window.close()