Пример #1
0
        private void CustomizeDuplicateSopPolicyColumn(GridViewRow row)
        {
            ServerPartition partition = row.DataItem as ServerPartition;
            Label           lbl       = row.FindControl("DuplicateSopDescription") as Label; // The label is added in the template

            lbl.Text = ServerEnumDescription.GetLocalizedDescription(partition.DuplicateSopPolicyEnum);
        }
        protected void PartitionGridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (PartitionGridView.EditIndex != e.Row.RowIndex)
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Model.PartitionArchive pa = e.Row.DataItem as Model.PartitionArchive;
                    Label archiveTypeLabel    = e.Row.FindControl("ArchiveType") as Label;
                    archiveTypeLabel.Text = ServerEnumDescription.GetLocalizedDescription(pa.ArchiveTypeEnum);

                    Label configXml = e.Row.FindControl("ConfigurationXML") as Label;
                    configXml.Text = XmlUtils.GetXmlDocumentAsString(pa.ConfigurationXml, true);

                    Image img = ((Image)e.Row.FindControl("EnabledImage"));
                    if (img != null)
                    {
                        img.ImageUrl = pa.Enabled
                                           ? ImageServerConstants.ImageURLs.Checked
                                           : ImageServerConstants.ImageURLs.Unchecked;
                    }

                    img = ((Image)e.Row.FindControl("ReadOnlyImage"));
                    if (img != null)
                    {
                        img.ImageUrl = pa.ReadOnly
                                           ? ImageServerConstants.ImageURLs.Checked
                                           : ImageServerConstants.ImageURLs.Unchecked;
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (ViewState["EditMode"] != null)
                {
                    _editMode = (bool)ViewState["EditMode"];
                }

                if (ViewState["EdittedPartitionArchive"] != null)
                {
                    ServerEntityKey partitionKey = ViewState["EdittedPartitionArchive"] as ServerEntityKey;
                    _partitionArchive = Model.PartitionArchive.Load(partitionKey);
                }

                if (ViewState["ServerPartition"] != null)
                {
                    _partition = (ServerPartition)ViewState["ServerPartition"];
                }
            }

            ArchiveTypeDropDownList.Items.Clear();

            foreach (ArchiveTypeEnum archiveTypeEnum in ArchiveTypeEnum.GetAll())
            {
                ArchiveTypeDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(archiveTypeEnum), archiveTypeEnum.Lookup));
            }
        }
        public override void DataBind()
        {
            ServiceLock service = ServiceLock;

            if (service != null)
            {
                // only rebind the data if the dialog has been closed
                if (ModalDialog.State == ModalDialog.ShowState.Hide)
                {
                    Type.Text        = ServerEnumDescription.GetLocalizedDescription(service.ServiceLockTypeEnum);
                    Description.Text = ServerEnumDescription.GetLocalizedLongDescription(service.ServiceLockTypeEnum);
                    Enabled.Checked  = service.Enabled;

                    if (service.FilesystemKey != null)
                    {
                        FileSystemDataAdapter adaptor = new FileSystemDataAdapter();
                        Model.Filesystem      fs      = adaptor.Get(service.FilesystemKey);
                        FileSystem.Text = fs.Description;
                    }
                    else
                    {
                        FileSystem.Text = string.Empty;
                    }

                    CalendarExtender.SelectedDate = service.ScheduledTime;

                    AddCustomTime(service.ScheduledTime);
                }
            }

            base.DataBind();
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ServerPartition != null)
            {
                // This make sure we have the list to work with.
                // the list may be out-dated if the add/update event is fired later
                // In those cases, the list must be refreshed again.
                LoadDevices();

                IList <DeviceTypeEnum> deviceTypes = DeviceTypeEnum.GetAll();

                if (DeviceTypeFilter.Items.Count == 0)
                {
                    foreach (DeviceTypeEnum t in deviceTypes)
                    {
                        DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                    }
                }
                else
                {
                    var typeItems = new ListItem[DeviceTypeFilter.Items.Count];
                    DeviceTypeFilter.Items.CopyTo(typeItems, 0);
                    DeviceTypeFilter.Items.Clear();
                    int count = 0;
                    foreach (DeviceTypeEnum t in deviceTypes)
                    {
                        DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                        DeviceTypeFilter.Items[count].Selected = typeItems[count].Selected;
                        count++;
                    }
                }
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            IList <ServiceLockTypeEnum> types = ServiceLockTypeEnum.GetAll();

            TypeDropDownList.Items.Add(new ListItem(SR.All));
            foreach (ServiceLockTypeEnum t in types)
            {
                TypeDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
            }

            EditServiceLockDialog.ServiceLockUpdated += AddEditServiceLockDialog_ServiceLockUpdated;

            // setup child controls
            GridPagerTop.InitializeGridPager(SR.GridPagerServiceSingleItem, SR.GridPagerServiceMultipleItems, ServiceLockGridViewControl.TheGrid, delegate { return(ServiceLockGridViewControl.ServiceLocks != null ? ServiceLockGridViewControl.ServiceLocks.Count : 0); }, ImageServerConstants.GridViewPagerPosition.Top);
            ServiceLockGridViewControl.Pager = GridPagerTop;

            StatusFilter.Items.Add(new ListItem(SR.All));
            StatusFilter.Items.Add(new ListItem(SR.Enabled));
            StatusFilter.Items.Add(new ListItem(SR.Disabled));

            FileSystemsConfigurationController fileSystemController = new FileSystemsConfigurationController();
            IList <Model.Filesystem>           fileSystems          = fileSystemController.GetAllFileSystems();

            foreach (Model.Filesystem fs in fileSystems)
            {
                FileSystemFilter.Items.Add(new ListItem(fs.Description, fs.Key.ToString()));
            }

            ConfirmEditDialog.Confirmed += ConfirmEditDialog_Confirmed;
        }
Пример #7
0
        private void CustomizeFilesystemTierColumn(GridViewRow row)
        {
            Filesystem fs  = row.DataItem as Filesystem;
            Label      lbl = row.FindControl("FilesystemTierDescription") as Label; // The label is added in the template

            lbl.Text = ServerEnumDescription.GetLocalizedDescription(fs.FilesystemTierEnum);
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IList <RestoreQueueStatusEnum> statusItems = RestoreQueueStatusEnum.GetAll();

            int prevSelectedIndex = StatusFilter.SelectedIndex;

            StatusFilter.Items.Clear();
            StatusFilter.Items.Add(new ListItem(SR.All, "All"));
            foreach (RestoreQueueStatusEnum s in statusItems)
            {
                StatusFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(s), s.Lookup));
            }
            StatusFilter.SelectedIndex = prevSelectedIndex;

            DeleteItemButton.Roles       = AuthorityTokens.RestoreQueue.Delete;
            ViewStudyDetailsButton.Roles = AuthorityTokens.Study.View;

            if (!IsPostBack && !Page.IsAsync)
            {
                var patientId   = Server.UrlDecode(Request["PatientID"]);
                var patientName = Server.UrlDecode(Request["PatientName"]);
                if (patientId != null || patientName != null)
                {
                    PatientId.TrimText   = patientId;
                    PatientName.TrimText = patientName;

                    RestoreQueueItemList.SetDataSource();
                    RestoreQueueItemList.Refresh();
                }
            }
        }
