Пример #1
0
        /// <summary>
        /// Goes and fetches the data from the API & Returns the results to base class to be bound to the template.
        /// </summary>
        /// <returns></returns>
        protected override object GetDataForTemplate()
        {
            ParseAndValidateID();

            // Get Trial by ID
            ClinicalTrial trial;

            try
            {
                // Retrieve a Clinical Trial based on the Trial ID
                trial = this.CTSManager.Get(TrialID);
            }
            catch (Exception ex)
            {
                // If we hit some other error when getting the trials, redirect to the error page
                string errMessage = "CDE:APICTSDetailsControl.cs:OnLoad" + " Requested trial ID: " + TrialID + "\nException thrown by CTSManager.get(nctid) call.";
                log.Error(errMessage, ex);
                ErrorPageDisplayer.RaisePageError(errMessage);

                //TODO: Make sure RaisePageError stops processing this page
                return(null);
            }

            RedirectIfTrialNotValid(trial);

            SetupFieldAndUrlFilters(trial);

            //TODO: Glossification????

            // Set up NCTID for analytics
            _nctid = trial.NCTID;

            //We did not come from a search, so don't show the criteria.
            //this also applies if we can from a print result.
            if (this.ParsedReqUrlParams.QueryParameters.ContainsKey("rl"))
            {
                _showCriteria = true;
            }

            return(new
            {
                Trial = trial,
                Parameters = SearchParams,
                Control = this,
                TrialTools = new TrialVelocityTools()
            });
        }
Пример #2
0
 virtual public void RaiseErrorPage(string messageKey)
 {
     // Use the common ErrorPageDisplayer so we do not duplicate the logic
     ErrorPageDisplayer.RaisePageError(this.GetType().ToString());
 }