コード例 #1
0
    def updateRecordsAdhlam(self):
        try:
            fila = []
            for col in range(self.modeladhlam.columnCount()):
                index = self.modeladhlam.index(
                    self.ui.viewAdhLam.currentIndex().row(), col)
                fila.append(str(self.modeladhlam.data(index).toString()))

            adhlam = DTO.AdhesivoLaminacion()
            adhlam.setIdAdhLam(fila[0])
            adhlam.setProveedor(str(fila[1]))
            adhlam.setAnilox(str(fila[2]))

            dialog = editarAdhLam.vEditarAdhLam()
            dialog.ui.leProveedorAdhLam.setText(adhlam.getProveedor())
            dialog.ui.leAniloxAdhLam.setText(adhlam.getAnilox())
            dialog.exec_()

        except Exception as e:
            MostrarError(str(e.message))
        else:
            if dialog.editarAdhLam is not None:
                if (dialog.aceptado):
                    adhlam.setProveedor(dialog.ui.leProveedorAdhLam.text())
                    adhlam.setAnilox(dialog.ui.leAniloxAdhLam.text())
                    DAO.AdhesivoLaminacion(adhlam).modificarAdhLam()
                    self.cargarviewadhlam()
コード例 #2
0
    def deleteRecordsAdhlam(self):
        try:
            fila = []
            for col in range(self.modeladhlam.columnCount()):
                index = self.modeladhlam.index(
                    self.ui.viewAdhLam.currentIndex().row(), col)
                fila.append(str(self.modeladhlam.data(index).toString()))
            alf = DTO.AdhesivoLaminacion()
            alf.setIdAdhLam(fila[0])
            DAO.AdhLamFicha().eliminarReferencia(fila[0], self.edicion)
            DAO.AdhesivoLaminacion(alf).eliminarAdhLam()

        except Exception as e:
            MostrarError(str(e.message))
        else:
            self.modeladhlam.submitAll()
コード例 #3
0
    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()