Пример #9
0
        private void PopulateDropdownLists()
        {
            var workQueueTypes      = WorkQueueTypeEnum.GetAll();
            var workQueueStatuses   = WorkQueueStatusEnum.GetAll();
            var workQueuePriorities = WorkQueuePriorityEnum.GetAll();

            if (TypeListBox.Items.Count == 0)
            {
                foreach (WorkQueueTypeEnum t in workQueueTypes)
                {
                    TypeListBox.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                }
            }
            if (StatusListBox.Items.Count == 0)
            {
                foreach (WorkQueueStatusEnum s in workQueueStatuses)
                {
                    // #10784: remove Completed status filter
                    if (s != WorkQueueStatusEnum.Completed)
                    {
                        StatusListBox.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(s), s.Lookup));
                    }
                }
            }

            if (PriorityDropDownList.Items.Count == 0)
            {
                PriorityDropDownList.Items.Clear();
                PriorityDropDownList.Items.Add(new ListItem(SR.Any, string.Empty));
                foreach (WorkQueuePriorityEnum p in workQueuePriorities)
                {
                    PriorityDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(p), p.Lookup));
                }
            }
        }
Пример #10
0
        protected void CustomizeColumns(GridViewRowEventArgs e)
        {
            var fs  = e.Row.DataItem as ServerRule;
            var lbl = e.Row.FindControl("ServerRuleApplyTimeEnum") as Label; // The label is added in the template

            if (lbl != null && fs != null)
            {
                lbl.Text = ServerEnumDescription.GetLocalizedDescription(fs.ServerRuleApplyTimeEnum);
            }

            lbl = e.Row.FindControl("ServerRuleTypeEnum") as Label; // The label is added in the template
            if (lbl != null && fs != null)
            {
                lbl.Text = ServerEnumDescription.GetLocalizedDescription(fs.ServerRuleTypeEnum);
            }


            var img = ((Image)e.Row.FindControl("EnabledImage"));

            if (img != null)
            {
                img.ImageUrl = fs.Enabled ? ImageServerConstants.ImageURLs.Checked : ImageServerConstants.ImageURLs.Unchecked;
            }

            img = ((Image)e.Row.FindControl("DefaultImage"));
            if (img != null)
            {
                img.ImageUrl = fs.DefaultRule ? ImageServerConstants.ImageURLs.Checked : ImageServerConstants.ImageURLs.Unchecked;
            }
            img = ((Image)e.Row.FindControl("ExemptImage"));
            if (img != null)
            {
                img.ImageUrl = fs.ExemptRule ? ImageServerConstants.ImageURLs.Checked : ImageServerConstants.ImageURLs.Unchecked;
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            // initialize the controller
            _theController = new FileSystemsConfigurationController();

            // setup child controls
            GridPagerTop.InitializeGridPager(SR.GridPagerFileSystemSingleItem, SR.GridPagerFileSystemMultipleItems, FileSystemsGridView1.TheGrid, delegate { return(FileSystemsGridView1.FileSystems.Count); }, ImageServerConstants.GridViewPagerPosition.Top);
            FileSystemsGridView1.Pager = GridPagerTop;
            GridPagerTop.Reset();

            Tiers = _theController.GetFileSystemTiers();

            int prevSelectIndex = TiersDropDownList.SelectedIndex;

            if (TiersDropDownList.Items.Count == 0)
            {
                TiersDropDownList.Items.Add(new ListItem(SR.All));
                foreach (FilesystemTierEnum tier in Tiers)
                {
                    TiersDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(tier), tier.Lookup));
                }
            }
            TiersDropDownList.SelectedIndex = prevSelectIndex;
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServerPartitionDataAdapter    adaptor  = new ServerPartitionDataAdapter();
            ServerPartitionSelectCriteria criteria = new ServerPartitionSelectCriteria();

            criteria.AeTitle.EqualTo(Request.QueryString[ImageServerConstants.QueryStrings.ServerAE]);
            _partition = adaptor.GetFirst(criteria);

            for (int i = 1;; i++)
            {
                string qs       = string.Format(ImageServerConstants.QueryStrings.StudyUID + "{0}", i);
                string studyuid = Request.QueryString[qs];

                if (!string.IsNullOrEmpty(studyuid))
                {
                    _studies.Add(LoadStudy(studyuid));
                }
                else
                {
                    break;
                }
            }

            StudyGridPanel.StudyList = _studies;

            LoadDevices();

            if (DHCPFilter.Items.Count == 0)
            {
                DHCPFilter.Items.Add(new ListItem(SR.All));
                DHCPFilter.Items.Add(new ListItem(SR.DHCP));
                DHCPFilter.Items.Add(new ListItem(SR.NoDHCP));
            }

            IList <DeviceTypeEnum> deviceTypes = DeviceTypeEnum.GetAll();

            if (DeviceTypeFilter.Items.Count == 0)
            {
                foreach (DeviceTypeEnum t in deviceTypes)
                {
                    DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                }
            }
            else
            {
                ListItem[] typeItems = new ListItem[DeviceTypeFilter.Items.Count];
                DeviceTypeFilter.Items.CopyTo(typeItems, 0);
                DeviceTypeFilter.Items.Clear();
                int count = 0;
                foreach (DeviceTypeEnum t in deviceTypes)
                {
                    DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                    DeviceTypeFilter.Items[count].Selected = typeItems[count].Selected;
                    count++;
                }
            }
        }
        protected void CustomizeTypeColumn(GridViewRow row)
        {
            Label typeLabel = row.FindControl("Type") as Label;

            ServiceLock item = row.DataItem as ServiceLock;

            if (typeLabel != null && item != null)
            {
                typeLabel.Text = ServerEnumDescription.GetLocalizedDescription(item.ServiceLockTypeEnum);
            }
        }
        private static string GetJavascriptForSampleRule(ServerRuleTypeEnum typeEnum, object[] extensions)
        {
            string sampleList = string.Empty;

            foreach (ISampleRule extension in extensions)
            {
                if (extension.Type.Equals(typeEnum))
                {
                    sampleList +=
                        String.Format(
                            @"        myEle = document.createElement('option') ;
                    myEle.value = '{0}';
                    myEle.text = '{1}' ;
                    if(navigator.appName == 'Microsoft Internet Explorer') sampleList.add(myEle);
                    else sampleList.add(myEle, null);",
                            extension.Name, extension.Description);
                }
            }
            string enumList = string.Empty;

            foreach (ISampleRule extension in extensions)
            {
                if (extension.Type.Equals(typeEnum))
                {
                    foreach (ServerRuleApplyTimeEnum applyTimeEnum in extension.ApplyTimeList)
                    {
                        enumList +=
                            String.Format(
                                @"myEle = document.createElement('option') ;
                    myEle.value = '{0}';
                    myEle.text = '{1}';
                    if(navigator.appName == 'Microsoft Internet Explorer') applyTimeList.add(myEle);
                    else applyTimeList.add(myEle, null);",
                                applyTimeEnum.Lookup, ServerEnumDescription.GetLocalizedDescription(applyTimeEnum));
                    }
                    break;
                }
            }

            return
                (String.Format(
                     @"if (val == '{0}')
                {{
					{1}
                    myEle = document.createElement('option') ;
                    myEle.value = '';
                    myEle.text = '' ;
                    if(navigator.appName == 'Microsoft Internet Explorer') sampleList.add(myEle);
                    else sampleList.add(myEle, null);
                    {2}
                }}",
                     typeEnum.Lookup, enumList, sampleList));
        }
