From bff2bc8a0369bc67cb4f5ee32cab1274ca81df03 Mon Sep 17 00:00:00 2001 From: Josh b Date: Thu, 1 Dec 2022 17:37:18 -0800 Subject: [PATCH] Made the Check in function --- db.json | 2 +- main.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/db.json b/db.json index 2963a29..1f3a1a4 100644 --- a/db.json +++ b/db.json @@ -1 +1 @@ -{"_default": {"1": {"Serial Number": "1", "Brand": "3", "Grade": "8", "Name": "9"}}} \ No newline at end of file +{"_default": {"1": {"Serial Number": "1", "Brand": "3", "Grade": "", "Name": ""}}} \ No newline at end of file diff --git a/main.py b/main.py index f92d1ce..b4a0a5b 100644 --- a/main.py +++ b/main.py @@ -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()