Änderungen letzt Woche
This commit is contained in:
26
lib/DB/ObjectDAO.py
Normal file
26
lib/DB/ObjectDAO.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from .DbManager import DbManager
|
||||
import json
|
||||
import mariadb
|
||||
from PySide6.QtCore import QObject, Signal
|
||||
from ..PyqcrmFlags import PyqcrmAppliEmpyFlags
|
||||
|
||||
|
||||
class ObjectDAO(QObject):
|
||||
newObjectAdded = Signal()
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
#print(f"*** File: {__file__}, __init__()")
|
||||
self.__con = DbManager().getConnection()
|
||||
if self.__con:
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
def addObject(self, new_object, new_objcontact, enc_key):
|
||||
try:
|
||||
if self.__cur:
|
||||
self.__cur.callproc("addObject", (json.dumps(new_object), json.dumps(new_objcontact), enc_key,))
|
||||
self.__con.commit()
|
||||
# self.newEmployeeAdded.emit()
|
||||
|
||||
except mariadb.Error as e:
|
||||
print(str(e))
|
||||
Reference in New Issue
Block a user