Example #1
0
 def __do_main(self):
     loadCmb.fillCmb(self.choice_school, ((2, "SD"), (3,"SM")))
     gVar.school_id = 2
     loadCmb.restore(self.choice_school, 2)
     self.choice_semester.Select(0)
     gVar.semester = 1
     loadCmb.restore_str(self.choice_semester, '1')
     
     self.displayData()
Example #2
0
 def __do_main(self):
     self.current_panel = self.panel_excul_set_days
     loadCmb.fillCmb(self.choice_school, ((2, "SD"), (3,"SM")))
     gVar.school_id = 2
     loadCmb.restore(self.choice_school, 2)
     #self.choice_semester.Select(0)
     gVar.semester = 1
     loadCmb.restore_str(self.choice_semester, '1')
     self.OnSwitch(self.button_set_days.EventHandler)
Example #3
0
 def OnNewDivision(self, evt):
     dlg = wx.TextEntryDialog(self, 'division name', 'New division name', '')
     if dlg.ShowModal() == wx.ID_OK:
         new_name = dlg.GetValue().strip()
         if new_name:
             sql = "SELECT name \
                      FROM acc_divisions \
                     WHERE name = '%s'" % new_name
             if fetch.getCount(sql):
                 msg = "Sorry division '%s' already exists" % new_name
                 fetch.msg(msg)
             else:
                 sql = "INSERT INTO acc_divisions \
                                    (name) \
                             VALUES ('%s')" % (new_name)
                 #rintsql
                 fetch.updateDB(sql)
                 self.loadDivisions()
                 loadCmb.restore_str(self.choice_division, new_name)
     dlg.Destroy()
Example #4
0
    def OnNewSupplier(self, evt):
        #rint"open dlgTextEntry 'new supplier' "
        dlg = wx.TextEntryDialog(self, 'Supplier Name', 'New Supplier Name', '')
 
        if dlg.ShowModal() == wx.ID_OK:
            new_name = dlg.GetValue().strip()
            if new_name:
                sql = "SELECT name \
                         FROM acc_suppliers \
                        WHERE name = '%s'" % new_name
                if fetch.getCount(sql):
                    msg = "Sorry supplier '%s' already exists" % new_name
                    fetch.msg(msg)
                else:
                    sql = "INSERT INTO acc_suppliers \
                                       (name) \
                                VALUES ('%s')" % new_name
                    fetch.updateDB(sql)
                    self.loadSuppliers()
                    loadCmb.restore_str(self.choice_supplier, new_name)