Beispiel #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearScheduleDateButton.OnClientClick = ScriptHelper.ClearDate(ScheduleDate.ClientID,
                                                                           ScheduleDateCalendarExtender.ClientID);

            // setup child controls
            GridPagerTop.InitializeGridPager(Labels.GridPagerQueueSingleItem, Labels.GridPagerQueueMultipleItems,
                                             RestoreQueueItemList.RestoreQueueGrid,
                                             () => RestoreQueueItemList.ResultCount,
                                             ImageServerConstants.GridViewPagerPosition.Top);
            RestoreQueueItemList.Pager = GridPagerTop;

            MessageBox.Confirmed += delegate(object data)
            {
                if (data is IList <Model.RestoreQueue> )
                {
                    var items = data as IList <Model.RestoreQueue>;
                    foreach (Model.RestoreQueue item in items)
                    {
                        _controller.DeleteRestoreQueueItem(item);
                    }
                }
                else if (data is Model.RestoreQueue)
                {
                    var item = data as Model.RestoreQueue;
                    _controller.DeleteRestoreQueueItem(item);
                }

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

            RestoreQueueItemList.DataSourceCreated += delegate(RestoreQueueDataSource source)
            {
                source.Partition   = ServerPartition;
                source.DateFormats = ScheduleDateCalendarExtender.Format;

                if (!String.IsNullOrEmpty(StatusFilter.SelectedValue) && StatusFilter.SelectedIndex > 0)
                {
                    source.StatusEnum = RestoreQueueStatusEnum.GetEnum(StatusFilter.SelectedValue);
                }
                if (!String.IsNullOrEmpty(PatientId.TrimText))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.TrimText);
                }
                if (!String.IsNullOrEmpty(PatientName.TrimText))
                {
                    source.PatientName = SearchHelper.NameWildCard(PatientName.TrimText);
                }
                if (!String.IsNullOrEmpty(ScheduleDate.Text))
                {
                    source.ScheduledDate = ScheduleDate.Text;
                }
            };
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearStudyDateButton.OnClientClick = ScriptHelper.ClearDate(StudyDate.ClientID,
                                                                        StudyDateCalendarExtender.ClientID);

            GridPagerTop.InitializeGridPager(Labels.GridPagerQueueSingleItem, Labels.GridPagerQueueMultipleItems,
                                             SearchResultGridView1.GridViewControl,
                                             () => SearchResultGridView1.ResultCount,
                                             ImageServerConstants.GridViewPagerPosition.Top);
            SearchResultGridView1.Pager = GridPagerTop;
            GridPagerTop.Reset();

            SearchResultGridView1.DataSourceContainer.ObjectCreated += DataSource_ObjectCreated;

            DeleteButton.Roles =
                AuthorityTokens.Admin.StudyDeleteHistory.Delete;
            ViewStudyDetailsButton.Roles =
                AuthorityTokens.Admin.StudyDeleteHistory.View;
        }
        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();
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearToDateFilterButton.Attributes["onclick"]   = ScriptHelper.ClearDate(ToDateFilter.ClientID, ToDateCalendarExtender.ClientID);
            ClearFromDateFilterButton.Attributes["onclick"] = ScriptHelper.ClearDate(FromDateFilter.ClientID, FromDateCalendarExtender.ClientID);
            ToDateFilter.Attributes["OnChange"]             = ScriptHelper.PopulateDefaultToTime(ToTimeFilter.ClientID) + " return false;";
            FromDateFilter.Attributes["OnChange"]           = ScriptHelper.PopulateDefaultFromTime(FromTimeFilter.ClientID) + " return false;";
            SearchButton.Attributes["onclick"] = ScriptHelper.CheckDateRange(FromDateFilter.ClientID, ToDateFilter.ClientID, SR.ToFromDateValidationError);
            GridPagerTop.InitializeGridPager(SR.GridPagerApplicationLogSingleItem, SR.GridPagerApplicationLogMultipleItems, ApplicationLogGridView.ApplicationLogListGrid, delegate { return(ApplicationLogGridView.ResultCount); }, ImageServerConstants.GridViewPagerPosition.Top);
            ApplicationLogGridView.Pager = GridPagerTop;

            ApplicationLogGridView.DataSourceCreated += delegate(ApplicationLogDataSource source)
            {
                if (!String.IsNullOrEmpty(HostFilter.TrimText))
                {
                    source.Host = SearchHelper.LeadingAndTrailingWildCard(HostFilter.TrimText);
                }
                if (!String.IsNullOrEmpty(ThreadFilter.TrimText))
                {
                    source.Thread = SearchHelper.LeadingAndTrailingWildCard(ThreadFilter.TrimText);
                }
                if (!String.IsNullOrEmpty(MessageFilter.TrimText))
                {
                    source.Message = SearchHelper.LeadingAndTrailingWildCard(MessageFilter.TrimText);
                }
                if (!String.IsNullOrEmpty(LogLevelListBox.SelectedValue))
                {
                    if (!LogLevelListBox.SelectedValue.Equals("ANY"))
                    {
                        source.LogLevel = LogLevelListBox.SelectedValue;
                    }
                }
                if (!String.IsNullOrEmpty(FromDateFilter.Text) || !String.IsNullOrEmpty(FromTimeFilter.Text))
                {
                    DateTime val;

                    if (DateTime.TryParseExact(FromDateFilter.Text + " " + FromTimeFilter.Text, DateTimeFormatter.DefaultTimestampFormat, CultureInfo.CurrentCulture, DateTimeStyles.None, out val))
                    {
                        source.StartDate = val;
                    }
                    else if (DateTime.TryParse(FromDateFilter.Text + " " + FromTimeFilter.Text, out val))
                    {
                        source.StartDate = val;
                    }
                }

                if (!String.IsNullOrEmpty(ToDateFilter.Text) || !String.IsNullOrEmpty(ToTimeFilter.Text))
                {
                    DateTime val;
                    if (DateTime.TryParseExact(ToDateFilter.Text + " " + ToTimeFilter.Text, DateTimeFormatter.DefaultTimestampFormat, CultureInfo.CurrentCulture, DateTimeStyles.None, out val))
                    {
                        source.EndDate = val;
                    }
                    else if (DateTime.TryParse(ToDateFilter.Text + " " + ToTimeFilter.Text, out val))
                    {
                        source.EndDate = val;
                    }
                }
            };
        }
        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 OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearScheduleDateButton.OnClientClick = ScriptHelper.ClearDate(ScheduleDate.ClientID, ScheduleCalendarExtender.ClientID);

            // setup child controls
            GridPagerTop.InitializeGridPager(SR.GridPagerWorkQueueSingleItem, SR.GridPagerWorkQueueMultipleItems, workQueueItemList.WorkQueueItemGridView,
                                             () => workQueueItemList.ResultCount, ImageServerConstants.GridViewPagerPosition.Top);
            workQueueItemList.Pager = GridPagerTop;

            workQueueItemList.ServerPartition = _serverPartition;

            workQueueItemList.DataSourceCreated += delegate(WorkQueueDataSource source)
            {
                if (!String.IsNullOrEmpty(PatientName.TrimText))
                {
                    source.PatientsName = SearchHelper.NameWildCard(PatientName.TrimText);
                }

                source.Partition = ServerPartition;

                if (!String.IsNullOrEmpty(PatientId.TrimText))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.TrimText);
                }

                if (!String.IsNullOrEmpty(ProcessingServer.TrimText))
                {
                    source.ProcessingServer = SearchHelper.TrailingWildCard(ProcessingServer.TrimText);
                }

                source.ScheduledDate = !string.IsNullOrEmpty(ScheduleDate.Text) ? ScheduleDate.Text : string.Empty;

                source.DateFormats = ScheduleCalendarExtender.Format;

                if (TypeListBox.SelectedIndex > -1)
                {
                    var types = new List <WorkQueueTypeEnum>();
                    foreach (ListItem item in TypeListBox.Items)
                    {
                        if (item.Selected)
                        {
                            types.Add(WorkQueueTypeEnum.GetEnum(item.Value));
                        }
                    }
                    source.TypeEnums = types.ToArray();
                }

                if (StatusListBox.SelectedIndex > -1)
                {
                    var statuses = new List <WorkQueueStatusEnum>();
                    foreach (ListItem item in StatusListBox.Items)
                    {
                        if (item.Selected)
                        {
                            statuses.Add(WorkQueueStatusEnum.GetEnum(item.Value));
                        }
                    }
                    source.StatusEnums = statuses.ToArray();
                }

                if (PriorityDropDownList.SelectedValue != string.Empty)
                {
                    source.PriorityEnum = WorkQueuePriorityEnum.GetEnum(PriorityDropDownList.SelectedValue);
                }
            };

            MessageBox.Confirmed += delegate
            {
                workQueueItemList.RefreshCurrentPage();
            };
        }
Beispiel #7
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;
        }