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