Exemple #1
0
        public void Add(EtudiantDAO Etudiant)
        {
            var index = .IndexOf(etudiant);

            if (index >= 0)
            {
                throw new DuplicateNameException("This student reference already exists !");
            }
            etudiant.Add(Etudiant);
            Save();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 public void Remove(EtudiantDAO etudiant)
 {
     etudiant.Remove(etudiant);//base sur Product.Equals redefini
     Save();
 }
Exemple #4
0
 public EtudiantBLO(string dbFolder)
 {
     etudiantRepo = new EtudiantDAO(dbFolder);
 }