Exemplo n.º 1
0
        public bool RemoveTeacher(Teacher t)
        {
            if (t == null)
                throw new NullReferenceException();

            string name = t.Name;

            if (_listteacher.ContainsKey(name))
            {
                _listteacher.Remove(name);
                return true;
            }
            else
            {
                return false;
            }
        }
Exemplo n.º 2
0
        public void AddTeacher(Teacher t)
        {
            if (t == null)
                throw new NullReferenceException();

            string name = t.Name;
            _listteacher.Add(name, t);
        }
Exemplo n.º 3
0
        //TEACHER
        public Teacher AddTeacher(string name, string firstname)
        {
            if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(firstname))
            {
                throw new NullReferenceException();
            }

            if (_listteacher.ContainsKey(name))
            {
                throw new ArgumentException();
            }

            Teacher teacher = new Teacher(name, firstname, this);
            _listteacher.Add(name, teacher);
            return teacher;
        }