private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AllGroups          = ADService.GetAllGroups();
            cmbOUs.ItemsSource = ADService.GetAllOUs();

            for (int r = 0; r < cmbOUs.Items.Count; r++)
            {
                if (((OU)cmbOUs.Items[r]).Path == ActiveOU.Path)
                {
                    cmbOUs.SelectedIndex = r;
                    break;
                }
            }
            //cmbOUs.SelectedItem = ActiveOU;
            PopulateMemberShipGroups();
            PopulateAvailableGroups();
            DisplayMemberShipGroups();
            DisplayAvailableGroups();
            if (isNew)
            {
                ClearControls();
            }
            else
            {
                FillControls();
            }
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            allADGroups = ADService.GetAllGroups();
            allADUsers  = ADService.GetAllUsers();
            if (isNew)
            {
                activeGroup       = new Group();
                txtGroupName.Text = "";
            }
            else
            {
                txtGroupName.Text   = activeGroup.SamAccountName;
                usersInActiveGroup  = GroupService.GetUsersInGroup(activeGroup.GroupPrincipal).OrderBy(g => g.SamAccountName).ToList();
                groupsInActiveGroup = GroupService.GetGroupsInGroup(activeGroup.GroupPrincipal).OrderBy(g => g.SamAccountName).ToList();
            }
            cmbOUs.ItemsSource = ADService.GetAllOUs();
            for (int r = 0; r < cmbOUs.Items.Count; r++)
            {
                if (((OU)cmbOUs.Items[r]).Path == activeOU.Path)
                {
                    cmbOUs.SelectedIndex = r;
                    break;
                }
            }

            PopulateUsersNotInGroups();
            PopulateGroupsNotInGroups();
            DisplayPopulations();
        }