private void btnNext_Click(object sender, EventArgs e)
        {
            var db = serverDatabaseTableSelector1.GetDiscoveredDatabase();

            if (db == null)
            {
                MessageBox.Show("You must select a database");
                return;
            }
            if (PrivateIdentifierPrototype == null)
            {
                MessageBox.Show("You must select a private identifier datatype");
                return;
            }

            Wizard = new CreateNewCohortDatabaseWizard(db, Activator.RepositoryLocator.CatalogueRepository, Activator.RepositoryLocator.DataExportRepository, cbAllowNullReleaseIdentifiers.Checked);

            var popup = new PopupChecksUI("Creating Cohort Table", false);

            ExternalCohortTableCreatedIfAny = Wizard.CreateDatabase(PrivateIdentifierPrototype, popup);

            if (popup.GetWorst() <= CheckResult.Warning)
            {
                if (Activator.YesNo("Close Form?", "Close"))
                {
                    ParentForm.Close();
                }
            }
        }
Exemple #2
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            var popup = new PopupChecksUI("Checking Dita extraction", false);

            DitaCatalogueExtractor extractor = new DitaCatalogueExtractor(Activator.RepositoryLocator.CatalogueRepository, null);

            popup.StartChecking(extractor);
        }
Exemple #3
0
        public override void Execute()
        {
            base.Execute();

            var popupChecksUI = new PopupChecksUI("Checking " + _checkable, false);

            if (_reportWorstTo != null)
            {
                popupChecksUI.AllChecksComplete += (s, a) => _reportWorstTo(_checkable, a.CheckResults.GetWorst());
            }

            popupChecksUI.StartChecking(_checkable);
        }
Exemple #4
0
        void tlvDatasets_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.Column == olvState)
            {
                var notifier = GetCheckNotifier(e.Model);

                if (notifier == null)
                {
                    return;
                }

                var popup = new PopupChecksUI(e.Model.ToString(), false);
                popup.Check(new ReplayCheckable(notifier));
            }
        }
Exemple #5
0
        protected override void OnClick(EventArgs e)
        {
            if (_events.Messages.Any())
            {
                var popup = new PopupChecksUI("Exceptions", false);
                popup.Check(new ReplayCheckable(_events));

                popup.FormClosed += (s, ea) =>
                {
                    _events = new ToMemoryCheckNotifier();
                    Enabled = false;
                    Invalidate();
                };
            }
        }
Exemple #6
0
        private void AddCatalogues()
        {
            SelectIMapsDirectlyToDatabaseTableDialog dialog = new SelectIMapsDirectlyToDatabaseTableDialog(RepositoryLocator.CatalogueRepository.GetAllObjects <Catalogue>(), false, false);

            dialog.AllowMultiSelect = true;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (!dialog.MultiSelected.Any())
                {
                    return;
                }

                PopupChecksUI checks = new PopupChecksUI("Adding Catalogues", true);


                foreach (Catalogue catalogue in dialog.MultiSelected)
                {
                    try
                    {
                        var cmd          = new CatalogueCommand(catalogue);
                        var cmdExecution = new ExecuteCommandAddCatalogueToCohortIdentificationSetContainer(_activator, cmd, _container);
                        if (cmdExecution.IsImpossible)
                        {
                            checks.OnCheckPerformed(
                                new CheckEventArgs(
                                    "Could not add Catalogue " + catalogue + " because of Reason:" +
                                    cmdExecution.ReasonCommandImpossible, CheckResult.Fail));
                        }
                        else
                        {
                            cmdExecution.Execute();
                            checks.OnCheckPerformed(new CheckEventArgs("Successfully added Catalogue " + catalogue, CheckResult.Success));
                        }
                    }
                    catch (Exception e)
                    {
                        checks.OnCheckPerformed(new CheckEventArgs("Failed to add Catalogue " + catalogue + "(see Exception for details)", CheckResult.Fail, e));
                    }
                }
            }
        }
