private void refreshEntitySummaries(bool fromDatabase)
        {
            if (fromDatabase)
            {
                StaffFunctions.EntitiesNotForStaff = StaffFunctions.AllowedUnlinkedEntities(selectedStaffID);
                StaffFunctions.EntitiesForStaff    = StaffFunctions.AllowedLinkedEntities(selectedStaffID);
            }
            EntitiesFrom.ItemsSource = StaffFunctions.EntitiesNotForStaff;
            EntitiesFrom.Items.SortDescriptions.Clear();
            EntitiesFrom.Items.SortDescriptions.Add(new SortDescription("NameAndUser", ListSortDirection.Ascending));
            EntitiesFrom.Items.Refresh();
            EntitiesFrom.SelectedItem = null;

            EntitiesTo.ItemsSource = StaffFunctions.EntitiesForStaff;
            EntitiesTo.Items.SortDescriptions.Clear();
            EntitiesTo.Items.SortDescriptions.Add(new SortDescription("Default", ListSortDirection.Descending));
            EntitiesTo.Items.Refresh();
            EntitiesTo.SelectedItem = null;

            disableButtons();
            if (selectedStaffName != "")
            {
                PageHeader.Content = "Entities for " + selectedStaffName;
            }
        }