コード例 #1
0
ファイル: StudyController.cs プロジェクト: yjsyyyjszf/CC13.2
        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));
        }
コード例 #2
0
ファイル: StudyController.cs プロジェクト: yjsyyyjszf/CC13.2
        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));
        }
コード例 #3
0
        /// <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)));
        }
コード例 #4
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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        /// <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));
        }