Esempio n. 1
0
    def roundFieldValue(self, n, table, field):
        from pineboolib.fllegacy.FLSqlConnections import FLSqlConnections
        tmd = FLSqlConnections().database().manager().metadata(table)
        if not tmd:
            return 0
        fmd = tmd.field(field)
        if not fmd:
            if tmd and not tmd.inCache():
                del tmd
            return 0

        ret = self.buildNumber(n, 'f', fmd.partDecimal())
        if tmd and not tmd.inCache():
            del tmd
        return ret
Esempio n. 2
0
    def roundFieldValue(self, n, table, field):
        from pineboolib.fllegacy.FLSqlConnections import FLSqlConnections
        tmd = FLSqlConnections().database().manager().metadata(table)
        if not tmd:
            return 0
        fmd = tmd.field(field)
        if not fmd:
            if tmd and not tmd.inCache():
                del tmd
            return 0

        ret = self.buildNumber(n, 'f', fmd.partDecimal())
        if tmd and not tmd.inCache():
            del tmd
        return ret
Esempio n. 3
0
 def quickSqlSelect(self, f, s, w, connName="default"):
     from pineboolib.fllegacy.FLSqlConnections import FLSqlConnections
     if not w:
         sql = "select " + s + " from " + f
     else:
         sql = "select " + s + " from " + f + " where " + w
     q = FLSqlQuery(sql, FLSqlConnections().database(connName).db())
     return q.value(0) if q.next() else False
Esempio n. 4
0
 def setMainWidgetEmpty(self):
     if not self.action_:
         return
 
     if self.cursor_:
         self.setMainWidgetQWidget(self.cursor_.db().managerModules.createUI(self.action_, self, self))
     else:
         self.setMainWidget(FLSqlConnections.database().managerModules().createUI(self.action_, self, self))
Esempio n. 5
0
 def setMainWidgetString(self, uiFileName):
     if self.cursor_:
         self.setMainWidgetQWidget(
             self.cursor_.db().managerModules.createUI(
                 uiFileName, self, self))
     else:
         self.setMainWidget(
             FLSqlConnections.database().managerModules().createUI(
                 uiFileName, self, self))
Esempio n. 6
0
 def init2(self, cursor,actionName = QString.null, parent = None):
     self.setFocusPolicy(QtGui.QWidget.NoFocus)
     if actionName.isEmpty():
         self.action_ = False
     elif cursor:
         self.action_ = FLSqlConnections.database().manager().action(actionName)
     self.cursor_ = cursor 
     if self.action_:
         self.name_ = self.action_.name()
     else:
         self.name_ = QString.null 
Esempio n. 7
0
    def setMainWidgetEmpty(self):
        if not self.action_:
            return

        if self.cursor_:
            self.setMainWidgetQWidget(
                self.cursor_.db().managerModules.createUI(
                    self.action_, self, self))
        else:
            self.setMainWidget(
                FLSqlConnections.database().managerModules().createUI(
                    self.action_, self, self))
Esempio n. 8
0
 def init2(self, cursor, actionName=QString.null, parent=None):
     self.setFocusPolicy(QtGui.QWidget.NoFocus)
     if actionName.isEmpty():
         self.action_ = False
     elif cursor:
         self.action_ = FLSqlConnections.database().manager().action(
             actionName)
     self.cursor_ = cursor
     if self.action_:
         self.name_ = self.action_.name()
     else:
         self.name_ = QString.null
Esempio n. 9
0
 def init1(self, actionName, parent = None):
     self.setFocusPolicy(QtGui.QWidget.NoFocus)
     if actionName.isEmpty():
         self.action_ = False
         print(FLUtil.translate("app","FLFormSearchDB : Nombre de acción vacío"))
         return
     else:
         self.action_ = FLSqlConnections.database().manager().action(actionName)
     if not self.action_:
         print(FLUtil.translate("app","FLFormSearchDB : No existe la acción %s" % actionName))
         return
     
     self.cursor_ = FLSqlCursor(self.action_.table(), True,"default", 0, 0, self)
     self.name_ = self.action_.name()
     
     self.initForm()
Esempio n. 10
0
    def inicialize2(self, *args, **kwargs):
        actionName = str(args[0][0])
        parent = args[0][1]
        f = args[1]

        if parent:
            self.parent_ = parent
        else:
            self.parent_ = QtGui.QWidget(pineboolib.project.mainWidget(),
                                         actionName, f)

        self.layout = None
        self.mainWidget_ = None
        self.layoutButtons = None
        self.pushButtonCancel = None
        self.showed = False
        self.iface = None
        self.oldCursorCtxt = None
        self.isClosing_ = False
        self.initFocusWidget_ = None
        self.oldFormObj = None
        self.accepted_ = False

        self.setFocusPolicy(QtGui.QWidget.NoFocus)

        if actionName.isEmpty():
            self.action_ = None
            print(FLUtil.translate("sys", "FLFormDB : Nombre de acción vacío"))
            return
        else:
            self.action_ = FLSqlConnections.database().manager().action(
                actionName)

        if not self.action_:
            print(
                FLUtil.translate(
                    "sys", "FLFormDB : No existe la acción %s" % actionName))
            return

        self.cursor_ = FLSqlCursor(self.action_.table(), True, "default", 0, 0,
                                   self)
        self.name_ = self.action_.name()

        self.initForm()
