Пример #1
0
 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()
Пример #2
0
    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
Пример #3
0
 def button_click(self, a, b):
     # shost is a QString object
     b.close()
     self.a = a
     s1 = self.le.text()
     g = Db()
     try:
         if(len(s1) > 0):
             y = { 'name':s1, 'sessionID':self.a,  'start_date':s2, 'end_date':s3, 'active':0}
             z = g.insert('terms', y)
             
             if z and z > 0:
                 g.createClass(z)
                 g.createFee(z)
                 g.createResult(z)   
         else:
             pass
     except:
         pass
     
     try:
         self.lunchForm(self.a)
     except:
         pass
     try:
         self.close()
     except:
         pass
Пример #4
0
 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('terms', y, z)
         if self.a and self.a > 0:
                 g.createClass(self.a)
                 g.createFee(self.a)
                 g.createResult(self.a) 
     
     self.form = TermForm(self.a)
     self.form.show()
     self.close()