Beispiel #1
0
        private void UpdateButtonStates()
        {
            var plan = PlanGlobalOperation();

            btnExecute.Enabled   = plan == Operation.Execute;
            btnAbortLoad.Enabled = plan == Operation.Cancel;

            _miClearCache.Enabled = CohortCompilerUI1.AnyCachedTasks();
        }
Beispiel #2
0
        private Operation PlanGlobalOperation()
        {
            var allTasks = CohortCompilerUI1.GetAllTasks();

            //if any are still executing or scheduled for execution
            if (allTasks.Any(t => t.State == CompilationState.Executing || t.State == CompilationState.Scheduled))
            {
                return(Operation.Cancel);
            }

            //if all are complete
            return(Operation.Execute);
        }
Beispiel #3
0
        public override void SetDatabaseObject(IActivateItems activator, CohortIdentificationConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _configuration = databaseObject;

            lblFrozen.Visible = _configuration.Frozen;

            tbID.Text          = _configuration.ID.ToString();
            tbName.Text        = _configuration.Name;
            tbDescription.Text = _configuration.Description;
            ticket.TicketText  = _configuration.Ticket;
            tlvCic.Enabled     = !databaseObject.Frozen;

            if (_commonFunctionality == null)
            {
                _commonFunctionality = new RDMPCollectionCommonFunctionality();

                _commonFunctionality.SetUp(RDMPCollection.Cohort, tlvCic, activator, olvNameCol, olvNameCol, new RDMPCollectionCommonFunctionalitySettings
                {
                    AddFavouriteColumn = false,
                    AddCheckColumn     = false,
                    AllowPinning       = false,
                    AllowSorting       = true, //important, we need sorting on so that we can override sort order with our OrderableComparer
                });

                tlvCic.AddObject(_configuration);
                tlvCic.ExpandAll();
            }

            CommonFunctionality.AddToMenu(cbIncludeCumulative);
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(_miClearCache);
            CommonFunctionality.AddToMenu(new ExecuteCommandSetQueryCachingDatabase(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandCreateNewQueryCacheDatabase(activator, _configuration));

            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandShowXmlDoc(activator, "CohortIdentificationConfiguration.QueryCachingServer_ID", "Query Caching"), "Help (What is Query Caching)");

            CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(activator, null).SetTarget(_configuration),
                                    "Commit Cohort",
                                    activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableCohort, OverlayKind.Add));

            CohortCompilerUI1.SetDatabaseObject(activator, databaseObject);
        }
Beispiel #4
0
        private object ExecuteAspectGetter(object rowObject)
        {
            //don't expose any buttons if global execution is in progress
            if (CohortCompilerUI1.IsExecutingGlobalOperations())
            {
                return(null);
            }

            if (rowObject is AggregateConfiguration || rowObject is CohortAggregateContainer)
            {
                var plannedOp = GetNextOperation(GetState((IMapsDirectlyToDatabaseTable)rowObject));

                if (plannedOp == Operation.None)
                {
                    return(null);
                }

                return(plannedOp);
            }

            return(null);
        }
Beispiel #5
0
        private void OrderActivity(Operation operation, IMapsDirectlyToDatabaseTable o)
        {
            switch (operation)
            {
            case Operation.Execute:
                CohortCompilerUI1.StartThisTaskOnly(o);
                break;

            case Operation.Cancel:
                CohortCompilerUI1.Cancel(o);
                break;

            case Operation.Clear:
                CohortCompilerUI1.Clear(o);
                break;

            case Operation.None:
                break;

            default:
                throw new ArgumentOutOfRangeException("operation");
            }
        }
Beispiel #6
0
 private void btnAbortLoad_Click(object sender, EventArgs e)
 {
     CohortCompilerUI1.CancelAll();
 }
Beispiel #7
0
 private void MiClearCacheClick(object sender, EventArgs e)
 {
     CohortCompilerUI1.ClearAllCaches();
 }
Beispiel #8
0
 private void btnExecute_Click(object sender, EventArgs e)
 {
     CohortCompilerUI1.StartAll();
 }
Beispiel #9
0
 private CompilationState GetState(IMapsDirectlyToDatabaseTable rowObject)
 {
     return(CohortCompilerUI1.GetState(rowObject));
 }
Beispiel #10
0
        public override void ConsultAboutClosing(object sender, FormClosingEventArgs e)
        {
            base.ConsultAboutClosing(sender, e);

            CohortCompilerUI1.ConsultAboutClosing(sender, e);
        }