public void AddAgendaItem(AgendaItem agendaItem, User currUser) { if (agendaItem == null) { throw new CantBeNullException(); } else if (currUser != Owner && !currUser.Admin) { throw new InvalidAccessException(); } else { AgendaItems.Add(agendaItem); } }
public Meeting(string title, User user, DateTime startTime, DateTime endTime, string description, List <Person> attendances, List <CreatMeetingAgendaBuilder> agendaItems) { Title = title; Owner = user; StartTime = startTime; Description = description; //Attendances.Add(new Attendance(this, user, false, false, true)); /*foreach (Person attendance in attendances) * { * Attendances.Add(new Attendance(this, attendance, false, false, false)); * }*/ foreach (CreatMeetingAgendaBuilder agendaItem in agendaItems) { AgendaItems.Add(new AgendaItem(agendaItem.Agendapoint, agendaItem.Submeetings, user, this)); } }