Esempio n. 1
0
        public void MoveStudentInGroup(string numberGroup, string id)
        {
            if (numberGroup == null)
            {
                throw new ArgumentException();
            }
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            IStudent e = GetStudent(id);
            IGroup   g = GetGroup(numberGroup);

            g.AddStudent(new Student(e.Name, e.DateBirthday, e.Id));
            Students.Remove(e);
        }
Esempio n. 2
0
        public void MoveStudentToAnotherGroup(string id, string toNumberGroup)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (toNumberGroup == null)
            {
                throw new ArgumentException();
            }
            IGroup g1 = GetGroup(id.Substring(0, 5));
            IGroup g2 = GetGroup(toNumberGroup);
            var    s  = g1.GetStudent(id);

            g2.AddStudent(s);
            g1.RemoveStudent(id);
        }