def OnLogin(self, event): #dlg=DlgLogin.create(None) #res = dlg.ShowModal() #dlg.Destroy() if res == wx.ID_OK: self.HighlightBtn(0) self.button_login.SetLabel('Change User') name = fetch.employeeName(gVar.user_id) self.button_username.SetLabel(name) elif res == wx.ID_CANCEL: if not gVar.user_id: self.Close()
def populateWithListEmployees(list_ctrl, employeeIDs): list_ctrl.DeleteAllItems() if not teacherIDs: return # rint 'populateWithListTeachers;',teacherIDs for employee_id in employeeIDs: # rint 'staff_id=',staff_id employeeName = fetch.employeeName(employee_id) index = list_ctrl.Append(str(employee_id)) list_ctrl.SetStringItem(index, 0, str(employee_id)) # display staff_id # if staff_id==selected_id: reselectIndex = index list_ctrl.SetStringItem(index, 1, employeeName) # full name decorateBanding(list_ctrl)
def populateExculTeachers(list_ctrl, employeeIDs): return # rint "populateExculTeachers: teacherIDs:", teacherIDs list_ctrl.DeleteAllItems() if not employeeIDs: return # rint 'teacherIDs', teacherIDs for employee_id in employeeIDs: employeeName = fetch.employeeName(int(employee_id)) # rint 'teacher_id;', teacher_id, ' name=', teacherName if employeeName: index = list_ctrl.Append(str(employee_id)) list_ctrl.SetStringItem(index, 0, str(employee_id)) list_ctrl.SetStringItem(index, 1, employeeName) decorateBanding(list_ctrl)
def OnBeginDragTeacher(self, event): index = self.vlist_ctrl_teacher_pool.GetFirstSelected() if index < 0: return employee_id = int(self.vlist_ctrl_teacher_pool.GetItemText(index)) title = self.vlist_ctrl_teacher_pool.GetItem(index, 1).GetText() source = self.vlist_ctrl_teacher_pool.GetName() data = '%s:%s:%s' % (str(employee_id), str(title), source) """ Begin a Drag Operation """ todrop = wx.PyTextDataObject(data) drop_source = wx.DropSource(self.list_ctrl_excul) # Create a DropSourceObject, for Drag operation drop_source.SetData(todrop) # Associate the Data to be dragged with the Drop Source Object drop_source.DoDragDrop(True) # Intiate the Drag Operation new_list = self.newTeacherList(employee_id) if flag_insertion == 'replaced': new_list.append((g_replace_teacher_id, fetch.employeeName(g_replace_teacher_id))) self.teacherPoolDATA = fetch.build_dictionary(new_list) self.vlist_ctrl_teacher_pool.SetItemMap(self.teacherPoolDATA)
def __do_main(self): if fetch.useConnection[0]=='localhost': self.SetTitle('Connected to Vostro') else:self.SetTitle('Localy connected to main server') self.current_panel_idx = 0 self.SetSizeWH(1200, 900) self.Center() self.makeAdminPopupMenu() #self.login() gVar.user_id = 103 self.button_last.Disable() self.button_next.Disable() txt = 'Loged in as: %s | LOGOUT' % fetch.employeeName(gVar.user_id) self.button_login.SetLabel(txt) #self.button_admin.Show(fetch.hasPermission('Admin')) self.showSemester(False) self.Layout() self.HighlightBtn(0) self.changeYear(0)
def addToTeacherPool(self, employee_id): self.teacherPoolDATA[len(self.teacherPoolDATA)] = (int(employee_id), fetch.employeeName(employee_id)) self.vlist_ctrl_teacher_pool.SetItemMap(self.teacherPoolDATA)