def updateRecordsfilmmi(self): try: fila = [] for col in range(self.modelfilmi.columnCount()): index = self.modelfilmi.index( self.ui.viewFilmmi.currentIndex().row(), col) fila.append(str(self.modelfilmi.data(index).toString())) filmi = DTO.FilmMicronaje() filmi.setIdFilmMi(fila[0]) filmi.setProveedor(str(fila[1])) filmi.setAncho(float(fila[2])) dialog = editarFilmi.vEditarFilmMi() dialog.ui.leProveedorFilmMi.setText(filmi.getProveedor()) dialog.ui.dsbAnchoFilmMi.setValue(filmi.getAncho()) dialog.exec_() except Exception as e: MostrarError(str(e.message)) else: if dialog.editarFilmMi is not None: if (dialog.aceptar): filmi.setProveedor(dialog.ui.leProveedorFilmMi.text()) filmi.setAncho(dialog.ui.dsbAnchoFilmMi.value()) DAO.FilmMicronaje(filmi).modificarFilmMi() self.cargarviewfilmmi()
def insertRecordsfilmmi(self): try: filmi = DTO.FilmMicronaje() filmi.setProveedor(self.ui.leProveedorFilmMiMod.text()) filmi.setAncho(self.ui.dsbAnchoFilmMiMod.value()) DAO.FilmMicronaje(filmi).ingresarFilmMi() "crear referencia de forma inmediata" ff = DAO.FilmMiFicha() ff.setIdFicha(self.edicion) ff.setIdFilmMi(DAO.FilmMicronaje().idUltimoFilmMi()) ff.insertarFilmMiFicha() self.cargarviewfilmmi() except Exception as e: MostrarError(str(e.message)) else: self.modelfilmi.submitAll()
def deleteRecordsfilmmi(self): try: fila = [] for col in range(self.modelfilmi.columnCount()): index = self.modelfilmi.index( self.ui.viewFilmmi.currentIndex().row(), col) fila.append(str(self.modelfilmi.data(index).toString())) filmi = DTO.FilmMicronaje() filmi.setIdFilmMi(fila[0]) DAO.FilmMiFicha().eliminarReferencia(fila[0], self.edicion) DAO.FilmMicronaje(filmi).eliminarFilmMi() except Exception as e: MostrarError(str(e.message)) else: self.modelfilmi.submitAll()