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); }
public bool AddHeadman(Headman headman) { if (!GroupHeadmanExists()) { GroupHeadman = headman; return(true); } return(false); }
private void RemoveHeadman() { GroupHeadman = null; }