def insert_relation(self): if(self.type_singleton): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.type_singleton=True self.ventana = search_worker_view.search_worker_view(SEARCH_WORKER_SELECTION_MESSAGE,False) self.ventana.exec_() if(self.ventana.selected): worker = self.ventana.selected worker_name= worker.name+" "+worker.father_last_name+" "+worker.mother_last_name reply=QMessageBox.question(self, 'Message',INSERT_RELATION_QUESTION_1+worker_name+INSERT_RELATION_QUESTION_2+self.type_m.name,QMessageBox.Yes,QMessageBox.No) if reply == QMessageBox.Yes: db=get_connection() if(db): if(controller_relation_tipo.relation_exist(db,self.type_m.id,worker.pin)): db.close() QMessageBox.question(self, 'Error',INSERT_RELATION_ERROR,QMessageBox.Ok) else: new_relation=relation_trabajador_tipo.RelacionTrabajadorTipo([self.type_m.id,worker.pin]) new_relation.insert(db.cursor()) db.commit() db.close() self.reinsert_table() QMessageBox.question(self, 'Message',INSERT_RELATION_SUCCESS,QMessageBox.Ok) self.ventana=None self.type_singleton=False
def control_marks(self): if(self.singleton_widget): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget=True self.ventana = search_worker_view.search_worker_view(SEARCH_WORKER_CONTROL_MESSAGE,True) self.ventana.exec_() if(self.ventana.selected): worker = self.ventana.selected self.ventana = control_marks_view.control_marks_view(worker) self.ventana.exec_() self.ventana=None self.singleton_widget=False
def modify_worker(self): if(self.singleton_widget): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget=True self.ventana = search_worker_view.search_worker_view(SEARCH_WORKER_MODIFY_MESSAGE,False) self.ventana.exec_() if(self.ventana.selected): worker = self.ventana.selected self.ventana = modify_worker_view.modify_worker_view(worker) self.ventana.exec_() self.ventana=None self.singleton_widget=False
def reporte_tardanzas(self): if(self.singleton_widget_rt): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rt=True self.ventana_rt = search_worker_view.search_worker_view(SEARCH_SEE_REPORTES_TARDANZA_MESSAGE,True) self.ventana_rt.exec_() if(self.ventana_rt.selected): worker = self.ventana_rt.selected self.ventana_rt = tardanza_reporte_view.tardanza_reporte_view(worker) self.ventana_rt.exec_() self.ventana_rt=None self.singleton_widget_rt=False
def reporte_horas(self): if(self.singleton_widget_rh): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rh=True self.ventana_rh = search_worker_view.search_worker_view(SEARCH_SEE_REPORTES_HORAS_MESSAGE,True) self.ventana_rh.exec_() if(self.ventana_rh.selected): worker = self.ventana_rh.selected self.ventana_rh = horas_reporte_view.horas_reporte_view(worker) self.ventana_rh.exec_() self.ventana_rh=None self.singleton_widget_rh=False
def reporte_lunchtime(self): if(self.singleton_widget_rl): QMessageBox.warning(self, 'Error',ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rl=True self.ventana_rl = search_worker_view.search_worker_view(SEARCH_SEE_REPORTES_LUNCHTIME_MESSAGE,False) self.ventana_rl.exec_() if(self.ventana_rl.selected): worker = self.ventana_rl.selected self.ventana_rl = lunchtime_reporte_view.lunchtime_reporte_view(worker) self.ventana_rl.exec_() self.ventana_rl=None self.singleton_widget_rl=False
def reporte_horas(self): if (self.singleton_widget_rh): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rh = True self.ventana_rh = search_worker_view.search_worker_view( SEARCH_SEE_REPORTES_HORAS_MESSAGE, True) self.ventana_rh.exec_() if (self.ventana_rh.selected): worker = self.ventana_rh.selected self.ventana_rh = horas_reporte_view.horas_reporte_view(worker) self.ventana_rh.exec_() self.ventana_rh = None self.singleton_widget_rh = False
def control_marks(self): if (self.singleton_widget): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget = True self.ventana = search_worker_view.search_worker_view( SEARCH_WORKER_CONTROL_MESSAGE, True) self.ventana.exec_() if (self.ventana.selected): worker = self.ventana.selected self.ventana = control_marks_view.control_marks_view(worker) self.ventana.exec_() self.ventana = None self.singleton_widget = False
def modify_worker(self): if (self.singleton_widget): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget = True self.ventana = search_worker_view.search_worker_view( SEARCH_WORKER_MODIFY_MESSAGE, False) self.ventana.exec_() if (self.ventana.selected): worker = self.ventana.selected self.ventana = modify_worker_view.modify_worker_view(worker) self.ventana.exec_() self.ventana = None self.singleton_widget = False
def reporte_lunchtime(self): if (self.singleton_widget_rl): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rl = True self.ventana_rl = search_worker_view.search_worker_view( SEARCH_SEE_REPORTES_LUNCHTIME_MESSAGE, False) self.ventana_rl.exec_() if (self.ventana_rl.selected): worker = self.ventana_rl.selected self.ventana_rl = lunchtime_reporte_view.lunchtime_reporte_view( worker) self.ventana_rl.exec_() self.ventana_rl = None self.singleton_widget_rl = False
def reporte_tardanzas(self): if (self.singleton_widget_rt): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.singleton_widget_rt = True self.ventana_rt = search_worker_view.search_worker_view( SEARCH_SEE_REPORTES_TARDANZA_MESSAGE, True) self.ventana_rt.exec_() if (self.ventana_rt.selected): worker = self.ventana_rt.selected self.ventana_rt = tardanza_reporte_view.tardanza_reporte_view( worker) self.ventana_rt.exec_() self.ventana_rt = None self.singleton_widget_rt = False
def insert_relation(self): if (self.type_singleton): QMessageBox.warning(self, 'Error', ERROR_A_PROCESS_OPENED, QMessageBox.Ok) else: self.type_singleton = True self.ventana = search_worker_view.search_worker_view( SEARCH_WORKER_SELECTION_MESSAGE, False) self.ventana.exec_() if (self.ventana.selected): worker = self.ventana.selected worker_name = worker.name + " " + worker.father_last_name + " " + worker.mother_last_name reply = QMessageBox.question( self, 'Message', INSERT_RELATION_QUESTION_1 + worker_name + INSERT_RELATION_QUESTION_2 + self.type_m.name, QMessageBox.Yes, QMessageBox.No) if reply == QMessageBox.Yes: db = get_connection() if (db): if (controller_relation_tipo.relation_exist( db, self.type_m.id, worker.pin)): db.close() QMessageBox.question(self, 'Error', INSERT_RELATION_ERROR, QMessageBox.Ok) else: new_relation = relation_trabajador_tipo.RelacionTrabajadorTipo( [self.type_m.id, worker.pin]) new_relation.insert(db.cursor()) db.commit() db.close() self.reinsert_table() QMessageBox.question(self, 'Message', INSERT_RELATION_SUCCESS, QMessageBox.Ok) self.ventana = None self.type_singleton = False