Example #1
0
 public void removeAttendance(Attendance attendance, User currUser)
 {
     if (!currUser.Admin && currUser != Owner && currUser != attendance.Person)
     {
         throw new InvalidAccessException();
     }
     else if (!Attendances.Contains(attendance))
     {
         throw new DoNotContainElementException();
     }
     else
     {
         if (attendance.Person != null)
         {
             attendance.Person.removeAtendace(attendance, currUser);
         }
         Attendances.Remove(attendance);
     }
 }
Example #2
0
 public void DeleteAttendance(Attendance attendance, User currUser)
 {
     if (attendance == null)
     {
         throw new CantBeNullException();
     }
     else if (currUser != Owner && !currUser.Admin)
     {
         throw new InvalidAccessException();
     }
     else if (!Attendances.Contains(attendance))
     {
         throw new DoNotContainElementException();
     }
     else
     {
         Attendances.Remove(attendance);
     }
 }
Example #3
0
        public void ChangeAttendeeRole(Attendance attendee, string attendeeRole, bool state)
        {
            if (Attendances.Contains(attendee))
            {
                switch (attendeeRole)
                {
                case "chairman":
                    attendee.setChairman(state);
                    break;

                case "referrent":
                    attendee.setReferrent(state);
                    break;

                default:
                    break;
                }
            }
        }