private void CreateNewUserGroupButton_Click(object sender, EventArgs e) { EditUserGroupBox.Visible = true; PersonGroup newGroup = new PersonGroup("New Group", ""); dac.PersonGroups.Add(newGroup); UpdateSources(); UserMembersListBox.DataSource = dac.FindPeopleByGroup(newGroup); ExistingUserGroupsListBox.SelectedIndex = dac.PersonGroups.IndexOf(newGroup); }
public Calendar RetrieveCalendar(PersonGroup personGroup, DoorGroup doorGroup) { try { return calendars[new Tuple<PersonGroup, DoorGroup>(personGroup, doorGroup)]; } catch (KeyNotFoundException e) { Calendar c = new Calendar(DateTime.Now.Year); calendars[new Tuple<PersonGroup, DoorGroup>(personGroup, doorGroup)] = c; return c; } }
public void SaveCalendar(PersonGroup personGroup, DoorGroup doorGroup, Calendar cal) { calendars[new Tuple<PersonGroup, DoorGroup>(personGroup, doorGroup)] = cal; }
public List<Person> FindPeopleByGroup(PersonGroup pg) { List<Person> list = new List<Person>(); foreach (Person p in DBUserInterface.Instance.PersonList) { foreach (PersonGroup _pg in p.FindPersonGroups()) { if (pg.Equals(_pg)) { list.Add(p); } } } return list; }
internal void SaveCalendar(PersonGroup personGroup, DoorGroup doorGroup, Calendar cal) { DBCalendarInterface.Instance.SaveCalendar(personGroup, doorGroup, cal); }
public Calendar GetCalendar(PersonGroup personGroup, DoorGroup doorGroup) { return DBCalendarInterface.Instance.RetrieveCalendar(personGroup, doorGroup); }