예제 #1
0
    def displayData(self, address_id=0):
        self.numCtrlActive = False
        self.address_id = address_id
        self.loadAllCombos()
        self.num_ctrl_postcode.SetValue(0)

        sql = "SELECT poscode FROM addresses WHERE address_id = %d" % address_id
        postcode = fetch.getStr(sql)
        if postcode:
            sql = "SELECT * FROM postcodes WHERE postcode =%d" % postcode
            dataSet = fetch.getOneDict(sql)
            self.num_ctrl_postcode.SetValue(dataSet["postcode"])
            kelurahan, kecamatan, kabupaten, province = (
                dataSet("kelurahan"),
                dataSet("kecamatan"),
                dataSet("kabupaten"),
                dataSet("province"),
            )

            if kelurahan:
                loadCmb.restore_str(self.combo_kabupaten, kabupaten)
                self.loadCmbsUnderKab(kabupaten)

            elif kecamatan:
                loadCmb.restore_str(self.combo_kecamatan, kecamatan)
                self.loadCmbsUnderKec(kecamatan)

            elif kelurahan:
                loadCmb.restore_str(self.combo_kelurahan, kelurahan)
                self.loadCmbsUnderKal(kelurahan)
예제 #2
0
    def OnPostcode(self, event):
        if self.numCtrlActive:
            return

        postcode = self.num_ctrl_postcode.GetValue()
        if postcode:
            for c in self.combos:
                c.SetSelection(-1)
            sql = (
                "SELECT kecamatan, kabupaten, province \
                     FROM postcodes \
                    WHERE postcode = %d"
                % postcode
            )
            res = fetch.getOneDict(sql)
            if res:
                province = res["province"]
                kecamatan = res["kecamatan"]
                kabupaten = res["kabupaten"]
                if kecamatan:
                    loadCmb.restore_str(self.combo_kecamatan, kecamatan)
                    self.loadCmbsUnderKec(kecamatan)

                elif kabupaten:
                    loadCmb.restore_str(self.combo_kabupaten, kabupaten)
                    self.loadCmbsUnderKab(kabupaten)

                elif province:
                    loadCmb.restore_str(self.province, province)
                    self.loadCmbsUnderProv(province)
예제 #3
0
 def OnPostcode(self, event):
     postcode = self.num_ctrl_postcode.GetValue()
     if postcode:
         for c in self.combos:
             c.SetSelection(-1)
         
         sql = "SELECT kelurahan, kecamatan, kabupaten, province FROM postcodes \
                 WHERE  postcode = %d" % postcode
         
         res = fetch.getOneDict(sql)
         #rintsql, res
         if res:
             province  = res['province']
             kelurahan = res['kelurahan']
             kecamatan = res['kecamatan']
             kabupaten = res['kabupaten']
             if province == 'Sumatera Utara':
                 if kelurahan:
                     loadCmb.restore_str(self.combo_box_kel, kelurahan)
                     self.loadCmbsUnderKel(kelurahan)
                 elif kecamatan:
                     self.loadCmbsUnderKec(kecamatan)
                 elif kabupaten:    
                     self.loadCmbsUnderKab(kabupaten)
             else:
예제 #4
0
 def displayData(self, student_id):
     #rint'panel_student_details.displayData', student_id
     
     self.panel_student_bio.displayData(student_id)
     self.contact_panels=[]
     
     if student_id:
         sql = "SELECT KOrangTua, KWali \
                  FROM Siswa \
                 WHERE CKID = %d" % int(student_id)
         details = fetch.getOneDict(sql)
         #rintsql, details
         if not details:
             #rint'no KOrangTua'
             return
         KOrangTua = details['KOrangTua']
         KWali     = details['KWali']
         
         if KOrangTua:
             sql = "SELECT * FROM OrangTua \
                 WHERE Kode = %d" % int(KOrangTua)
             details = fetch.getOneDict(sql)
 
             if details['NamaA']:
                 ##rintdetails['NamaA']
                 p=self.OnAddGuardian(wx.Event)
                 p.head('FATHER')
                 #p.labelHead.SetBackgroundColour((255, 200, 255))
                 p.displayData(student_id, KOrangTua, 'father')
                 
             if details['NamaI']:
                 ##rintdetails['NamaI']
                 p=self.OnAddGuardian(wx.Event)
                 p.head('MOTHER')
                 #p.labelHead.SetBackgroundColour((255, 255, 200))
                 p.displayData(student_id, KOrangTua, 'mother')
                 
         if KWali:
             sql = "SELECT * FROM Wali \
                 WHERE Kode = %d" % int(KWali)
             details = fetch.getOneDict(sql)
             ##rintsql, details
             p = self.OnAddGuardian()
             p.head('GUARDIAN')
             #p.labelHead.SetBackgroundColour((200, 255, 255))
             p.displayData(student_id, KWali, 'guardian')
     self.Layout()
