public bool RemovePupil(Pupil p) { if (p == null) throw new ArgumentException(); string name = p.Name; if (_listpupil.ContainsKey(name)) { _listpupil.Remove(name); return true; } else { return false; } }
//PUPIL public Pupil AddPupil(string name, string firstname) { if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(firstname)) { throw new NullReferenceException(); } if (_listpromotion.ContainsKey(name)) { throw new ArgumentException(); } Pupil pupil = new Pupil(name,firstname, this); _listpupil.Add(name, pupil); return pupil; }