Employee/Applicant GUI and DB
This commit is contained in:
@@ -17,16 +17,10 @@ class EmployeeDAO(QObject):
|
||||
if self.__con:
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
def getEmployees(self, enc_key, criterion = "Alle", appli_emp = 0, processed = False):
|
||||
'''
|
||||
appli_emp:
|
||||
0 = applicants and employees
|
||||
1 = applicants only
|
||||
2 = employees only
|
||||
'''
|
||||
def getEmployees(self, enc_key, criterion = "Alle", processed = False, fired = False):
|
||||
try:
|
||||
if self.__cur:
|
||||
self.__cur.callproc("getEmployeesView", (appli_emp, processed, criterion, enc_key, ))
|
||||
self.__cur.callproc("getEmployeeTable", (criterion, processed, fired, enc_key, ))
|
||||
self.__all_cols = [desc[0] for desc in self.__cur.description]
|
||||
return self.__cur.fetchall(), self.__all_cols
|
||||
else:
|
||||
@@ -45,10 +39,10 @@ class EmployeeDAO(QObject):
|
||||
except mariadb.Error as e:
|
||||
print(str(e))
|
||||
|
||||
def addEmployee(self, data, enc_key, employee = False):
|
||||
def addEmployee(self, data, enc_key, applicant = True):
|
||||
try:
|
||||
if self.__cur:
|
||||
self.__cur.callproc("addApplicant", (json.dumps(data), employee, enc_key,))
|
||||
self.__cur.callproc("addApplicant", (json.dumps(data), applicant, enc_key,))
|
||||
self.__con.commit()
|
||||
self.newEmployeeAdded.emit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user