Пример #15
0
        public void UpdateUI()
        {
            // update the dropdown list
            DeviceTypeDropDownList.Items.Clear();
            IList <DeviceTypeEnum> deviceTypes = DeviceTypeEnum.GetAll();

            foreach (DeviceTypeEnum t in deviceTypes)
            {
                DeviceTypeDropDownList.Items.Add(
                    new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup)
                    );
            }

            UpdateLabels();

            // Update the rest of the fields
            if (Device == null)
            {
                AETitleTextBox.Text                = SR.DeviceAE;
                IPAddressTextBox.Text              = string.Empty;
                ActiveCheckBox.Checked             = true;
                DHCPCheckBox.Checked               = false;
                DescriptionTextBox.Text            = string.Empty;
                PortTextBox.Text                   = SR.DeviceDefaultPort;
                DefaultSCSTextBox.Text             = string.Empty;
                AllowStorageCheckBox.Checked       = true;
                AllowQueryCheckBox.Checked         = true;
                AllowRetrieveCheckBox.Checked      = true;
                AllowAutoRouteCheckBox.Checked     = true;
                ThrottleSettingsTab.MaxConnections = UICommonSettings.Admin.Device.MaxConnections;
            }
            else if (Page.IsValid)
            {
                AETitleTextBox.Text                = Device.AeTitle;
                IPAddressTextBox.Text              = Device.IpAddress;
                ActiveCheckBox.Checked             = Device.Enabled;
                DHCPCheckBox.Checked               = Device.Dhcp;
                DescriptionTextBox.Text            = Device.Description;
                DefaultSCSTextBox.Text             = Device.DefaultSCS;
                PortTextBox.Text                   = Device.Port.ToString();
                AcceptKOPR.Checked                 = Device.AcceptKOPR;
                AllowStorageCheckBox.Checked       = Device.AllowStorage;
                AllowQueryCheckBox.Checked         = Device.AllowQuery;
                AllowRetrieveCheckBox.Checked      = Device.AllowRetrieve;
                AllowAutoRouteCheckBox.Checked     = Device.AllowAutoRoute;
                ThrottleSettingsTab.MaxConnections = Device.ThrottleMaxConnections;
            }
        }
        private void UpdateUI()
        {
            // Update the title and OK button text. Changing the image is the only way to do this, since the
            // SkinID cannot be set dynamically after Page_PreInit.
            if (EditMode)
            {
                ModalDialog.Title    = SR.DialogEditFileSystemTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;
            }
            else
            {
                ModalDialog.Title    = SR.DialogAddFileSystemTitle;
                OKButton.Visible     = true;
                UpdateButton.Visible = false;
            }

            // update the dropdown list
            TiersDropDownList.Items.Clear();
            foreach (FilesystemTierEnum tier in _tiers)
            {
                TiersDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(tier), tier.Lookup));
            }

            if (FileSystem == null)
            {
                // Clear input
                DescriptionTextBox.Text   = string.Empty;
                PathTextBox.Text          = string.Empty;
                ReadCheckBox.Checked      = true;
                WriteCheckBox.Checked     = true;
                LowWatermarkTextBox.Text  = (80.00f).ToString();
                HighWatermarkTextBox.Text = (90.00f).ToString();

                TiersDropDownList.SelectedIndex = 0;
            }
            else if (Page.IsValid)
            {
                // set the data using the info in the filesystem to be editted
                DescriptionTextBox.Text         = FileSystem.Description;
                PathTextBox.Text                = FileSystem.FilesystemPath;
                ReadCheckBox.Checked            = FileSystem.Enabled && (FileSystem.ReadOnly || (FileSystem.WriteOnly == false));
                WriteCheckBox.Checked           = FileSystem.Enabled && (FileSystem.WriteOnly || (FileSystem.ReadOnly == false));
                LowWatermarkTextBox.Text        = FileSystem.LowWatermark.ToString();
                HighWatermarkTextBox.Text       = FileSystem.HighWatermark.ToString();
                TiersDropDownList.SelectedValue = FileSystem.FilesystemTierEnum.Lookup;
            }
        }
Пример #17
0
        private void CustomizeDuplicateSopPolicyColumn(GridViewRow row)
        {
            var partition = row.DataItem as ServerPartition;

            if (partition == null)
            {
                return;
            }

            var lbl = row.FindControl("DuplicateSopDescription") as Label; // The label is added in the template

            if (lbl != null)
            {
                lbl.Text = ServerEnumDescription.GetLocalizedDescription(partition.DuplicateSopPolicyEnum);
            }
        }
Пример #18
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            CalendarExtender.Format = DateTimeFormatter.DefaultDateFormat;

            PriorityDropDownList.Items.Clear();
            IList <WorkQueuePriorityEnum> priorities = WorkQueuePriorityEnum.GetAll();

            foreach (WorkQueuePriorityEnum priority in priorities)
            {
                PriorityDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(priority), priority.Lookup));
            }

            ScheduleNowCheckBox.Checked = false;
            NewScheduleDate.Enabled     = true;
            NewScheduleTime.Enabled     = true;
        }
