public StudyHistory(
      DateTime _insertTime_
     ,ServerEntityKey _studyStorageKey_
     ,StudyHistoryTypeEnum _studyHistoryTypeEnum_
     ,XmlDocument _studyData_
     ,XmlDocument _changeDescription_
     ,ServerEntityKey _destStudyStorageKey_
     ):base("StudyHistory")
 {
     InsertTime = _insertTime_;
     StudyStorageKey = _studyStorageKey_;
     StudyHistoryTypeEnum = _studyHistoryTypeEnum_;
     StudyData = _studyData_;
     ChangeDescription = _changeDescription_;
     DestStudyStorageKey = _destStudyStorageKey_;
 }
Exemple #2
0
 public StudyHistory(
     DateTime _insertTime_
     , ServerEntityKey _studyStorageKey_
     , StudyHistoryTypeEnum _studyHistoryTypeEnum_
     , XmlDocument _studyData_
     , XmlDocument _changeDescription_
     , ServerEntityKey _destStudyStorageKey_
     ) : base("StudyHistory")
 {
     InsertTime           = _insertTime_;
     StudyStorageKey      = _studyStorageKey_;
     StudyHistoryTypeEnum = _studyHistoryTypeEnum_;
     StudyData            = _studyData_;
     ChangeDescription    = _changeDescription_;
     DestStudyStorageKey  = _destStudyStorageKey_;
 }
        public static StudyHistory CreateStudyHistoryRecord(IUpdateContext updateContext,
                                                            StudyStorageLocation primaryStudyLocation,
                                                            StudyStorageLocation secondaryStudyLocation,
                                                            StudyHistoryTypeEnum type, object entryInfo,
                                                            object changeLog)
        {
            var columns = new StudyHistoryUpdateColumns
                {
                    InsertTime = Platform.Time,
                    StudyHistoryTypeEnum = type,
                    StudyStorageKey = primaryStudyLocation.GetKey(),
                    DestStudyStorageKey =
                        secondaryStudyLocation != null
                            ? secondaryStudyLocation.GetKey()
                            : primaryStudyLocation.GetKey(),
                    StudyData = XmlUtils.SerializeAsXmlDoc(entryInfo) ?? new XmlDocument(),
                    ChangeDescription = XmlUtils.SerializeAsXmlDoc(changeLog) ?? new XmlDocument()
                };

            var broker = updateContext.GetBroker<IStudyHistoryEntityBroker>();
            return broker.Insert(columns);
        }