Files
pyqcrm/lib/DB/ContactDAO.py
2024-12-11 15:08:16 +01:00

26 lines
646 B
Python

from .DbManager import DbManager
import json
import mariadb
class ContactDAO:
def __init__(self):
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):
try:
contact_id = self.__cur.callproc("addContactPerson", (contact, 0, ))
self.__con.commit()
return contact_id[1]
#except mariadb.Error as e:
#print(str (e))
except Exception as e:
print(str (e))