Пример #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServerRuleGridViewControl.ServerRulePanel = this;

            // setup child controls
            GridPagerTop.InitializeGridPager(SR.GridPagerServerRulesSingleItem,
                                             SR.GridPagerServerRulesMultipleItems,
                                             ServerRuleGridViewControl.TheGrid,
                                             () => ServerRuleGridViewControl.ServerRules == null
                                                       ? 0
                                                       : ServerRuleGridViewControl.ServerRules.Count,
                                             ImageServerConstants.GridViewPagerPosition.Top);
            ServerRuleGridViewControl.Pager = GridPagerTop;
            GridPagerTop.Reset();


            int prevSelectIndex = RuleApplyTimeDropDownList.SelectedIndex;

            RuleApplyTimeDropDownList.Items.Clear();
            RuleApplyTimeDropDownList.Items.Add(new ListItem(SR.All, "ALL"));
            foreach (ServerRuleApplyTimeEnum applyTimeEnum in ServerRuleApplyTimeEnum.GetAll())
            {
                RuleApplyTimeDropDownList.Items.Add(
                    new ListItem(ServerEnumDescription.GetLocalizedDescription(applyTimeEnum), applyTimeEnum.Lookup));
            }
            RuleApplyTimeDropDownList.SelectedIndex = prevSelectIndex;


            prevSelectIndex = RuleTypeDropDownList.SelectedIndex;
            RuleTypeDropDownList.Items.Clear();
            RuleTypeDropDownList.Items.Add(new ListItem(SR.All, "ALL"));
            foreach (ServerRuleTypeEnum typeEnum in ServerRuleTypeEnum.GetAll())
            {
                RuleTypeDropDownList.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(typeEnum), typeEnum.Lookup));
            }
            RuleTypeDropDownList.SelectedIndex = prevSelectIndex;

            if (Page.IsPostBack)
            {
                DataBind();
            }
        }
Пример #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int archiveSelectedIndex = ArchiveTypeFilter.SelectedIndex;

            ArchiveTypeFilter.Items.Clear();
            ArchiveTypeFilter.Items.Add(new ListItem(SR.All));
            foreach (ArchiveTypeEnum archiveTypeEnum in ArchiveTypeEnum.GetAll())
            {
                ArchiveTypeFilter.Items.Add(
                    new ListItem(ServerEnumDescription.GetLocalizedDescription(archiveTypeEnum), archiveTypeEnum.Lookup));
            }
            ArchiveTypeFilter.SelectedIndex = archiveSelectedIndex;

            int statusSelectedIndex = StatusFilter.SelectedIndex;
            StatusFilter.Items.Clear();
            StatusFilter.Items.Add(new ListItem(SR.All, SR.All));
            StatusFilter.Items.Add(new ListItem(SR.Enabled, SR.Enabled));
            StatusFilter.Items.Add(new ListItem(SR.Disabled, SR.Disabled));
            StatusFilter.SelectedIndex = statusSelectedIndex;
        }
Пример #21
0
        protected void StudyStorageView_DataBound(object sender, EventArgs e)
        {
            StudyStorageLocation ssl = (StudyStorageViewControl.DataItem) as StudyStorageLocation;

            if (ssl != null)
            {
                Label statusLabel = StudyStorageViewControl.FindControl("Status") as Label;
                if (statusLabel != null)
                {
                    statusLabel.Text = ServerEnumDescription.GetLocalizedDescription(ssl.StudyStatusEnum);
                }
                Label queueStateLable = StudyStorageViewControl.FindControl("QueueState") as Label;
                if (queueStateLable != null)
                {
                    queueStateLable.Text = ServerEnumDescription.GetLocalizedDescription(ssl.QueueStudyStateEnum);
                }
                Label studyFolder = StudyStorageViewControl.FindControl("StudyFolder") as Label;
                if (studyFolder != null)
                {
                    studyFolder.Text = ssl.GetStudyPath();
                }
                Label transferSyntaxUID = StudyStorageViewControl.FindControl("TransferSyntaxUID") as Label;
                if (transferSyntaxUID != null)
                {
                    transferSyntaxUID.Text = TransferSyntax.GetTransferSyntax(ssl.TransferSyntaxUid).Name;
                }
                Label tier = StudyStorageViewControl.FindControl("Tier") as Label;
                if (tier != null)
                {
                    tier.Text = ServerEnumDescription.GetLocalizedDescription(ssl.FilesystemTierEnum);
                }

                Label studySize = StudyStorageViewControl.FindControl("StudySize") as Label;
                if (studySize != null)
                {
                    ulong sizeInBytes = (ulong)(ssl.Study.StudySizeInKB * 1024);
                    studySize.Text = ByteCountFormatter.Format(sizeInBytes);
                }
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            GridPagerTop.InitializeGridPager(SR.GridPagerAlertSingleItemFound, SR.GridPagerAlertMultipleItemsFound, AlertsGridPanel.AlertGrid, delegate { return(AlertsGridPanel.ResultCount); }, ImageServerConstants.GridViewPagerPosition.Top);
            AlertsGridPanel.Pager = GridPagerTop;
            GridPagerTop.Reset();

            ClearInsertDateButton.OnClientClick = ScriptHelper.ClearDate(InsertDateFilter.ClientID, InsertDateCalendarExtender.ClientID);

            IList <AlertLevelEnum>    levelEnums    = AlertLevelEnum.GetAll();
            IList <AlertCategoryEnum> categoryEnums = AlertCategoryEnum.GetAll();

            int prevSelectedIndex = LevelFilter.SelectedIndex;

            LevelFilter.Items.Clear();
            LevelFilter.Items.Add(new ListItem(SR.Any, string.Empty));
            foreach (AlertLevelEnum ale in levelEnums)
            {
                LevelFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(ale), ale.Lookup));
            }
            LevelFilter.SelectedIndex = prevSelectedIndex;

            prevSelectedIndex = CategoryFilter.SelectedIndex;
            CategoryFilter.Items.Clear();
            CategoryFilter.Items.Add(new ListItem(SR.Any, string.Empty));
            foreach (AlertCategoryEnum ace in categoryEnums)
            {
                CategoryFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(ace), ace.Lookup));
            }
            CategoryFilter.SelectedIndex = prevSelectedIndex;

            DeleteAllAlertsButton.Roles =
                AuthorityTokens.Admin.Alert.Delete;
            DeleteAlertButton.Roles =
                AuthorityTokens.Admin.Alert.Delete;

            SetupEventHandlers();
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IList <RestoreQueueStatusEnum> statusItems = RestoreQueueStatusEnum.GetAll();

            int prevSelectedIndex = StatusFilter.SelectedIndex;

            StatusFilter.Items.Clear();
            StatusFilter.Items.Add(new ListItem(SR.All, "All"));
            foreach (RestoreQueueStatusEnum s in statusItems)
            {
                StatusFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(s), s.Lookup));
            }
            StatusFilter.SelectedIndex = prevSelectedIndex;

            DeleteItemButton.Roles       = AuthorityTokens.RestoreQueue.Delete;
            ViewStudyDetailsButton.Roles = AuthorityTokens.Study.View;

            if (!IsPostBack && !Page.IsAsync)
            {
                string patientID    = Server.UrlDecode(Request["PatientID"]);
                string patientName  = Server.UrlDecode(Request["PatientName"]);
                string partitionKey = Request["PartitionKey"];

                if (patientID != null && patientName != null && partitionKey != null)
                {
                    var controller = new ServerPartitionConfigController();
                    ServerPartition = controller.GetPartition(new ServerEntityKey("ServerPartition", partitionKey));

                    PatientId.Text   = patientID;
                    PatientName.Text = patientName;

                    RestoreQueueItemList.SetDataSource();
                    RestoreQueueItemList.Refresh();
                }
            }
        }
