Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 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!")
Beispiel #6
0
 def store_studenti(self, Student):
     if Student in self.__studenti:
         raise RepoError("Exista deja studentul!")
     
     self.__studenti.append(Student)
Beispiel #7
0
 def store_laboratoare(self, Laborator):
     if Laborator in self.__laboratoare:
         raise RepoError("Exista deja Laboratorul!")
     
     self.__laboratoare.append(Laborator)
Beispiel #8
0
 def searchById(self, idStudent):
     for student in self.__studenti:
         if student == idStudent:
             return student
         
     raise RepoError("Nu s-a gasit studentul!")
Beispiel #9
0
 def store_note(self, Nota):
     if Nota in self.__note:
         raise RepoError("Exista deja nota!")
     
     self.__note.append(Nota)