private void _button_BrowseDomain_Click(object sender, EventArgs e)
        {
            try
            {
                ADObject[]          results;
                ObjectPickerWrapper picker = new ObjectPickerWrapper();
                results = picker.ShowObjectPicker(this.Handle);
                if (results == null)
                {
                    return;
                }
                Debug.Assert(results.Length == 1);

                for (int i = 0; i <= results.Length - 1; i++)
                {
                    m_SelectedUserSource = User.UserSource.ActiveDirectory;
                    m_SelectedUser       = results[i].SamAccountName;
                    m_SelectedType       = results[i].ClassName;
                    m_SelectedSid        = results[i].Sid;
                    DialogResult         = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                logX.loggerX.Error("Error - Unable to browse Domain for Users & Groups", ex);
                Utility.MsgBox.ShowError(Utility.ErrorMsgs.CantGetUsersCaption, ex);
            }
        }
        private void _button_BrowseUsers_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            try
            {
                ADObject[]          results;
                ObjectPickerWrapper picker = new ObjectPickerWrapper();
                results = picker.ShowObjectPicker(this.Handle);

                if (results != null)
                {
                    Debug.Assert(results.Length == 1);

                    for (int i = 0; i <= results.Length - 1; i++)
                    {
                        //do this before creating the user because it will remove m_user in the change event
                        _textBox_User.Text = results[i].SamAccountName;
                        m_user             = new Sql.User(results[i].SamAccountName,
                                                          results[i].Sid,
                                                          m_loginType,
                                                          Sql.User.UserSource.ActiveDirectory);
                    }
                }
            }
            catch (Exception ex)
            {
                logX.loggerX.Error("Error - Server Access Report unable to browse Domain for Users & Groups", ex);
                Utility.MsgBox.ShowError(Utility.ErrorMsgs.CantGetUsersCaption, ex);
            }

            checkSelections();

            Cursor = Cursors.Default;
        }
Beispiel #3
0
        private void _button_BrowseUsers_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            try
            {
                ADObject[]          results;
                ObjectPickerWrapper picker = new ObjectPickerWrapper();
                results = picker.ShowObjectPicker(this.Handle);

                if (results != null)
                {
                    Debug.Assert(results.Length == 1);

                    for (int i = 0; i <= results.Length - 1; i++)
                    {
                        _textBox_User.Text = results[i].SamAccountName;
                    }
                }
            }
            catch (Exception ex)
            {
                logX.loggerX.Error("Error - Server Access Report unable to browse Domain for Users & Groups", ex);
                Utility.MsgBox.ShowError(Utility.ErrorMsgs.CantGetUsersCaption, ex);
            }

            checkSelections();

            Cursor = Cursors.Default;
        }