Esempio n. 11
0
    def inicialize2(self,*args, **kwargs):
        actionName = str(args[0][0])
        parent = args[0][1]
        f = args[1]

        if parent:
            self.parent_ = parent
        else:
            self.parent_ = QtGui.QWidget(pineboolib.project.mainWidget(), actionName, f)

        self.layout = None
        self.mainWidget_ = None
        self.layoutButtons = None
        self.pushButtonCancel = None
        self.showed = False
        self.iface = None
        self.oldCursorCtxt = None
        self.isClosing_ = False
        self.initFocusWidget_ = None
        self.oldFormObj = None
        self.accepted_ = False
    
        self.setFocusPolicy(QtGui.QWidget.NoFocus)
    
        if actionName.isEmpty():
            self.action_ = None
            print(FLUtil.translate("sys","FLFormDB : Nombre de acción vacío"))
            return
        else:
            self.action_ = FLSqlConnections.database().manager().action(actionName)
        
        if not self.action_:
            print(FLUtil.translate("sys","FLFormDB : No existe la acción %s" % actionName))
            return
        
        self.cursor_ = FLSqlCursor(self.action_.table(), True, "default", 0, 0, self)
        self.name_ = self.action_.name()
        
        self.initForm()
Esempio n. 12
0
    def inicialize3(self, *args, **kwargs):

        cursor = args[0]
        actionName = args[1]
        parent = args[2]
        f = args[3]

        self.cursor_ = cursor
        self.layout = None
        self.mainWidget_ = None
        self.layoutButtons = None
        self.pushButtonCancel = None
        self.showed = False
        self.iface = None
        self.oldCursorCtxt = None
        self.isClosing_ = False
        self.initFocusWidget_ = None
        self.oldFormObj = None
        self.accepted_ = False

        if parent:
            self.parent_ = QtGui.QWidget(parent)
        else:
            self.parent_ = QtGui.QWidget(pineboolib.project.mainWidget(),
                                         actionName, f)

        self.setFocusPolicy(QtGui.QWidget.NoFocus)

        if actionName.isEmpty():
            self.action_ = None
        elif cursor:
            self.action_ = cursor.db().manager().action(actionName)
        else:
            self.action = FLSqlConnections.database().manager().action(
                actionName)

        if self.action_:
            self.name_ = self.action_.name()
Esempio n. 13
0
    def inicialize3(self, *args, **kwargs):
        
        cursor = args[0]
        actionName = args[1]
        parent = args[2]
        f = args[3]
        
        self.cursor_ = cursor
        self.layout = None
        self.mainWidget_ = None
        self.layoutButtons = None
        self.pushButtonCancel = None
        self.showed = False
        self.iface = None
        self.oldCursorCtxt = None
        self.isClosing_ = False
        self.initFocusWidget_ = None
        self.oldFormObj = None
        self.accepted_ = False
        


        if parent:
            self.parent_ = QtGui.QWidget(parent)
        else:
            self.parent_ = QtGui.QWidget(pineboolib.project.mainWidget(), actionName, f)
        
        self.setFocusPolicy(QtGui.QWidget.NoFocus)
        
        if actionName.isEmpty():
            self.action_ = None
        elif cursor:
            self.action_ = cursor.db().manager().action(actionName)
        else:
            self.action =  FLSqlConnections.database().manager().action(actionName)
        
        if self.action_:
            self.name_ = self.action_.name()
Esempio n. 14
0
    def init1(self, actionName, parent=None):
        self.setFocusPolicy(QtGui.QWidget.NoFocus)
        if actionName.isEmpty():
            self.action_ = False
            print(
                FLUtil.translate("app",
                                 "FLFormSearchDB : Nombre de acción vacío"))
            return
        else:
            self.action_ = FLSqlConnections.database().manager().action(
                actionName)
        if not self.action_:
            print(
                FLUtil.translate(
                    "app",
                    "FLFormSearchDB : No existe la acción %s" % actionName))
            return

        self.cursor_ = FLSqlCursor(self.action_.table(), True, "default", 0, 0,
                                   self)
        self.name_ = self.action_.name()

        self.initForm()
Esempio n. 15
0
 def setMainWidgetString(self, uiFileName):
     if self.cursor_:
         self.setMainWidgetQWidget(self.cursor_.db().managerModules.createUI(uiFileName, self, self))
     else:
         self.setMainWidget(FLSqlConnections.database().managerModules().createUI(uiFileName, self, self))