def delete_laborator(self, laborator): if laborator not in self.__laboratoare: raise RepoError("Nu exista laoratorul de sters!") for i in range(len(self.__laboratoare)): if self.__laboratoare[i] == laborator: del self.__laboratoare[i] return
def delete_student(self, Student): if Student not in self.__studenti: raise RepoError("Nu exista studentul de sters!") for i in range(len(self.__studenti)): if self.__studenti[i] == Student: del self.__studenti[i] return
def recursiveSearchById(self, idStudent, indice): '''recursiv''' if indice < 0: raise RepoError("NU s-a gasit studentul!") if self.__studenti[indice] == idStudent: return self.__studenti[indice] return self.recursiveSearchById(idStudent, indice-1)
def recursiveDelete(self, student, ok, indice): if ok == 1: return if indice < 0: raise RepoError("NU exista studentul!") if self.__studenti[indice] == student: ok = 1 del self.__studenti[indice] return return self.recursiveDelete(student, ok, indice-1)
def searchById(self, nrlab, nrprb): for lab in self.__laboratoare: if lab.get_numar_problema() == nrprb and lab.get_numar_laborator() == nrlab: return lab raise RepoError("Nu s-a gasit lab!")
def store_studenti(self, Student): if Student in self.__studenti: raise RepoError("Exista deja studentul!") self.__studenti.append(Student)
def store_laboratoare(self, Laborator): if Laborator in self.__laboratoare: raise RepoError("Exista deja Laboratorul!") self.__laboratoare.append(Laborator)
def searchById(self, idStudent): for student in self.__studenti: if student == idStudent: return student raise RepoError("Nu s-a gasit studentul!")
def store_note(self, Nota): if Nota in self.__note: raise RepoError("Exista deja nota!") self.__note.append(Nota)