Made the Check in function
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good

This commit is contained in:
Josh Biltonen 2022-12-01 17:37:18 -08:00
parent 4b5e3eb1f0
commit bff2bc8a03
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": ""}}}

13
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,6 +142,18 @@ 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()