Example #1
0
    def __init__(self,
                 parent=None):  ### var is the id from the takeAdvancePayment
        QtGui.QDialog.__init__(self, parent)
        self.ui = DataBaseConfigration()
        self.ui.setupUi(self)
        self.query = query

        QtCore.QObject.connect(self.ui.dbType,
                               QtCore.SIGNAL("currentIndexChanged(QString)"),
                               self.get_db)
Example #2
0
    def __init__(self,parent = None):   ### var is the id from the takeAdvancePayment
        QtGui.QDialog.__init__(self,parent)
        self.ui = DataBaseConfigration()
        self.ui.setupUi(self)
        self.query = query

        QtCore.QObject.connect(self.ui.dbType, QtCore.SIGNAL("currentIndexChanged(QString)"), self.get_db)
Example #3
0
class DataBaseConfiguration(QtGui.QDialog):
    def __init__(self,parent = None):   ### var is the id from the takeAdvancePayment
        QtGui.QDialog.__init__(self,parent)
        self.ui = DataBaseConfigration()
        self.ui.setupUi(self)
        self.query = query

        QtCore.QObject.connect(self.ui.dbType, QtCore.SIGNAL("currentIndexChanged(QString)"), self.get_db)


    def get_db(self,db):
        if db == 'MySql':
            connection = MySQLdb.connect(host = str(self.ui.dbHost.text()),
                                         user = str(str.ui.dbUser.text()),
                                         passwd = str(self.ui.dbPassword.text()))
            cursor = connection.cursor()
        if db == 'SQLite' :
            connection = sqlite3.connect('wages.db')
            cursor = connection.cursor()
Example #4
0
class DataBaseConfiguration(QtGui.QDialog):
    def __init__(self,
                 parent=None):  ### var is the id from the takeAdvancePayment
        QtGui.QDialog.__init__(self, parent)
        self.ui = DataBaseConfigration()
        self.ui.setupUi(self)
        self.query = query

        QtCore.QObject.connect(self.ui.dbType,
                               QtCore.SIGNAL("currentIndexChanged(QString)"),
                               self.get_db)

    def get_db(self, db):
        if db == 'MySql':
            connection = MySQLdb.connect(host=str(self.ui.dbHost.text()),
                                         user=str(str.ui.dbUser.text()),
                                         passwd=str(self.ui.dbPassword.text()))
            cursor = connection.cursor()
        if db == 'SQLite':
            connection = sqlite3.connect('wages.db')
            cursor = connection.cursor()