protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (_partition != null && _study == null) { StudyNotFoundException exception = new StudyNotFoundException(string.Format("{0},The Study is null in Default.aspx -> OnPreRender()", _studyInstanceUid)); ExceptionHandler.ThrowException(exception); } if (_partition == null) { PartitionNotFoundException exception = new PartitionNotFoundException(string.Format("{0},The Server Partition is null in Default.aspx -> OnPreRender()", _serverae)); ExceptionHandler.ThrowException(exception); } if (_study == null) { StudyNotFoundException exception = new StudyNotFoundException(string.Format("{0},The Study is null in Default.aspx -> OnPreRender()", _studyInstanceUid)); ExceptionHandler.ThrowException(exception); } else { SetPageTitle(String.Format("{0}:{1}", NameFormatter.Format(_study.PatientsName), _study.PatientId), false); } }
protected void LoadStudy() { if (String.IsNullOrEmpty(_studyInstanceUid)) { return; } if (_partition == null) { return; } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(_studyInstanceUid); criteria.ServerPartitionKey.EqualTo(Partition.GetKey()); Study study = studyAdaptor.GetFirst(HttpContextData.Current.ReadContext, criteria); if (study != null) { _study = StudySummaryAssembler.CreateStudySummary(HttpContextData.Current.ReadContext, study); } else { StudyNotFoundException exception = new StudyNotFoundException(string.Format("{0},The Study is null in Default.aspx -> LoadStudy()", _studyInstanceUid)); ExceptionHandler.ThrowException(exception); } StudyDetailsPanel.Study = _study; StudyDetailsPanel.DataBind(); }