public ArchiveStudyStorage GetFirstArchiveStudyStorage(IPersistenceContext read, ServerEntityKey studyStorageKey) { Platform.CheckForNullReference(studyStorageKey, "studyStorageKey"); ArchiveStudyStorageAdaptor adaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria archiveStudyStorageCriteria = new ArchiveStudyStorageSelectCriteria(); archiveStudyStorageCriteria.StudyStorageKey.EqualTo(studyStorageKey); archiveStudyStorageCriteria.ArchiveTime.SortDesc(0); return(adaptor.GetFirst(read, archiveStudyStorageCriteria)); }
public IList <ArchiveStudyStorage> GetArchiveStudyStorage(Study study) { Platform.CheckForNullReference(study, "Study"); ArchiveStudyStorageAdaptor adaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria archiveStudyStorageCriteria = new ArchiveStudyStorageSelectCriteria(); archiveStudyStorageCriteria.StudyStorageKey.EqualTo(study.StudyStorageKey); archiveStudyStorageCriteria.ArchiveTime.SortDesc(0); return(adaptor.Get(archiveStudyStorageCriteria)); }
/// <summary> /// Determine if the specified partition can be deleted. If studies are scheduled /// to be archived on that partition or studies are already archived on that partition, /// then the partition may not be deleted. /// /// </summary> /// <param name="partition"></param> /// <returns></returns> public bool CanDelete(PartitionArchive partition) { ArchiveQueueAdaptor archiveQueueAdaptor = new ArchiveQueueAdaptor(); ArchiveQueueSelectCriteria selectCriteria = new ArchiveQueueSelectCriteria(); selectCriteria.PartitionArchiveKey.EqualTo(partition.GetKey()); ArchiveStudyStorageAdaptor archiveStudyStorageAdaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria criteria = new ArchiveStudyStorageSelectCriteria(); criteria.PartitionArchiveKey.EqualTo(partition.GetKey()); int queueItems = archiveQueueAdaptor.GetCount(selectCriteria); int storageItems = 0; // only check if we need to. if (queueItems == 0) { storageItems = archiveStudyStorageAdaptor.GetCount(criteria); } return(!((queueItems > 0) || (storageItems > 0))); }
public ArchiveStudyStorage GetFirstArchiveStudyStorage(IPersistenceContext read, ServerEntityKey studyStorageKey) { Platform.CheckForNullReference(studyStorageKey, "studyStorageKey"); ArchiveStudyStorageAdaptor adaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria archiveStudyStorageCriteria = new ArchiveStudyStorageSelectCriteria(); archiveStudyStorageCriteria.StudyStorageKey.EqualTo(studyStorageKey); archiveStudyStorageCriteria.ArchiveTime.SortDesc(0); return adaptor.GetFirst(read, archiveStudyStorageCriteria); }
public IList<ArchiveStudyStorage> GetArchiveStudyStorage(Study study) { Platform.CheckForNullReference(study, "Study"); ArchiveStudyStorageAdaptor adaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria archiveStudyStorageCriteria = new ArchiveStudyStorageSelectCriteria(); archiveStudyStorageCriteria.StudyStorageKey.EqualTo(study.StudyStorageKey); archiveStudyStorageCriteria.ArchiveTime.SortDesc(0); return adaptor.Get(archiveStudyStorageCriteria); }
/// <summary> /// Determine if the specified partition can be deleted. If studies are scheduled /// to be archived on that partition or studies are already archived on that partition, /// then the partition may not be deleted. /// /// </summary> /// <param name="partition"></param> /// <returns></returns> public bool CanDelete(PartitionArchive partition) { ArchiveQueueAdaptor archiveQueueAdaptor = new ArchiveQueueAdaptor(); ArchiveQueueSelectCriteria selectCriteria = new ArchiveQueueSelectCriteria(); selectCriteria.PartitionArchiveKey.EqualTo(partition.GetKey()); ArchiveStudyStorageAdaptor archiveStudyStorageAdaptor = new ArchiveStudyStorageAdaptor(); ArchiveStudyStorageSelectCriteria criteria = new ArchiveStudyStorageSelectCriteria(); criteria.PartitionArchiveKey.EqualTo(partition.GetKey()); int queueItems = archiveQueueAdaptor.GetCount(selectCriteria); int storageItems = 0; // only check if we need to. if (queueItems == 0) storageItems = archiveStudyStorageAdaptor.GetCount(criteria); return !((queueItems > 0) || (storageItems > 0)); }