def button_click(self): g = Db() g.createDatas() g.createStudent() g.createSession() g.createTerm() for z in self.sessions: g.createExpenses(z) g.createStores(z) g.createAwards(z) g.createConducts(z) g.createMails(z) g.createMedicals(z) arr = g.selectn('terms', '', '', {'id':z}) for t1 in arr: t = t1['id'] g.createClass(t) g.createSubject(t) g.createFee(t) g.createPay(t) g.createResult(t) g.createAffective(t) g.createPsychomoto(t) for c in self.list_data: try: g.replacePandas(c) except: pass off = OfflineDialog() off.clearFolder()
def button_click(self, a): # shost is a QString object a.close() s1 = self.le.text() s2 = self.le2.date().toPyDate() s3 = self.le3.date().toPyDate() g = Db() try: if (len(s1) > 0): y = {'name': s1, 'start_date': s2, 'end_date': s3, 'active': 0} z = g.insert('session', y) if z and z > 0: g.createExpenses(z) g.createStores(z) g.createAwards(z) g.createConducts(z) g.createMails(z) g.createMedicals(z) else: pass except: pass try: self.button_close() except: pass try: self.close() except: pass
def button_add(self): s1 = self.le1.text() _datef = self.fromData.date().toPyDate() _datef = time.mktime(_datef.timetuple()) _datee = self.toData.date().toPyDate() _datee = time.mktime(_datee.timetuple()) g = Db() if self.sessionID and self.sessionID > 0: try: if (len(s1) > 0): y = { 'name': s1.lower(), 'start_date': _datef, 'sessionID': self.sessionID, 'end_date': _datee, 'active': 0 } z = g.insert('terms', y) if z and z > 0: g.createClass(z) g.createSubject(z) g.createFee(z) g.createPay(z) g.createResult(z) g.createAffective(z) g.createPsychomoto(z) self.makeTree() self.button_reset() self.par.menuSession() self.par.dropdownSession() else: pass except: pass else: try: if (len(s1) > 0): y = { 'name': s1.lower(), 'start_date': _datef, 'end_date': _datee, 'active': 0 } z = g.insert('session', y) if z and z > 0: g.createExpenses(z) g.createStores(z) g.createAwards(z) g.createConducts(z) g.createMails(z) g.createMedicals(z) self.makeTree() self.button_reset() self.par.menuSession() self.par.dropdownSession() else: pass except: pass
def button_click(self, a, b): # shost is a QString object b.close() s1 = self.le.text() s2 = self.le2.date().toPyDate() s3 = self.le3.date().toPyDate() self.a = a g = Db() if (len(s1) > 0): y = {'name': s1, 'start_date': s2, 'end_date': s3} z = {'id': self.a} g.update('session', y, z) if z and z > 0: g.createExpenses(self.a) g.createStores(self.a) g.createAwards(self.a) g.createConducts(self.a) g.createMails(self.a) g.createMedicals(self.a) self.form = SessionForm() self.form.show() self.close()