Пример #1
0
 def cargarviewadhcofo(self):
     self.modeladhcofo = QtSql.QSqlTableModel(self)
     self.modeladhcofo.setTable("adhesivo_coldfoil")
     listaref = self.cadenadereferencias(
         DAO.AdhCoFoFicha().leerAdhCoFoEnFicha(self.edicion))
     self.modeladhcofo.setFilter("idAdhColdFoil  in {0}".format(listaref))
     self.modeladhcofo.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit)
     self.modeladhcofo.select()
     self.ui.viewAdhCofo.setModel(self.modeladhcofo)
     self.ui.viewAdhCofo.hideColumn(0)
Пример #2
0
    def deleteRecordsdhcofo(self):
        try:
            fila = []
            for col in range(self.modeladhcofo.columnCount()):
                index = self.modeladhcofo.index(
                    self.ui.viewAdhCofo.currentIndex().row(), col)
                fila.append(str(self.modeladhcofo.data(index).toString()))
            acf = DTO.AdhesivoColdFoil()
            acf.setIdAdhCoFo(fila[0])
            DAO.AdhCoFoFicha().eliminarReferencia(fila[0], self.edicion)
            DAO.AdhesivoColdFoil(acf).eliminarAdhCoFo()

        except Exception as e:
            MostrarError(str(e.message))
        else:
            self.modeladhcofo.submitAll()
Пример #3
0
    def insertRecordsdhcofo(self):
        try:
            adhcofo = DTO.AdhesivoColdFoil()
            adhcofo.setProveedor(self.ui.leProveedorAdhCoFoMod.text())
            adhcofo.setAncho(self.ui.dsbAnchoAdhCoFoMod.value())

            DAO.AdhesivoColdFoil(adhcofo).ingresarAdhCoFo()
            "crear referencia de forma inmediata"
            acf = DAO.AdhCoFoFicha()
            acf.setIdFicha(self.edicion)
            acf.setIdAdhCoFo(DAO.AdhesivoColdFoil().idUltimoAdhCoFo())
            acf.insertarAdhCoFoFicha()
            self.cargarviewadhcofo()
        except Exception as e:
            MostrarError(str(e.message))

        else:
            self.modeladhcofo.submitAll()