コード例 #1
0
class EmployeeInformation(QtGui.QDialog):
    def __init__(self,query,db,parent = None) :
        QtGui.QDialog.__init__(self,parent)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)
        self.query = query
        self.db = db
        self.signal()
        self.get_position_name()
        
    def signal(self):
        QtCore.QObject.connect(self.ui.browse,QtCore.SIGNAL('clicked()'),self.browse)
        QtCore.QObject.connect(self.ui.save,QtCore.SIGNAL('clicked()'),self.create_employee)
        QtCore.QObject.connect(self.ui.wages_type,QtCore.SIGNAL('currentIndexChanged(QString)'),self.get_shift_name) 


    def get_shift_name(self,strg):
        self.ui.shift_type.clear()
        if self.ui.wages_type.currentText() == 'Regular':
            self.query.exec_(""" select title from regular_wages_setup ;""")
            while self.query.next():
                self.ui.shift_type.addItem(self.query.value(0).toString())
        if self.ui.wages_type.currentText() == 'Non-Regular':
            self.query.exec_(""" select title from non_regular_wages_setup ;""")
            while self.query.next():
                self.ui.shift_type.addItem(self.query.value(0).toString())  

    def get_position_name(self):
        try:
            self.query.exec_(""" select title from positions ;""")
            while self.query.next():
                self.ui.position.addItem(self.query.value(0).toString())
        except Exception ,e :
            print e
コード例 #2
0
 def __init__(self, query, db, parent=None):
     QtGui.QDialog.__init__(self, parent)
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.query = query
     self.db = db
     self.signal()
     self.get_position_name()
コード例 #3
0
 def __init__(self,query,db,parent = None) :
     QtGui.QDialog.__init__(self,parent)
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.query = query
     self.db = db
     self.signal()
     self.get_position_name()
コード例 #4
0
class EmployeeInformation(QtGui.QDialog):
    def __init__(self, query, db, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)
        self.query = query
        self.db = db
        self.signal()
        self.get_position_name()

    def signal(self):
        QtCore.QObject.connect(self.ui.browse, QtCore.SIGNAL('clicked()'),
                               self.browse)
        QtCore.QObject.connect(self.ui.save, QtCore.SIGNAL('clicked()'),
                               self.create_employee)
        QtCore.QObject.connect(self.ui.wages_type,
                               QtCore.SIGNAL('currentIndexChanged(QString)'),
                               self.get_shift_name)

    def get_shift_name(self, strg):
        self.ui.shift_type.clear()
        if self.ui.wages_type.currentText() == 'Regular':
            self.query.exec_(""" select title from regular_wages_setup ;""")
            while self.query.next():
                self.ui.shift_type.addItem(self.query.value(0).toString())
        if self.ui.wages_type.currentText() == 'Non-Regular':
            self.query.exec_(
                """ select title from non_regular_wages_setup ;""")
            while self.query.next():
                self.ui.shift_type.addItem(self.query.value(0).toString())

    def get_position_name(self):
        try:
            self.query.exec_(""" select title from positions ;""")
            while self.query.next():
                self.ui.position.addItem(self.query.value(0).toString())
        except Exception, e:
            print e