public void Add(EtudiantDAO Etudiant) { var index = .IndexOf(etudiant); if (index >= 0) { throw new DuplicateNameException("This student reference already exists !"); } etudiant.Add(Etudiant); Save(); }
public void Set(EtudiantDAO oldEtudiant, EtudiantDAO newEtudiant) { var oldIndex = etudiant.IndexOf(oldEtudiant); var newIndex = etudiant.IndexOf(newEtudiant); if (oldIndex < 0) { throw new KeyNotFoundException("l'etudiant n'existe pas !"); } if (newIndex >= 0 && oldIndex != newIndex) { throw new DuplicateNameException("This student reference already exists !"); } etudiant[oldIndex] = newEtudiant; Save(); }
public void Remove(EtudiantDAO etudiant) { etudiant.Remove(etudiant);//base sur Product.Equals redefini Save(); }
public EtudiantBLO(string dbFolder) { etudiantRepo = new EtudiantDAO(dbFolder); }