def carregarDisciplinas(self): disc = Disciplina() prof = Professor() self.listDisc = disc.listaDb() self.listDiscBox = [] for i in self.listDisc: prof.carregar(i[1]) self.listDiscBox += [str(i[0]) + ' - ' + str(prof.getNome())] self.listaDisciplinasTodas.Set(self.listDiscBox)
def carregarDisc(self): disc = Disciplina() prof = Professor() self.listDisc = disc.listaDb() listDiscBox = [] self.listDiscId = [] for i in self.listDisc: prof.carregar(i[1]) listDiscBox += [str(i[0]) + ' - ' + str(prof.getNome())] self.discListBox.Set(listDiscBox)
def OnBotaoExcluirButton(self, event): prof = Professor() if self.campoCPF.GetValue() != '': if prof.carregar(self.campoCPF.GetValue()): prof.delete(self.campoCPF.GetValue()) self.erroText.SetLabel('Excluido com Sucesso!') self.zerar() else: self.erroText.SetLabel('CPF nao encontrado!') return 0 else: self.erroText.SetLabel('Insira um CPF para excluir um Professor!') return 0 event.Skip()
def buscaCpfBox(self): prof = Professor() if self.campoCPF.GetValue() == '': self.erroText.SetLabel('Preencha o campo CPF corretamente!') return 0 else: if prof.carregar(self.campoCPF.GetValue()): None else: self.erroText.SetLabel('CPF nao encontrado!') return 0 data = str(prof.getData()).split('-') nasc = '' for i in range(len(data) - 1, -1, -1): if nasc == '': nasc += data[i] else: nasc += '-' + data[i] self.campoNascimento.SetValue(nasc) self.campoNome.SetValue(prof.getNome()) if prof.getSexo == 2: self.botaoFeminino.SetValue(True) else: self.botaoMasc.SetValue(True) self.campoCep.SetValue(str(prof.getCep())) self.campoEndereco.SetValue(prof.getRua()) self.campoBairro.SetValue(prof.getBairro()) self.campoCidade.SetValue(prof.getCidade()) self.campoNumero.SetValue(str(prof.getNum())) self.campoUF.SetValue(prof.getUf()) if prof.getComp() == None: None else: self.campoComplemento.SetValue(prof.getComp()) if prof.getTelefone() == None: None else: self.campoFixo.SetValue(str(prof.getTelefone())) if prof.getCelular() == None: None else: self.campoCelular.SetValue(str(prof.getCelular())) self.erroText.SetLabel('Carregado com Sucesso!')
def buscaCpfBox(self): prof = Professor() if self.campoCPF.GetValue() == '': self.erroText.SetLabel('Preencha o campo CPF corretamente!') return 0 else: if prof.carregar(self.campoCPF.GetValue()): None else: self.erroText.SetLabel('CPF nao encontrado!') return 0 data = str(prof.getData()).split('-') nasc = '' for i in range(len(data)-1, -1, -1): if nasc == '': nasc += data[i] else: nasc += '-' + data[i] self.campoNascimento.SetValue(nasc) self.campoNome.SetValue(prof.getNome()) if prof.getSexo == 2: self.botaoFeminino.SetValue(True) else: self.botaoMasc.SetValue(True) self.campoCep.SetValue(str(prof.getCep())) self.campoEndereco.SetValue(prof.getRua()) self.campoBairro.SetValue(prof.getBairro()) self.campoCidade.SetValue(prof.getCidade()) self.campoNumero.SetValue(str(prof.getNum())) self.campoUF.SetValue(prof.getUf()) if prof.getComp() == None: None else: self.campoComplemento.SetValue(prof.getComp()) if prof.getTelefone() == None: None else: self.campoFixo.SetValue(str(prof.getTelefone())) if prof.getCelular() == None: None else: self.campoCelular.SetValue(str(prof.getCelular())) self.erroText.SetLabel('Carregado com Sucesso!')