Пример #24
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);



            if (Studies == null)
            {
                return;
            }

            foreach (GridViewRow row in StudyListControl.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    StudySummary study = Studies[row.RowIndex];

                    if (study != null)
                    {
                        row.Attributes.Add("instanceuid", study.StudyInstanceUid);
                        row.Attributes.Add("serverae", study.ThePartition.AeTitle);

                        string reason;
                        if (study.CanScheduleDelete(out reason))
                        {
                            row.Attributes.Add("candelete", "true");
                        }

                        if (study.CanScheduleMove(out reason))
                        {
                            row.Attributes.Add("canmove", "true");
                        }

                        if (study.CanScheduleRestore(out reason))
                        {
                            row.Attributes.Add("canrestore", "true");
                        }

                        if (study.CanViewImages(out reason))
                        {
                            row.Attributes.Add("canviewimages", "true");
                        }
                        else
                        {
                            row.Attributes.Add("canviewimagesreason", reason);
                        }

                        var status = (Label)row.FindControl("StudyStatusEnum");
                        status.Text = ServerEnumDescription.GetLocalizedDescription(study.StudyStatusEnum);

                        LinkButton button = (LinkButton)row.FindControl("ReconcileLinkButton");
                        Label      label  = (Label)row.FindControl("SeparatorLabel");

                        if (study.IsReconcileRequired)
                        {
                            button.Visible = true;
                            label.Visible  = true;

                            button.PostBackUrl = ImageServerConstants.PageURLs.StudyIntegrityQueuePage +
                                                 "?PatientID=" + study.PatientId + "&PatientName=" + study.PatientsName + "&PartitionKey=" + study.ThePartition.GetKey();

                            button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.StudyIntegrityQueue.Search);
                        }
                        else
                        {
                            button.Visible = false;
                            label.Visible  = false;
                        }

                        button = (LinkButton)row.FindControl("QueueLinkButton");
                        label  = (Label)row.FindControl("QueueSeparatorLabel");

                        if (study.IsLocked)
                        {
                            button.Visible = true;

                            if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.RestoreScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.RestoreQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.RestoreQueue.Search);
                            }
                            else if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ArchiveScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.ArchiveQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.ArchiveQueue.Search);
                            }
                            else
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.WorkQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.WorkQueue.Search);
                            }
                        }
                        else
                        {
                            button.Visible = false;
                        }

                        label.Visible = button.Visible;
                    }
                }
            }
        }
        /// <summary>
        /// Displays the add/edit device dialog box.
        /// </summary>
        public void Show()
        {
            //If the validation failed, keep everything as is, and
            //make sure the dialog stays visible.
            if (!Page.IsValid)
            {
                RuleXmlTabPanel.TabIndex = 0;
                ModalDialog.Show();
                return;
            }

            // update the dropdown list
            RuleApplyTimeDropDownList.Items.Clear();
            RuleTypeDropDownList.Items.Clear();
            RuleXmlTabPanel.TabIndex = 0;
            ServerPartitionTabContainer.ActiveTabIndex = 0;

            var ep = new SampleRuleExtensionPoint();

            object[] extensions = ep.CreateExtensions();

            Dictionary <ServerRuleTypeEnum, IList <ServerRuleApplyTimeEnum> > ruleTypeList = LoadRuleTypes(extensions);

            if (EditMode)
            {
                ModalDialog.Title    = SR.DialogEditServerRuleTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;

                DefaultCheckBox.Checked    = _rule.DefaultRule;
                EnabledCheckBox.Checked    = _rule.Enabled;
                ExemptRuleCheckBox.Checked = _rule.ExemptRule;

                //if (_rule.DefaultRule)
                //	DefaultCheckBox.Enabled = false;

                RuleNameTextBox.Text = _rule.RuleName;

                SampleRuleDropDownList.Visible = false;
                SelectSampleRuleLabel.Visible  = false;

                // Fill in the drop down menus
                RuleTypeDropDownList.Items.Add(new ListItem(
                                                   ServerEnumDescription.GetLocalizedDescription(_rule.ServerRuleTypeEnum),
                                                   _rule.ServerRuleTypeEnum.Lookup));

                IList <ServerRuleApplyTimeEnum> list = new List <ServerRuleApplyTimeEnum>();


                if (ruleTypeList.ContainsKey(_rule.ServerRuleTypeEnum))
                {
                    list = ruleTypeList[_rule.ServerRuleTypeEnum];
                }

                foreach (ServerRuleApplyTimeEnum applyTime in list)
                {
                    RuleApplyTimeDropDownList.Items.Add(new ListItem(
                                                            ServerEnumDescription.GetLocalizedDescription(applyTime),
                                                            applyTime.Lookup));
                }


                if (RuleApplyTimeDropDownList.Items.FindByValue(_rule.ServerRuleApplyTimeEnum.Lookup) != null)
                {
                    RuleApplyTimeDropDownList.SelectedValue = _rule.ServerRuleApplyTimeEnum.Lookup;
                }

                RuleTypeDropDownList.SelectedValue = _rule.ServerRuleTypeEnum.Lookup;


                // Fill in the Rule XML
                var sw = new StringWriter();

                var xmlSettings = new XmlWriterSettings();

                xmlSettings.Encoding            = Encoding.UTF8;
                xmlSettings.ConformanceLevel    = ConformanceLevel.Fragment;
                xmlSettings.Indent              = true;
                xmlSettings.NewLineOnAttributes = false;
                xmlSettings.CheckCharacters     = true;
                xmlSettings.IndentChars         = "  ";

                XmlWriter tw = XmlWriter.Create(sw, xmlSettings);

                _rule.RuleXml.WriteTo(tw);

                tw.Close();

                RuleXmlTextBox.Text = sw.ToString();

                ServerRuleValidator.RuleTypeControl = RuleTypeDropDownList.SelectedValue;
            }
            else
            {
                ModalDialog.Title    = SR.DialogAddServerRuleTitle;
                OKButton.Visible     = false;
                UpdateButton.Visible = true;

                DefaultCheckBox.Checked    = false;
                EnabledCheckBox.Checked    = true;
                ExemptRuleCheckBox.Checked = false;

                RuleNameTextBox.Text = string.Empty;
                RuleXmlTextBox.Text  = string.Empty;

                SampleRuleDropDownList.Visible = true;
                SelectSampleRuleLabel.Visible  = true;

                // Do the drop down lists
                bool first = true;
                var  list  = new List <ServerRuleTypeEnum>();
                list.AddRange(ruleTypeList.Keys);

                // Sort the list by description
                list.Sort(
                    new Comparison <ServerRuleTypeEnum>(
                        delegate(ServerRuleTypeEnum type1, ServerRuleTypeEnum type2) { return(type1.Description.CompareTo(type2.Description)); }));

                foreach (ServerRuleTypeEnum type in list)
                {
                    if (first)
                    {
                        first = false;
                        SampleRuleDropDownList.Items.Clear();
                        SampleRuleDropDownList.Items.Add(new ListItem(string.Empty, string.Empty));

                        foreach (ISampleRule extension in extensions)
                        {
                            if (extension.Type.Equals(type))
                            {
                                SampleRuleDropDownList.Items.Add(new ListItem(extension.Description, extension.Name));
                            }
                        }

                        foreach (ServerRuleApplyTimeEnum applyTime in ruleTypeList[type])
                        {
                            RuleApplyTimeDropDownList.Items.Add(new ListItem(
                                                                    ServerEnumDescription.GetLocalizedDescription(applyTime),
                                                                    applyTime.Lookup));
                        }
                    }

                    RuleTypeDropDownList.Items.Add(new ListItem(
                                                       ServerEnumDescription.GetLocalizedDescription(type), type.Lookup));
                }

                ServerRuleValidator.RuleTypeControl = RuleTypeDropDownList.SelectedValue;
            }

            ModalDialog.Show();
            return;
        }
