Пример #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