Ejemplo n.º 1
0
    def OnChoiceStatusChange(self, evt):
        rereg_status = fetch.cmbValue(self.choice_status)
        self.showHideCourses(rereg_status =='continue')# or rereg_status =='retake')

        loadCmb
        rereg_status = fetch.cmbValue(self.choice_status)
        if rereg_status =='continue':
            #rint"gVar.schYr+1, self.next_level", gVar.schYr+1, self.next_level
            loadCmb.courses_forLevel_forYear(self.choice_course, gVar.schYr+1, self.next_level)
            
        if rereg_status =='retake':
            # load choices - same level courses
            pass
        
        self.Layout()    
Ejemplo n.º 2
0
    def displayData(self, student_id, NoInduk, KKelas):
        #rint"panel_edit_rereg_status : displayData"
        # query for bookings
        #sql = "SELECT Kode, Nama, Status FROM CSiswa WHERE Kode%d" % student_id
        loadCmb.courses_forYear(self.choice_course, gVar.schYr+1)
        self.KKelas  = KKelas
        self.NoInduk = NoInduk
        # query for rereg
        sql = "SELECT s.id, s.NoInduk, s.name, sbf.rereg_status, sbf.next_course_id \
                 FROM students_by_form \
                 JOIN students ON sbf.student_id = Siswa.id \
                WHERE sbf.student_id = '%s' \
                  AND f.id = %d" % (student_id, form_id)
        res = fetch.getOneDict(sql)
        
        self.next_level = fetch.form_level(KKelas)+1
        
        #rintsql, res
        if res:
            name = res['Nama']
            self.text_ctrl_name.SetValue(name)
            
            rereg_status = res['ReregStatus']
            course_id    = res['NextCourseID']
            
            if rereg_status =='?':
                self.choice_status.Select(0) # ?
                        
            elif rereg_status == "continue":
                #rint "continue"
                loadCmb.courses_forLevel_forYear(self.choice_course, gVar.schYr+1, self.next_level)
                loadCmb.restore(self.choice_course, course_id)
                    
            elif rereg_status == "retake":
                    self.choice_status.Select(2)    
            
            elif rereg_status == "exit":
                    self.choice_status.Select(3)
                    
            self.showHideCourses(rereg_status =='continue' or rereg_status =='retake')

            self.text_ctrl_refNo.SetValue('')
            self.Layout()