public void DeleteSeries() { string reason; if (!_study.CanScheduleSeriesDelete(out reason)) { MessageDialog.MessageType = MessageBox.MessageTypeEnum.ERROR; MessageDialog.Message = reason; MessageDialog.Show(); } else { IList <Series> selectedSeries = StudyDetailsPanel.StudyDetailsTabsControl.SelectedSeries; Study theStudy = _study.TheStudy; DeleteSeriesConfirmDialog.DeleteEntireStudy = theStudy.Series.Count == selectedSeries.Count; DeleteSeriesConfirmDialog.DeletingSeries = CollectionUtils.Map( selectedSeries, delegate(Series series) { var info = new DeleteSeriesInfo { StudyKey = _study.Key, Study = theStudy, Series = series, ServerPartitionAE = _study.ThePartition.AeTitle, Description = series.SeriesDescription, Modality = series.Modality, SeriesNumber = series.SeriesNumber, NumberOfSeriesRelatedInstances = series.NumberOfSeriesRelatedInstances, PerformedProcedureStepStartDate = series.PerformedProcedureStepStartDate, PerformedProcedureStepStartTime = series.PerformedProcedureStepStartTime, SeriesInstanceUid = series.SeriesInstanceUid }; return(info); } ); DeleteSeriesConfirmDialog.Show(); updatepanel.Update(); } }
protected override void OnPreRender(EventArgs e) { string reason; int[] selectedSeriesIndices = SeriesGridView.SeriesListControl.SelectedIndices; ViewSeriesButton.Enabled = selectedSeriesIndices != null && selectedSeriesIndices.Length > 0; MoveSeriesButton.Enabled = selectedSeriesIndices != null && selectedSeriesIndices.Length > 0; DeleteSeriesButton.Enabled = selectedSeriesIndices != null && selectedSeriesIndices.Length > 0 && _study.CanScheduleSeriesDelete(out reason); base.OnPreRender(e); }