Example #1
0
    def displayData(self):
        self.student_id = student_id = gVar.student_id
        self.editing = False
        self.clearCtrls()

        student_details = fetch.studentDetails_id(student_id)
        
        if not student_details:
            return
        else:
            for p in self.panes:
                #rintp.GetName()
                p.displayData(student_id)
Example #2
0
    def displayData(self, student_id):
        self.student_details = student_details = fetch.studentDetails_id(student_id)
        if not student_details:
            # rint'not details found'
            return
        else:
            pass
            # rint'student_details : ', student_details

        name = student_details["name"]
        self.text_ctrl_name.SetValue(name)

        dob = student_details["dob"]
        self.datectrl_dob.SetValue(dob)

        faith_id = student_details["faith_id"]
        loadCmb.restore(self.choice_faith, faith_id)

        pob = str(student_details["pob"])
        loadCmb.restore_str(self.choice_pob, pob)

        blood_group_id = str(student_details["blood_type_id"])

        if student_details["gender"]:
            self.choice_gender.SetSelection(1)
        else:
            self.choice_gender.SetSelection(2)

        self.setCmb(self.choice_siblings_by_birth, student_details["siblings_by_birth"])
        self.setCmb(self.choice_siblings_step, student_details["siblings_step"])
        self.setCmb(self.choice_siblings_adopted, student_details["siblings_adopted"])

        if student_details["child_no"]:
            child_no = student_details["child_no"]
        else:
            child_no = 1
        self.choice_birth_order.SetSelection(child_no - 1)
Example #3
0
    def displayData(self, student_id):
        #rintself.GetName(), "make student id open to class   student_id=", student_id
        self.clearCtrls()
        
        #rint'x'
        
        self.student_id = student_id
        if not student_id:  return
        
        #rint'y'
        
        student_details = fetch.studentDetails_id(student_id)
        
        #rint'z', student_details
        
        if not student_details: return
        name = student_details['Nama']
        x  = str(student_details['TgLahir'])
        dob              = x.split(' ')[0]
        
        #rint'x'
        
        ailment          = ''#str(student_details['student_ailment'])
        faith_id         = student_details['Agama']
        
        previous_school_id = student_details['KSekolahAsal']
        
        birth_place      = str(student_details['TempatLahir'])
        edu_status       = ''     # ??? is this still needed
        edu_notes        = ''    # ??? seperate quiry on  table "edu_notes"
 
        blood_group_id   = str(student_details['GolDarah'])
        blood_group      = ''#fetch.bloodGroup(blood_group_id)
        
        siblings_birth    = student_details['SaudaraKandung']
        siblings_step     = student_details['SaudaraTiri']
        siblings_adopted  = student_details['SaudaraAngkat']
        if not siblings_step: siblings_step=0
        if not siblings_adopted: siblings_adopted =0
        birth_order      = student_details['AnakKe']
        if not birth_order:   birth_order = 1
        
        #rint'x'
        
        if student_details['Pria']:
            self.data_gender.SetLabel('male')
        else:
            self.data_gender.SetLabel('female')
        
        self.data_name.SetLabel(name)
        
        self.data_current_edu_status.SetLabel(edu_status)
        self.data_edu_notes.SetLabel(edu_notes)
        self.data_medical_notes.SetLabel(ailment)

        self.data_dob.SetLabel(dob)
            
        self.data_sibling_by_birth.SetLabel(str(siblings_birth))
        self.data_sibling_step.SetLabel(str(siblings_step))
        self.data_sib_adopted.SetLabel(str(siblings_adopted))
        self.data_birth_order.SetLabel(str(birth_order))

        previous_school = fetch.schoolName(previous_school_id)
        faith = fetch.faith(faith_id)
        
        self.data_faith.SetLabel(faith)
        self.data_pob.SetLabel(birth_place)
        self.data_school.SetLabel(previous_school)
        self.data_status.SetLabel(edu_status)
        self.data_blood_group.SetLabel(blood_group)
Example #4
0
    def displayData(self, student_id):
        #rintself.GetName(), "make student id open to class   student_id=", student_id
        self.clearCtrls()
        
        self.student_id = student_id
        if not student_id:  return
        
        student_details = fetch.studentDetails_id(student_id)
        #rint student_details
        if not student_details: return
        name = student_details['Nama']
        x  = str(student_details['TgLahir'])
        dob              = x.split(' ')[0]
        
        ailment          = ''#str(student_details['student_ailment'])
        faith_id         = student_details['Agama']
        
        previous_school_id = student_details['KSekolahAsal']
        
        birth_place      = str(student_details['TempatLahir'])
        edu_status       = ''     # ??? is this still needed
        edu_notes        = ''    # ??? seperate quiry on  table "edu_notes"
        #address          = ''#str(student_details['address_line1']) + "\n" + str(student_details['address_line2'])
        #address         += str(student_details['city'])          + "\n" + str(student_details['state'])
        #address         += str(student_details['pin_code'])      + "\n" + str(student_details['country_id'])
        #telephone        = ''# str(student_details['phone1'])        + "\n" + str(student_details['phone2'])
        
        blood_group_id   = str(student_details['GolDarah'])
        blood_group      = ''#fetch.bloodGroup(blood_group_id)
        
        siblings_birth    = student_details['SaudaraKandung']
        siblings_step     = student_details['SaudaraTiri']
        siblings_adopted  = student_details['SaudaraAngkat']
        if not siblings_step: siblings_step=0
        if not siblings_adopted: siblings_adopted =0
        birth_order      = student_details['AnakKe']
        if not birth_order:   birth_order = 1
        
        if student_details['Pria']:
            gender_index = 1
        else:
            gender_index = 2 

        self.text_ctrl_name.SetValue(name)
        
        self.text_ctrl_current_edu_status.SetValue(edu_status)
        self.text_ctrl_edu_notes.SetValue(edu_notes)
        self.text_ctrl_medical_notes.SetValue(ailment)

        #self.text_ctrl_address.SetValue('')
        #self.text_ctrl_telephone.SetValue('') 
        
        if dob: # "should be of format : 2012-06-26"                
            self.date_ctrl_dob.SetValue(dob)
            
        self.spin_sibling_by_birth.SetValue(siblings_birth)
        self.spin_sibling_step.SetValue(siblings_step)
        self.spin_sib_adopted.SetValue(siblings_adopted)
        self.spin_birth_order.SetValue(birth_order)
        
        self.choice_gender.SetSelection(gender_index)
        
        loadCmb.restore(self.choice_faith,  faith_id)
        loadCmb.restore_str(self.choice_pob,  birth_place)
        loadCmb.restore(self.choice_schools,     previous_school_id)
        loadCmb.restore_str(self.choice_status,    edu_status)
        loadCmb.restore_str(self.choice_blood_group, blood_group)