コード例 #1
0
 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);
 }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
 public void SaveCalendar(PersonGroup personGroup, DoorGroup doorGroup, Calendar cal)
 {
     calendars[new Tuple<PersonGroup, DoorGroup>(personGroup, doorGroup)] = cal;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 internal void SaveCalendar(PersonGroup personGroup, DoorGroup doorGroup, Calendar cal)
 {
     DBCalendarInterface.Instance.SaveCalendar(personGroup, doorGroup, cal);
 }
コード例 #6
0
 public Calendar GetCalendar(PersonGroup personGroup, DoorGroup doorGroup)
 {
     return DBCalendarInterface.Instance.RetrieveCalendar(personGroup, doorGroup);
 }