This commit is contained in:
2024-12-16 08:52:57 +01:00
parent 903a2b8dc1
commit 40d308d965
5 changed files with 42 additions and 15 deletions

View File

@@ -13,16 +13,14 @@ class ContactDAO:
def getContacts(self):
print(f"*** File: {__file__}, getContacts()")
def addContact(self, contact, enc_key):
def addContact(self, key, contact):
try:
if self.__cur:
self.__cur.callproc("addContactPerson", (enc_key, json.dumps(contact),))
self.__con.commit()
self.__cur.callproc("getLastInsertId")
contact_id = self.__cur.fetchone()
return contact_id[0]
else:
return None
self.__cur.callproc("addContactPerson", (key, json.dumps(contact),))
self.__con.commit()
self.__cur.callproc("getLastInsertId")
contact_id = self.__cur.fetchone()
return contact_id[0]
except mariadb.Error as e:
print("MDB: " + str(e))
except Exception as e: