def updateRecordsMallas(self): try: fila = [] for col in range(self.modelMallas.columnCount()): index = self.modelMallas.index( self.ui.viewMalla.currentIndex().row(), col) fila.append(str(self.modelMallas.data(index).toString())) mal = DTO.Malla() mal.setIdMalla(fila[0]) mal.setTipo(str(fila[1])) mal.setInterno(bool(fila[2])) dialog = editarMalla.vEditarMalla() dialog.ui.leTipoMalla.setText(mal.getTipo()) dialog.ui.rbInterno.setChecked(False) if mal.getInterno(): dialog.ui.rbInterno.setChecked(True) dialog.exec_() except Exception as e: MostrarError(str(e.message)) else: if dialog.mallaEditada is not None: if (dialog.aceptado): mal.setTipo(dialog.ui.leTipoMalla.text()) mal.setInterno(dialog.ui.rbInterno.isChecked()) DAO.Malla(mal).modificarMalla() self.cargarviewmallas()
def deleteRecordsMateriales(self): fila = [] for col in range(self.modelMaterial.columnCount()): index = self.modelMaterial.index( self.ui.viewMateriales.currentIndex().row(), col) fila.append(str(self.modelMaterial.data(index).toString())) mat = DTO.Material() mat.setIdMaterial(fila[0]) DAO.MaterialFicha().eliminarreferencia(fila[0], self.edicion) DAO.Material(mat).eliminarMaterial() self.cargarviewmateriales()
def deleteRecords(self): fila = [] for col in range(self.model.columnCount()): index = self.model.index(self.ui.tableView.currentIndex().row(), col) fila.append(str(self.model.data(index).toString())) cat = DTO.Categoria() cat.setIdCategoria(fila[0]) cat.setNombre(fila[1]) DAO.Categoria(cat).eliminarCategoria() self.model.submitAll()
def deleteRecordsMallas(self): try: fila = [] for col in range(self.modelMallas.columnCount()): index = self.modelMallas.index( self.ui.viewMalla.currentIndex().row(), col) fila.append(str(self.modelMallas.data(index).toString())) mal = DTO.Malla() mal.setIdMalla(fila[0]) DAO.MallaFicha().eliminarReferencia(fila[0], self.edicion) DAO.Tinta(mal).eliminarTinta() except Exception as e: MostrarError(str(e.message)) else: self.cargarviewmallas() pass
def insertRecordsAdhlam(self): try: adhlam = DTO.AdhesivoLaminacion() adhlam.setProveedor(self.ui.leProveedorAdhLamMod.text()) adhlam.setAnilox(self.ui.leAniloxAdhLamMod.text()) DAO.AdhesivoLaminacion(adhlam).ingresarAdhLam() "crear referencia de forma inmediata" alf = DAO.AdhLamFicha() alf.setIdFicha(self.edicion) alf.setIdAdhLam(DAO.AdhesivoLaminacion().idUltimoAdhLam()) alf.insertarAdhLamFicha() self.cargarviewadhlam() except Exception as e: MostrarError(str(e.message)) else: self.modeladhlam.submitAll()
def updateRecordsMateriales(self): try: fila = [] for col in range(self.modelMaterial.columnCount()): index = self.modelMaterial.index( self.ui.viewMateriales.currentIndex().row(), col) fila.append(str(self.modelMaterial.data(index).toString())) mat = DTO.Material() mat.setIdMaterial(fila[0]) mat.setCodigo(str(fila[1])) mat.setNombre(str(fila[2])) mat.setProveedor(str(fila[3])) mat.setAncho(float(fila[4])) mat.setTC(bool(fila[5])) dialog = vEditarMaterial.vEditarMaterial() dialog.ui.leCodigoMaterial.setText(mat.getCodigo()) dialog.ui.leNombreMaterial.setText(mat.getNombre()) dialog.ui.leProveedorMaterial.setText(mat.getProveedor()) dialog.ui.dsbAnchoMaterial.setValue(mat.getAncho()) if mat.getTC() is True: dialog.ui.rbTC1.setChecked(True) else: dialog.ui.rbTC2.setChecked(True) dialog.exec_() except Exception as e: MostrarError(str(e.message)) else: if dialog.materialEditado is not None: if (dialog.aceptado): mat.setCodigo(dialog.materialEditado.getCodigo()) mat.setNombre(dialog.materialEditado.getNombre()) mat.setProveedor(dialog.materialEditado.getProveedor()) mat.setAncho(dialog.materialEditado.getAncho()) mat.setTC(dialog.materialEditado.getTC()) DAO.Material(mat).modificarMaterial() self.cargarviewmateriales() pass
def updateRecordsTintas(self): try: fila = [] for col in range(self.modelTinta.columnCount()): index = self.modelTinta.index( self.ui.viewTintas.currentIndex().row(), col) fila.append(str(self.modelTinta.data(index).toString())) tin = DTO.Tinta() tin.setIdTinta(fila[0]) tin.setColor(str(fila[1])) tin.setTipo(str(fila[2])) tin.setAnilox(str(fila[3])) tin.setProveedor1(str(fila[4])) tin.setProveedor2(str(fila[5])) tin.setProveedor3(str(fila[6])) dialog = editarTinta.vEditarTinta() dialog.ui.leColorTinta.setText(tin.getColor()) dialog.ui.leTipoTinta.setText(tin.getTipo()) dialog.ui.leAniloxTinta.setText(tin.getAnilox()) dialog.ui.leProveedorTinta.setText(tin.getProveedor1()) dialog.ui.leProveedorTinta2.setText(tin.getProveedor2()) dialog.ui.leProveedorTinta3.setText(tin.getProveedor3()) dialog.exec_() except Exception as e: MostrarError(str(e.message)) else: if dialog.tintaEditada is not None: if (dialog.aceptado): tin.setColor(dialog.ui.leColorTinta.text()) tin.setTipo(dialog.ui.leTipoTinta.text()) tin.setAnilox(dialog.ui.leAniloxTinta.text()) tin.setProveedor1(dialog.ui.leProveedorTinta.text()) tin.setProveedor2(dialog.ui.leProveedorTinta2.text()) tin.setProveedor3(dialog.ui.leProveedorTinta3.text()) DAO.Tinta(tin).modificarTinta() self.modelTinta.submitAll() pass
def insertRecordsMallas(self): try: mal = DTO.Malla() mal.setTipo(self.ui.leTipoMallaMod.text()) if self.ui.rbInterno_2.isChecked(): mal.setInterno(True) else: mal.setInterno(False) DAO.Malla(mal).ingresarMalla() "crear referencia de forma inmediata" mf = DAO.MallaFicha() mf.setIdFicha(self.edicion) mf.setIdMalla(DAO.Malla().idUltimaMallaInsertada()) mf.insertarMallaFicha() self.cargarviewmallas() except Exception as e: MostrarError(str(e.message)) else: self.cargarviewmallas() pass
def insertRecordsMateriales(self): try: mat = DTO.Material() mat.setCodigo(self.ui.leCodigoMaterialMod.text()) mat.setNombre(self.ui.leNombreMaterialMod.text()) mat.setProveedor(self.ui.leProveedorMaterialMod.text()) mat.setAncho(self.ui.dsbAnchoMaterialMod.value()) if self.ui.rbConvencionalesMod.isChecked(): mat.setTC(True) else: mat.setTC(False) DAO.Material(mat).insertarMaterial() "crear referencia de forma inmediata" mf = DAO.MaterialFicha() mf.setIdFicha(self.edicion) mf.setIdMaterial(DAO.Material().idUltimoMaterialInsertada()) mf.insertarMaterialFicha() except Exception as e: MostrarError(str(e.message)) else: self.cargarviewmateriales()
def insertRecordsTintas(self): try: tin = DTO.Tinta() tin.setColor(self.ui.leColorTintaMod.text()) tin.setTipo(self.ui.leTipoTintaMod.text()) tin.setAnilox(self.ui.leAniloxTintaMod.text()) tin.setProveedor1(self.ui.leProveedorTintaMod.text()) tin.setProveedor2(self.ui.leProveedorTinta2Mod.text()) tin.setProveedor3(self.ui.leProveedorTinta3Mod.text()) DAO.Tinta(tin).ingresarTinta() "crear referencia de forma inmediata" tf = DAO.TintaFicha() tf.setIdFicha(self.edicion) tf.setIdTinta(DAO.Tinta().idUltimaTinta()) tf.insertarTintaFicha() self.cargarviewtintas() "" except Exception as e: MostrarError(str(e.message)) else: self.modelTinta.submitAll() "limpiarFormulario"