hallo
This commit is contained in:
@@ -17,6 +17,7 @@ class BusinessDAO(QObject):
|
|||||||
self.__cur = self.__con.cursor()
|
self.__cur = self.__con.cursor()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getBusiness(self, enc_key, criterion = "Alle"):
|
def getBusiness(self, enc_key, criterion = "Alle"):
|
||||||
if self.__cur:
|
if self.__cur:
|
||||||
self.__cur.callproc("getCustomerView", (enc_key, criterion,))
|
self.__cur.callproc("getCustomerView", (enc_key, criterion,))
|
||||||
|
|||||||
@@ -68,22 +68,23 @@ class BusinessModel(QAbstractTableModel):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
# <<<<<<< HEAD
|
|
||||||
|
|
||||||
self.__business_dao = BusinessDAO()
|
self.__business_dao = BusinessDAO()
|
||||||
self.__business_dao.newBusinessAdded.connect(self.__refreshView)
|
self.__business_dao.newBusinessAdded.connect(self.__refreshView)
|
||||||
self.__conf = ConfigLoader().getConfig()
|
self.__conf = ConfigLoader().getConfig()
|
||||||
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
|
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
|
||||||
# =======
|
|
||||||
# self.__key = ConfigLoader().getKey()
|
|
||||||
# >>>>>>> e28c68f (AddCustomer, AddContact finished)
|
|
||||||
self.__getData()
|
self.__getData()
|
||||||
|
|
||||||
|
|
||||||
def __getData(self, criterion = "Alle"):
|
def __getData(self, criterion = "Alle"):
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
|
|
||||||
|
|
||||||
rows, self.__visible_columns = self.__business_dao.getBusiness(self.__key, criterion)
|
rows, self.__visible_columns = self.__business_dao.getBusiness(self.__key, criterion)
|
||||||
|
|
||||||
|
|
||||||
self.__data = rows
|
self.__data = rows
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
||||||
@@ -134,6 +135,7 @@ class BusinessModel(QAbstractTableModel):
|
|||||||
@Slot(dict, int)
|
@Slot(dict, int)
|
||||||
def addBusiness(self, business, contact_id):
|
def addBusiness(self, business, contact_id):
|
||||||
|
|
||||||
|
|
||||||
BusinessDAO().addBusiness(self.__key, business, contact_id)
|
BusinessDAO().addBusiness(self.__key, business, contact_id)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class ContactModel(QObject):
|
|||||||
# print(f"*** File: {__file__}, __init__()")
|
# print(f"*** File: {__file__}, __init__()")
|
||||||
#self.logger = logging.getLogger()
|
#self.logger = logging.getLogger()
|
||||||
|
|
||||||
|
|
||||||
self.__conf = ConfigLoader().getConfig()
|
self.__conf = ConfigLoader().getConfig()
|
||||||
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
|
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
|
||||||
|
|
||||||
@@ -30,7 +31,9 @@ class ContactModel(QObject):
|
|||||||
@Slot(dict)
|
@Slot(dict)
|
||||||
def addContact(self, contact):
|
def addContact(self, contact):
|
||||||
|
|
||||||
|
|
||||||
i = ContactDAO().addContact(contact, self.__key)
|
i = ContactDAO().addContact(contact, self.__key)
|
||||||
|
|
||||||
self.contactIdReady.emit(i)
|
self.contactIdReady.emit(i)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user