Ejemplo n.º 1
0
        public void AddHeadman(string firstName, string lastName, int age, string phoneNumber, int group, int scholarship = Headman.MinScholarship, int knowlageLevel = (int)EKnowlageLevel.average)
        {
            int groupIndex = FindGroupIndex(group);

            if (groupIndex == -1)
            {
                throw new NonExistingGroupException();
            }

            if (FindStudentIndex(firstName, lastName) != -1)
            {
                throw new ExistingFullNameException();
            }

            if (StudentGroups[groupIndex].GroupHeadmanExists())
            {
                throw new GroupHeadmanAlreadyExistException();
            }

            Headman headman = new Headman(firstName, lastName, age, phoneNumber, group, scholarship, knowlageLevel);

            StudentGroups[groupIndex].AddStudent(headman);
            StudentGroups[groupIndex].AddHeadman(headman);
            Students.Add(headman);
        }
Ejemplo n.º 2
0
 public bool AddHeadman(Headman headman)
 {
     if (!GroupHeadmanExists())
     {
         GroupHeadman = headman;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 private void RemoveHeadman()
 {
     GroupHeadman = null;
 }