Пример #26
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearFromDateButton.OnClientClick = ScriptHelper.ClearDate(FromDate.ClientID,
                                                                       FromDateCalendarExtender.ClientID);
            ClearToDateButton.OnClientClick = ScriptHelper.ClearDate(ToDate.ClientID,
                                                                     ToDateCalendarExtender.ClientID);
            ToDate.Attributes["OnChange"] = ScriptHelper.CheckDateRange(FromDate.ClientID, ToDate.ClientID,
                                                                        ToDate.ClientID, ToDateCalendarExtender.ClientID,
                                                                        "To Date must be greater than From Date");
            FromDate.Attributes["OnChange"] = ScriptHelper.CheckDateRange(FromDate.ClientID, ToDate.ClientID,
                                                                          FromDate.ClientID,
                                                                          FromDateCalendarExtender.ClientID,
                                                                          "From Date must be less than To Date");

            GridPagerTop.InitializeGridPager(Labels.GridPagerQueueSingleItem,
                                             Labels.GridPagerQueueMultipleItems,
                                             StudyIntegrityQueueItemList.StudyIntegrityQueueGrid,
                                             () => StudyIntegrityQueueItemList.ResultCount,
                                             ImageServerConstants.GridViewPagerPosition.Top);
            StudyIntegrityQueueItemList.Pager = GridPagerTop;

            StudyIntegrityQueueItemList.DataSourceCreated += delegate(StudyIntegrityQueueDataSource source)
            {
                source.Partition = ServerPartition;

                if (!String.IsNullOrEmpty(PatientName.Text))
                {
                    source.PatientName = SearchHelper.NameWildCard(PatientName.Text);
                }
                if (!String.IsNullOrEmpty(PatientId.Text))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.Text);
                }
                if (!String.IsNullOrEmpty(AccessionNumber.Text))
                {
                    source.AccessionNumber = SearchHelper.TrailingWildCard(AccessionNumber.Text);
                }
                if (!String.IsNullOrEmpty(FromDate.Text))
                {
                    source.FromInsertTime = FromDate.Text;
                }

                if (!String.IsNullOrEmpty(ToDate.Text))
                {
                    source.ToInsertTime = ToDate.Text;
                }

                if (ReasonListBox.SelectedIndex > -1)
                {
                    var reasonEnums =
                        new List <StudyIntegrityReasonEnum>();
                    foreach (ListItem item in ReasonListBox.Items)
                    {
                        if (item.Selected)
                        {
                            reasonEnums.Add(
                                StudyIntegrityReasonEnum.GetEnum(
                                    item.Value));
                        }
                    }

                    source.ReasonEnum = reasonEnums;
                }
            };

            ReconcileButton.Roles =
                AuthorityTokens.StudyIntegrityQueue.Reconcile;

            List <StudyIntegrityReasonEnum> reasons = StudyIntegrityReasonEnum.GetAll();

            foreach (StudyIntegrityReasonEnum reason in reasons)
            {
                ReasonListBox.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(reason), reason.Lookup));
            }
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);



            if (Studies == null)
            {
                return;
            }

            foreach (GridViewRow row in StudyListControl.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    StudySummary study = Studies[row.RowIndex];

                    if (study != null)
                    {
                        row.Attributes.Add("instanceuid", study.StudyInstanceUid);
                        row.Attributes.Add("serverae", study.ThePartition.AeTitle);

                        string reason;
                        if (study.CanScheduleDelete(out reason))
                        {
                            row.Attributes.Add("candelete", "true");
                        }

                        if (study.CanScheduleMove(out reason))
                        {
                            row.Attributes.Add("canmove", "true");
                        }

                        if (study.CanScheduleRestore(out reason))
                        {
                            row.Attributes.Add("canrestore", "true");
                        }

                        if (study.CanViewImages(out reason))
                        {
                            row.Attributes.Add("canviewimages", "true");
                        }
                        else
                        {
                            row.Attributes.Add("canviewimagesreason", reason);
                        }

                        var status = (Label)row.FindControl("StudyStatusEnum");
                        status.Text = ServerEnumDescription.GetLocalizedDescription(study.StudyStatusEnum);


                        var qcStatusLink = (HtmlAnchor)row.FindControl("QCStatusLink");
                        if (qcStatusLink != null)
                        {
                            var processing = study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ProcessingScheduled) || study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ProcessingScheduled);
                            if (string.IsNullOrEmpty(study.TheStudy.QCOutput))
                            {
                                if (!processing)
                                {
                                    qcStatusLink.InnerText = "N/A";
                                    qcStatusLink.HRef      = ResolveClientUrl(string.Format("~/Pages/Studies/StudyQCReport.aspx?PartitionAE={0}&StudyUid={1}",
                                                                                            study.ThePartition.AeTitle, study.TheStudy.StudyInstanceUid
                                                                                            ));
                                }
                                else
                                {
                                    qcStatusLink.InnerText = "";
                                }
                            }
                        }



                        LinkButton button = (LinkButton)row.FindControl("ReconcileLinkButton");
                        Label      label  = (Label)row.FindControl("SeparatorLabel");

                        if (study.IsReconcileRequired)
                        {
                            button.Visible = true;
                            label.Visible  = true;

                            button.PostBackUrl = ImageServerConstants.PageURLs.StudyIntegrityQueuePage +
                                                 "?PatientID=" + study.PatientId + "&PatientName=" + study.PatientsName + "&PartitionKey=" + study.ThePartition.GetKey();

                            button.Enabled = Context.User.IsInRole(AuthorityTokens.StudyIntegrityQueue.Search);
                        }
                        else
                        {
                            button.Visible = false;
                            label.Visible  = false;
                        }

                        button = (LinkButton)row.FindControl("QueueLinkButton");
                        label  = (Label)row.FindControl("QueueSeparatorLabel");

                        if (study.IsLocked)
                        {
                            button.Visible = true;

                            if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.RestoreScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.RestoreQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.RestoreQueue.Search);
                            }
                            else if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ArchiveScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.ArchiveQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.ArchiveQueue.Search);
                            }
                            else
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.WorkQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.WorkQueue.Search);
                            }
                        }
                        else
                        {
                            button.Visible = false;
                        }

                        label.Visible = button.Visible;
                    }
                }
            }
        }
        protected void UpdateUI()
        {
            // Update the title and OK button text. Changing the image is the only way to do this, since the
            // SkinID cannot be set dynamically after Page_PreInit.


            // update the dropdown list
            DuplicateSopDropDownList.Items.Clear();
            foreach (DuplicateSopPolicyEnum policyEnum in DuplicateSopPolicyEnum.GetAll())
            {
                ListItem item = new ListItem(ServerEnumDescription.GetLocalizedDescription(policyEnum), policyEnum.Lookup);
                DuplicateSopDropDownList.Items.Add(item);
            }

            if (Partition == null)
            {
                AETitleTextBox.Text              = "SERVERAE";
                DescriptionTextBox.Text          = string.Empty;
                PortTextBox.Text                 = "104";
                PartitionFolderTextBox.Text      = "SERVERAE";
                EnabledCheckBox.Checked          = true;
                AutoInsertDeviceCheckBox.Checked = true;
                AcceptAnyDeviceCheckBox.Checked  = true;
                DefaultRemotePortTextBox.Text    = "104";

                AutoInsertDeviceCheckBox.Enabled = true;
                DefaultRemotePortTextBox.Enabled = true;

                DuplicateSopDropDownList.SelectedIndex = 0;
                AcceptLatestReportCheckBox.Checked     = true;

                MatchPatientName.Checked         = true;
                MatchPatientID.Checked           = true;
                MatchPatientBirthDate.Checked    = true;
                MatchPatientSex.Checked          = true;
                MatchAccessionNumber.Checked     = true;
                MatchIssuer.Checked              = true;
                AuditDeleteStudyCheckBox.Checked = true;  //TODO: Load from system setting instead
            }
            else if (Page.IsValid)
            // only update the UI with the partition if the data is valid, otherwise, keep them on the screen
            {
                AETitleTextBox.Text              = Partition.AeTitle;
                DescriptionTextBox.Text          = Partition.Description;
                PortTextBox.Text                 = Partition.Port.ToString();
                PartitionFolderTextBox.Text      = Partition.PartitionFolder;
                EnabledCheckBox.Checked          = Partition.Enabled;
                AutoInsertDeviceCheckBox.Checked = Partition.AutoInsertDevice;
                AcceptAnyDeviceCheckBox.Checked  = Partition.AcceptAnyDevice;
                DefaultRemotePortTextBox.Text    = Partition.DefaultRemotePort.ToString();

                DefaultRemotePortTextBox.Enabled = Partition.AutoInsertDevice;

                DuplicateSopDropDownList.SelectedValue = Partition.DuplicateSopPolicyEnum.Lookup;
                AcceptLatestReportCheckBox.Checked     = Partition.AcceptLatestReport;

                MatchPatientName.Checked         = Partition.MatchPatientsName;
                MatchPatientID.Checked           = Partition.MatchPatientId;
                MatchPatientBirthDate.Checked    = Partition.MatchPatientsBirthDate;
                MatchPatientSex.Checked          = Partition.MatchPatientsSex;
                MatchAccessionNumber.Checked     = Partition.MatchAccessionNumber;
                MatchIssuer.Checked              = Partition.MatchIssuerOfPatientId;
                AuditDeleteStudyCheckBox.Checked = Partition.AuditDeleteStudy;
            }
        }