Exemple #7
0
        private void AddAggregates(AggregateConfiguration[] userCanPickFrom)
        {
            SelectIMapsDirectlyToDatabaseTableDialog dialog = new SelectIMapsDirectlyToDatabaseTableDialog(userCanPickFrom, false, false);

            dialog.AllowMultiSelect = true;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (!dialog.MultiSelected.Any())
                {
                    return;
                }

                PopupChecksUI checks = new PopupChecksUI("Adding Aggregate(s)", true);


                foreach (AggregateConfiguration aggregateConfiguration in dialog.MultiSelected)
                {
                    try
                    {
                        var cmd          = new AggregateConfigurationCommand(aggregateConfiguration);
                        var cmdExecution = new ExecuteCommandAddAggregateConfigurationToCohortIdentificationSetContainer(_activator, cmd, _container);
                        if (cmdExecution.IsImpossible)
                        {
                            checks.OnCheckPerformed(
                                new CheckEventArgs(
                                    "Could not add AggregateConfiguration " + aggregateConfiguration + " because of Reason:" +
                                    cmdExecution.ReasonCommandImpossible, CheckResult.Fail));
                        }
                        else
                        {
                            cmdExecution.Execute();
                            checks.OnCheckPerformed(new CheckEventArgs("Successfully added AggregateConfiguration " + aggregateConfiguration, CheckResult.Success));
                        }
                    }
                    catch (Exception e)
                    {
                        checks.OnCheckPerformed(new CheckEventArgs("Failed to add AggregateConfiguration " + aggregateConfiguration + "(see Exception for details)", CheckResult.Fail, e));
                    }
                }
            }
        }
        public override void Execute()
        {
            if (_tableInfo == null)
            {
                SetImpossible("No TableInfo has been set, use SetTarget(TableInfo or Catalogue)");
            }

            base.Execute();

            var ui = new TagColumnAdderUI(_tableInfo);

            if (ui.ShowDialog() == DialogResult.OK)
            {
                var popup       = new PopupChecksUI("Adding Column", false);
                var columnAdder = new TagColumnAdder(ui.ColumnName, ui.ColumnDataType, _tableInfo, popup, _includeLoadedField);

                columnAdder.Execute();
                Publish(_tableInfo);
            }
        }
        public override void Execute()
        {
            base.Execute();

            if (_cic == null)
            {
                _cic = SelectOne <CohortIdentificationConfiguration>(activator.RepositoryLocator.CatalogueRepository);
            }

            if (_cic == null)
            {
                return;
            }

            if (YesNo("This will create a 100% copy of the entire CohortIdentificationConfiguration including all datasets, " +
                      "filters, parameters and set operations. Are you sure this is what you want?",
                      "Confirm Cloning"))
            {
                var checks = new PopupChecksUI("Cloning " + _cic, false);
                var clone  = _cic.CreateClone(checks);

                if (_project != null) // clone the association
                {
                    new ProjectCohortIdentificationConfigurationAssociation(
                        Activator.RepositoryLocator.DataExportRepository,
                        _project,
                        clone);
                }

                //Load the clone up
                Publish(clone);
                if (_project != null)
                {
                    Emphasise(_project);
                }
                else
                {
                    Emphasise(clone);
                }
            }
        }
        public override void Execute()
        {
            if (_tableInfo == null)
            {
                SetImpossible("No TableInfo has been set, use SetTarget(TableInfo or Catalogue)");
            }

            base.Execute();

            var ui = new TagColumnAdderUI(_tableInfo);

            if (ui.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var checks = new PopupChecksUI("Adding Column", false);

            var columnAdder = new TagColumnAdder(ui.ColumnName, ui.ColumnDataType, _tableInfo, checks);

            columnAdder.Execute();
            Publish(_tableInfo);

            //Checks have likely been popped up as a non modal dialogue by the execute action (allowing the user to review the events)
            if (checks.Visible)
            {
                checks.FormClosed += (s, e) =>
                {
                    //schedule disposal of the control for when the user closes it
                    if (!checks.IsDisposed)
                    {
                        checks.Dispose();
                    }
                }
            }
            ;
            else
            {
                checks.Dispose(); // for some reason the checks were not spawned so explicitly dispose of the resources
            }
        }