Beispiel #1
0
 public void OnCompleted(WebDeleteProcessorContext context, IList<Series> series)
 {
     if (series.Count > 0)
     {
         Platform.Log(LogLevel.Info, "Logging history..");
         DateTime now = Platform.Time;
         using(IUpdateContext ctx = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
         {
             IStudyHistoryEntityBroker broker = ctx.GetBroker<IStudyHistoryEntityBroker>();
             StudyHistoryUpdateColumns columns = new StudyHistoryUpdateColumns();
             columns.InsertTime = Platform.Time;
             columns.StudyHistoryTypeEnum = StudyHistoryTypeEnum.SeriesDeleted;
             columns.StudyStorageKey = context.StorageLocation.Key;
             columns.DestStudyStorageKey = context.StorageLocation.Key;
             columns.StudyData = XmlUtils.SerializeAsXmlDoc(_studyInfo);
             SeriesDeletionChangeLog changeLog =  new SeriesDeletionChangeLog();
             changeLog.TimeStamp = now;
             changeLog.Reason = context.Reason;
             changeLog.UserId = context.UserId;
             changeLog.UserName = context.UserName;
             changeLog.Series = CollectionUtils.Map(series,
                               delegate(Series ser)
                                   {
                                       ServerEntityAttributeProvider seriesWrapper = new ServerEntityAttributeProvider(ser);
                                       return new SeriesInformation(seriesWrapper);
                                   });
             columns.ChangeDescription = XmlUtils.SerializeAsXmlDoc(changeLog);
             StudyHistory history = broker.Insert(columns);
             if (history!=null)
                 ctx.Commit();
             
         }
     }
     
 }
Beispiel #2
0
        public static StudyInformation CreateFrom(Study study)
        {
            ServerEntityAttributeProvider studyWrapper = new ServerEntityAttributeProvider(study);
            StudyInformation studyInfo = new StudyInformation(studyWrapper);

            foreach (Series series in study.Series.Values)
            {
                ServerEntityAttributeProvider seriesWrapper = new ServerEntityAttributeProvider(series);
                SeriesInformation             seriesInfo    = new SeriesInformation(seriesWrapper);
                studyInfo.Add(seriesInfo);
            }

            return(studyInfo);
        }
Beispiel #3
0
		public static StudyInformation CreateFrom(Study study)
		{
			ServerEntityAttributeProvider studyWrapper = new ServerEntityAttributeProvider(study);
			StudyInformation studyInfo = new StudyInformation(studyWrapper);

			foreach(Series series in study.Series.Values)
			{
				ServerEntityAttributeProvider seriesWrapper = new ServerEntityAttributeProvider(series);
				SeriesInformation seriesInfo = new SeriesInformation(seriesWrapper);
				studyInfo.Add(seriesInfo);
			}

			return studyInfo;
		}