Esempio n. 1
0
        public void Archive(IUpdateContext context)
        {
            var insertArchiveQueueBroker = context.GetBroker <IInsertArchiveQueue>();
            var parms = new InsertArchiveQueueParameters
            {
                ServerPartitionKey = ServerPartitionKey,
                StudyStorageKey    = Key
            };

            if (!insertArchiveQueueBroker.Execute(parms))
            {
                throw new ApplicationException("Unable to schedule study archive");
            }
        }
        protected override void OnExecute(CommandProcessor theProcessor, IUpdateContext updateContext)
        {
            // Setup the insert parameters
            var parms = new InsertArchiveQueueParameters
            {
                ServerPartitionKey = _serverPartitionKey,
                StudyStorageKey    = _studyStorageKey
            };

            // Get the Insert ArchiveQueue broker and do the insert
            var insert = updateContext.GetBroker <IInsertArchiveQueue>();

            // Do the insert
            if (!insert.Execute(parms))
            {
                throw new ApplicationException("InsertArchiveQueueCommand failed");
            }
        }