Fixing qml connection to save business with a new contact - some

database modifications
This commit is contained in:
2024-12-14 15:32:10 +01:00
parent 59e5fadd26
commit 559ad1b882
7 changed files with 54 additions and 22 deletions

View File

@@ -5,16 +5,16 @@ import mariadb
class ContactDAO:
def __init__(self):
print(f"*** File: {__file__}, __init__()")
#print(f"*** File: {__file__}, __init__()")
self.__con = DbManager().getConnection()
self.__cur = self.__con.cursor()
def getContacts(self):
print(f"*** File: {__file__}, getContacts()")
def addContact(self, contact):
def addContact(self, contact, enc_key):
try:
self.__cur.callproc("addContactPerson", (json.dumps(contact),))
self.__cur.callproc("addContactPerson", (enc_key, json.dumps(contact),))
self.__con.commit()
self.__cur.callproc("getLastInsertId")
contact_id = self.__cur.fetchone()