def studentData(student_id): student_id = int(student_id) if not student_id: return name = fetch.studentFullName(student_id) #rint ' popup details for student ', student_id, name school_name = '' course_title = '' batch_name = '' # bs.batch_id, n.nis, s.first_name, s.middle_name, s.last_name, \ # s.birth_date, s.gender, s.ship_id, b.course_title_id, ct.school_id, s.national_no, ct.course_level studentDetails = fetch.studentSchDetails(student_id) age = '' gender = '' ship = '' if studentDetails: school_id = studentDetails['school_id'] school_name = fetch.schoolName(school_id) course_title_id = studentDetails['course_title_id'] course_title = fetch.courseTitle(course_title_id) age = studentDetails['birth_date'] gender = fetch.gender(studentDetails['gender']) ship = fetch.shipName(studentDetails['ship_id']) batch_id = fetch.batchID_forStudent(student_id) if batch_id: batch_name = fetch.batchName(batch_id) schDetails(name, school_name, course_title, batch_name, age, gender, ship)
def populateExcul(list_ctrl, session_id): list_ctrl.DeleteAllItems() if not session_id: return studentList = [] selected_id = selectedItemID(list_ctrl) reselectIndex = selectedItemIndex(list_ctrl) studentId_list = fetch.studentIDs_forExcul(session_id) if not studentId_list: return [] index = 0 for student_id in studentId_list: # rint student_id index = list_ctrl.Append(str(student_id)) list_ctrl.SetStringItem(index, 0, str(student_id)) name = fetch.studentFullName(student_id) list_ctrl.SetStringItem(index, 1, name) decorateBanding(list_ctrl) list_ctrl.Select(reselectIndex) list_ctrl.SetFocus() return studentId_list
def populateExculRemainingStudents(list_ctrl, student_list): # rint 'populateExculRemainingStudents=', list_ctrl list_ctrl.DeleteAllItems() for student_id in student_list: index = list_ctrl.Append(str(student_id)) list_ctrl.SetStringItem(index, 0, str(student_id)) name = fetch.studentFullName(student_id) list_ctrl.SetStringItem(index, 1, name) decorateBanding(list_ctrl)
def listStudents(grid, studentIDs, rowHeight): clearRowsBeyond(grid, 0) r = 0 for student_id in studentIDs: name = fetch.studentFullName(student_id) ckid = fetch.ckid(student_id) grid.AppendRows() grid.SetRowSize(r, rowHeight) grid.SetCellValue(r, 0, ckid) grid.SetCellValue(r, 1, name) r += 1
def populateStudentsForLesson(list_ctrl, lesson_id): studentList = [] selected_id = selectedItemID(list_ctrl) reselectIndex = selectedItemIndex(list_ctrl) list_ctrl.DeleteAllItems() if lesson_id: slist = fetch.studentIDs_inStudygroup(lesson_id) index = 0 for student_id in slist: index = list_ctrl.Append(str(student_id)) list_ctrl.SetStringItem(index, 0, str(student_id)) name = fetch.studentFullName(student_id) list_ctrl.SetStringItem(index, 1, name) if (index % 2) == 0: list_ctrl.SetItemBackgroundColour(index, wx.Colour(215, 215, 235)) list_ctrl.Select(reselectIndex) list_ctrl.SetFocus()
def populateStudentsForBatch(list_ctrl, batch_id): studentList = [] selected_id = selectedItemID(list_ctrl) reselectIndex = selectedItemIndex(list_ctrl) list_ctrl.DeleteAllItems() if batch_id: slist = fetch.students_inBatch(batch_id) index = 0 for row in slist: student_id = row["id"] # rint 'str(student_id)', str(student_id) index = list_ctrl.Append(str(index)) name = fetch.studentFullName(student_id) list_ctrl.SetStringItem(index, 0, str(student_id)) list_ctrl.SetStringItem(index, 1, name) decorateBanding(list_ctrl) list_ctrl.Select(reselectIndex) list_ctrl.SetFocus()
def displayData(self): self.student_id = student_id = gVar.student_id self.invoice_id = fetch.nextID('acc_invoices"') mnth = 1 mnth = str(mnth).zfill(2) invNo = str(self.invoice_id).zfill(5) self.invoice_no = '%d.%s.%s' % (gVar.schYr, mnth, invNo) self.text_ctrl_invoice_no.SetValue(self.invoice_no) self.date_picker_ctrl.setDateToday() name = fetch.studentFullName(student_id) self.text_ctrl_student_name.SetValue(str(name)) self.PanelInvoice.displayData(self.student_id) self.PanelInvoice.invoice_id=self.invoice_id
def displayData(self, sid): #rint'displayData', sid global student_id, NoInduk, student_name, form_name student_id = sid NoInduk = fetch.NoInduk(student_id, gVar.schYr) student_name = fetch.studentFullName(student_id) form_name = fetch.formName(fetch.formID_forStudent(student_id)) ck_ref = 'xxxx-xxx' inv_date = '2015-12-1' self.panel_header.display_header() loadCmb.products(self.choice_products) self.panel_fees.displayData(student_id) inv_total = 0 invoice_date = '' ck_ref = '' self.invoice_details = {'amount': inv_total, 'ck_ref': ck_ref, 'date': inv_date, 'schYr': gVar.schYr, 'name': student_name, 'NoInduk': NoInduk, 'form_name':form_name} self.invoice_items = {} product_type_id = 1 # school fee min_month = fetch.month_last_paid(student_id, gVar.schYr, product_type_id) self.load_cmb_months(min_month) self.months = 1 self.Layout