Example #1
0
        public override void DataBind()
        {
            if (_detailsView == null && WorkQueue != null)
            {
                ItemStudy = WorkQueue.Study;

                if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.AutoRoute)
                {
                    _detailsView = LoadControl("AutoRouteWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebMoveStudy)
                {
                    _detailsView = LoadControl("WebMoveStudyWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebEditStudy)
                {
                    _detailsView = LoadControl("WebEditStudyWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.MigrateStudy)
                {
                    _detailsView = LoadControl("TierMigrationWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.ProcessDuplicate)
                {
                    _detailsView = LoadControl("ProcessDuplicateWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.ExternalEdit || WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebEditStudy)
                {
                    _detailsView = LoadControl("EditWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }
                else
                {
                    _detailsView = LoadControl("GeneralWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null)
                    {
                        WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                    }
                }

                // If the entry isn't failed but hasn't been updated for some time, display the alert message
                WorkQueueAlertPanelRow.Visible = false;
                if (!WorkQueue.WorkQueueStatusEnum.Equals(WorkQueueStatusEnum.Failed) &&
                    !WorkQueueHelper.IsActiveWorkQueue(WorkQueue))
                {
                    WorkQueueAlertPanelRow.Visible = true;
                    WorkQueueAlertPanel.Text       =
                        WorkQueue.LastUpdatedTime > DateTime.MinValue
                            ? String.Format(
                            "There does not seem to be any activity for this entry since {0}. The server may not be running or there is a problem with this entry.",
                            WorkQueue.LastUpdatedTime)
                            : "There does not seem to be any activity for this entry. The server may not be running or there is a problem with this entry.";
                }
            }
            if (_detailsView != null)
            {
                _detailsView.WorkQueue = WorkQueue;
            }

            base.DataBind();
        }
        public override void DataBind()
        {
            if (_detailsView == null && WorkQueue != null)
            {

                ItemStudy = WorkQueue.Study;

                if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.AutoRoute)
                {
                    _detailsView = LoadControl("AutoRouteWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebMoveStudy)
                {
                    _detailsView = LoadControl("WebMoveStudyWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebEditStudy)
                {
                    _detailsView = LoadControl("WebEditStudyWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.MigrateStudy)
                {
                    _detailsView = LoadControl("TierMigrationWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.ProcessDuplicate)
                {
                    _detailsView = LoadControl("ProcessDuplicateWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else if (WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.ExternalEdit || WorkQueue.WorkQueueTypeEnum == WorkQueueTypeEnum.WebEditStudy)
                {
                    _detailsView = LoadControl("EditWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }
                else
                {
                    _detailsView = LoadControl("GeneralWorkQueueDetailsView.ascx") as WorkQueueDetailsViewBase;
                    if (_detailsView != null) WorkQueueDetailsViewPlaceHolder.Controls.Add(_detailsView);
                }

                // If the entry isn't failed but hasn't been updated for some time, display the alert message
                WorkQueueAlertPanelRow.Visible = false;
                if (!WorkQueue.WorkQueueStatusEnum.Equals(WorkQueueStatusEnum.Failed) &&
                    !ServerPlatform.IsActiveWorkQueue(WorkQueue))
                {
                    WorkQueueAlertPanelRow.Visible = true;
                    WorkQueueAlertPanel.Text =
                        WorkQueue.LastUpdatedTime > DateTime.MinValue
                            ? String.Format(
                                  "There does not seem to be any activity for this entry since {0}. The server may not be running or there is a problem with this entry.",
                                  WorkQueue.LastUpdatedTime)
                            : "There does not seem to be any activity for this entry. The server may not be running or there is a problem with this entry.";
                }
            }
            if (_detailsView != null)
                _detailsView.WorkQueue = WorkQueue;

            base.DataBind();
        }