예제 #5
0
파일: _guardian.py 프로젝트: ckSchool/bucky
 def guardian(self, gid):
     sql = "SELECT * FROM Wali WHERE Kode = %d" % gid
     res = fetch.getOneDict(sql)
     if not res: return
     
     makeStr = self.makeStr
     
     Nama = res['Nama']
     TgLahir = makeStr(res['TgLahir'])
     Pekerjaan = res['Pekerjaan']
     PekerjaanLain = res['PekerjaanLain']
     Alamat = res['Alamat']
     HP = res['HP']
     Telepon = res['Telepon']
     Agama = res['Agama']
     
     self.setData(Nama,TgLahir,Pekerjaan,PekerjaanLain,Alamat,HP,Telepon,Agama)
예제 #6
0
파일: _guardian.py 프로젝트: ckSchool/bucky
 def father(self, gid):
     sql = "SELECT * FROM OrangTua WHERE Kode = %d" % gid
     res = fetch.getOneDict(sql)
     if not res: return
     ##rintres
     makeStr = self.makeStr
     Nama = res['NamaA']
     TgLahir = makeStr(res['TgLahirA'])
     Pekerjaan = res['PekerjaanA']
     PekerjaanLain = res['PekerjaanLainA']
     Alamat = res['AlamatA']
     HP = res['HPA']
     Telepon = res['TeleponA']
     Agama = res['AgamaA']
     
     self.setData(Nama,TgLahir,Pekerjaan,PekerjaanLain,Alamat,HP,Telepon,Agama)
     self.label_relationship.Hide()
     self.choice_relationship.Hide()
예제 #7
0
    def OnPostcode(self, evt):
        #rint 'OnPostcode'
        if self.numCtrlActive:  return
        
        postcode = self.num_ctrl_postcode.GetValue()
        if postcode:
            for c in self.combos: c.SetSelection(-1)
            sql = "SELECT id, itemName \
                     FROM addressItems \
                    WHERE postcode = %d" % postcode
            res = fetch.getOneDict(sql)
            if res:
                iid  = res['id']
                kecamatan = res['itemName']
                if kecamatan:
                    loadCmb.restore(self.combo_kecamatan, iid)
		    fetch.msg('postcode')
                    self.loadCmbsUnderKecID(iid)
예제 #8
0
    def displayData(self, postcode=0):
        self.loadAllCombos()
        self.num_ctrl_postcode.SetValue(0)

        if postcode:
            sql = "SELECT * FROM postcodes WHERE postcode =%d" % postcode
            dataSet = fetch.getOneDict(sql)
            self.num_ctrl_postcode.SetValue(dataSet['postcode'])
            kelurahan, kecamatan, kabupaten = (dataSet('kelurahan'), dataSet('kecamatan'), dataSet('kabupaten'))
            
            if kelurahan:
                loadCmb.restore_str(self.combo_box_kab, kabupaten)
                self.loadCmbsUnderKab(kabupaten)
                
            elif kecamatan:
                loadCmb.restore_str(self.combo_box_kec, kecamatan)
                self.loadCmbsUnderKec(kecamatan)
                
            elif kelurahan:
                loadCmb.restore_str(self.combo_box_kel, kelurahan)
                self.loadCmbsUnderKal(kelurahan)
예제 #9
0
파일: _guardian.py 프로젝트: ckSchool/bucky
 def mother(self, gid):
     sql = "SELECT * FROM OrangTua WHERE Kode = %d" % gid
     res = fetch.getOneDict(sql)
     if not res: return
     makeStr = self.makeStr
     Nama = res['NamaI']
     TgLahir = makeStr(res['TgLahirI'])
     Pekerjaan = res['PekerjaanI']
     PekerjaanLain = res['PekerjaanLainI']
     
     if res['SamaDenganAyah']:
         Alamat = res['AlamatA']
     else:
         Alamat = res['AlamatI']
         
     HP = res['HPI']
     Telepon = res['TeleponI']
     Agama = res['AgamaI']
     
     self.setData(Nama,TgLahir,Pekerjaan,PekerjaanLain,Alamat,HP,Telepon,Agama)
     
     self.label_relationship.Hide()
     self.choice_relationship.Hide()