Пример #29
0
        private void SetupChildControls()
        {
            foreach (StudyStatusEnum s in  StudyStatusEnum.GetAll())
            {
                StatusListBox.Items.Add(new ListItem {
                    Text = ServerEnumDescription.GetLocalizedDescription(s), Value = s.Lookup
                });
            }

            ClearToStudyDateButton.Attributes["onclick"]   = ScriptHelper.ClearDate(ToStudyDate.ClientID, ToStudyDateCalendarExtender.ClientID);
            ClearFromStudyDateButton.Attributes["onclick"] = ScriptHelper.ClearDate(FromStudyDate.ClientID, FromStudyDateCalendarExtender.ClientID);
            ToStudyDate.Attributes["OnChange"]             = ScriptHelper.CheckDateRange(FromStudyDate.ClientID, ToStudyDate.ClientID, ToStudyDate.ClientID, ToStudyDateCalendarExtender.ClientID, "To Date must be greater than From Date");
            FromStudyDate.Attributes["OnChange"]           = ScriptHelper.CheckDateRange(FromStudyDate.ClientID, ToStudyDate.ClientID, FromStudyDate.ClientID, FromStudyDateCalendarExtender.ClientID, "From Date must be less than To Date");

            GridPagerTop.InitializeGridPager(SR.GridPagerStudySingleItem, SR.GridPagerStudyMultipleItems, StudyListGridView.TheGrid,
                                             () => StudyListGridView.ResultCount, ImageServerConstants.GridViewPagerPosition.Top);
            StudyListGridView.Pager = GridPagerTop;

            ConfirmStudySearchMessageBox.Confirmed += delegate
            {
                StudyListGridView.DataBindOnPreRender =
                    true;
                StudyListGridView.Refresh();
                if (SearchUpdatePanel.UpdateMode ==
                    UpdatePanelUpdateMode.Conditional)
                {
                    SearchUpdatePanel.Update();
                }
            };
            ConfirmStudySearchMessageBox.Cancel += delegate
            {
                StudyListGridView.DataBindOnPreRender = false;
            };

            RestoreMessageBox.Confirmed += delegate(object data)
            {
                if (data is IList <Study> )
                {
                    var studies = data as IList <Study>;
                    foreach (Study study in studies)
                    {
                        _controller.RestoreStudy(study);
                    }
                }
                else if (data is IList <StudySummary> )
                {
                    var studies = data as IList <StudySummary>;
                    foreach (StudySummary study in studies)
                    {
                        _controller.RestoreStudy(study.TheStudy);
                    }
                }
                else if (data is Study)
                {
                    var study = data as Study;
                    _controller.RestoreStudy(study);
                }

                DataBind();
                SearchUpdatePanel.Update();                 // force refresh
            };

            StudyListGridView.DataSourceCreated += delegate(StudyDataSource source)
            {
                source.Partition   = ServerPartition;
                source.DateFormats = ToStudyDateCalendarExtender.Format;

                if (!String.IsNullOrEmpty(PatientId.Text))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.Text);
                }
                if (!String.IsNullOrEmpty(PatientName.Text))
                {
                    source.PatientName = SearchHelper.NameWildCard(PatientName.Text);
                }
                if (!String.IsNullOrEmpty(AccessionNumber.Text))
                {
                    source.AccessionNumber = SearchHelper.TrailingWildCard(AccessionNumber.Text);
                }
                if (!String.IsNullOrEmpty(ToStudyDate.Text))
                {
                    source.ToStudyDate = ToStudyDate.Text;
                }
                if (!String.IsNullOrEmpty(FromStudyDate.Text))
                {
                    source.FromStudyDate = FromStudyDate.Text;
                }
                if (!String.IsNullOrEmpty(StudyDescription.Text))
                {
                    source.StudyDescription = SearchHelper.LeadingAndTrailingWildCard(StudyDescription.Text);
                }
                if (!String.IsNullOrEmpty(ReferringPhysiciansName.Text))
                {
                    source.ReferringPhysiciansName = SearchHelper.NameWildCard(ReferringPhysiciansName.Text);
                }
                if (!String.IsNullOrEmpty(ResponsiblePerson.Text))
                {
                    source.ResponsiblePerson = SearchHelper.NameWildCard(ResponsiblePerson.Text);
                }
                if (!String.IsNullOrEmpty(ResponsibleOrganization.Text))
                {
                    source.ResponsibleOrganization = SearchHelper.NameWildCard(ResponsibleOrganization.Text);
                }

                if (ModalityListBox.SelectedIndex > -1)
                {
                    var modalities = new List <string>();
                    foreach (ListItem item in ModalityListBox.Items)
                    {
                        if (item.Selected)
                        {
                            modalities.Add(item.Value);
                        }
                    }
                    source.Modalities = modalities.ToArray();
                }

                if (StatusListBox.SelectedIndex > -1)
                {
                    var statuses = new List <string>();
                    foreach (ListItem status in StatusListBox.Items)
                    {
                        if (status.Selected)
                        {
                            statuses.Add(status.Value);
                        }
                    }
                    source.Statuses = statuses.ToArray();
                }
            };

            //Set Roles
            ViewImagesButton.Roles            = AuthorityTokens.Study.ViewImages;
            ViewStudyDetailsButton.Roles      = AuthorityTokens.Study.View;
            MoveStudyButton.Roles             = AuthorityTokens.Study.Move;
            DeleteStudyButton.Roles           = AuthorityTokens.Study.Delete;
            RestoreStudyButton.Roles          = AuthorityTokens.Study.Restore;
            AssignAuthorityGroupsButton.Roles = ClearCanvas.ImageServer.Enterprise.Authentication.AuthorityTokens.Study.EditDataAccess;
        }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServerPartitionConfigController partitionConfigController = new ServerPartitionConfigController();

            string serverae = Request.QueryString[ImageServerConstants.QueryStrings.ServerAE];

            if (!String.IsNullOrEmpty(serverae))
            {
                // Load the Partition
                ServerPartitionSelectCriteria partitionCriteria = new ServerPartitionSelectCriteria();
                partitionCriteria.AeTitle.EqualTo(serverae);
                IList <ServerPartition> list = partitionConfigController.GetPartitions(partitionCriteria);
                Partition = list[0];
                SeriesGridView.Partition = Partition;

                string studyuid = Request.QueryString[ImageServerConstants.QueryStrings.StudyUID];

                if (!String.IsNullOrEmpty(studyuid) || Partition != null)
                {
                    StudyController     studyController = new StudyController();
                    StudySelectCriteria criteria        = new StudySelectCriteria();
                    criteria.StudyInstanceUid.EqualTo(studyuid);
                    criteria.ServerPartitionKey.EqualTo(Partition.Key);

                    IList <Study> studyList = studyController.GetStudies(criteria);

                    SelectedStudy                 = studyList[0];
                    SeriesGridView.Study          = studyList[0];
                    PatientSummary.PatientSummary = PatientSummaryAssembler.CreatePatientSummary(studyList[0]);
                    StudySummary.Study            = studyList[0];
                }
            }

            if (DHCPFilter.Items.Count == 0)
            {
                DHCPFilter.Items.Add(new ListItem(SR.All));
                DHCPFilter.Items.Add(new ListItem(SR.DHCP));
                DHCPFilter.Items.Add(new ListItem(SR.NoDHCP));
            }

            IList <DeviceTypeEnum> deviceTypes = DeviceTypeEnum.GetAll();

            if (DeviceTypeFilter.Items.Count == 0)
            {
                foreach (DeviceTypeEnum t in deviceTypes)
                {
                    DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                }
            }
            else
            {
                ListItem[] typeItems = new ListItem[DeviceTypeFilter.Items.Count];
                DeviceTypeFilter.Items.CopyTo(typeItems, 0);
                DeviceTypeFilter.Items.Clear();
                int count = 0;
                foreach (DeviceTypeEnum t in deviceTypes)
                {
                    DeviceTypeFilter.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(t), t.Lookup));
                    DeviceTypeFilter.Items[count].Selected = typeItems[count].Selected;
                    count++;
                }
            }

            LoadSeries();
            LoadDevices();

            DataBind();
        }