Пример #1
0
        public bool RemoveCourse(Course c)
        {
            if (c == null)
                throw new NullReferenceException();

            string name = c.Name;

            if (_listcourse.ContainsKey(name))
            {
                _listcourse.Remove(name);
                return true;
            }
            else
            {
                return false;
            }
        }
Пример #2
0
        // COURSE
        public Course AddCourse(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new NullReferenceException();
            }

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

            Course c = new Course(name, this);
            _listcourse.Add(name, c);
            return c;
        }