Exemplo n.º 1
0
        private SettingsContainer BuildSettingsContainer(MainWindow window, CRMLoginForm1 CRMLogin)
        {
            // thsi settings contained is used to pass variables to the workercontroller so it has the settings to submit batch jobs.
            SettingsContainer settings = new SettingsContainer();

            settings._batchsize = (int)window.BatchSizeSlider.Value;
            settings._fetchxml  = window.FetchXMLBox.Text;
            settings._isdelete  = window.DeleteRadioButton.IsEnabled;
            settings._window    = window;
            settings._CRMLogin  = CRMLogin;
            return(settings);
        }
Exemplo n.º 2
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            // Establish the Login control.
            CRMLoginForm1 ctrl = new CRMLoginForm1();

            // Wire event to login response.
            ctrl.ConnectionToCrmCompleted += ctrl_ConnectionToCrmCompleted;

            // Show the login control.
            ctrl.ShowDialog();

            if (ctrl.CrmConnectionMgr.CrmSvc != null)
            {
                // Set the disabled text field to display the OrganizationID
                this.LoggedInOrganizationID.Text = ctrl.CrmConnectionMgr.ConnectedOrgId.ToString();
                // Set the disabled text field to display the Organization SDK URL
                this.LoggedInOrganizationURL.Text = ctrl.CrmConnectionMgr.CrmSvc.CrmConnectOrgUriActual.ToString();
                // Set the disabled text ield to display the logged in user ID
                this.LoggedInUserDisplay.Text = ctrl.CrmConnectionMgr.CrmSvc.OAuthUserId;
                this._ctrl     = ctrl;
                this._loggedin = true;
            }
        }