Example #1
0
        /// <summary>
        /// Insert an EditStudy request.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="studyStorageKey"></param>
        /// <param name="serverPartitionKey"></param>
        /// <param name="type"></param>
        /// <param name="updateItems"></param>
        /// <param name="reason"></param>
        /// <param name="user"></param>
        /// <param name="editType"></param>
        /// <returns></returns>
        private static WorkQueue InsertEditStudyRequest(IUpdateContext context, ServerEntityKey studyStorageKey, ServerEntityKey serverPartitionKey, WorkQueueTypeEnum type, List <UpdateItem> updateItems, string reason, string user, EditType editType)
        {
            var broker = context.GetBroker <IInsertWorkQueue>();
            InsertWorkQueueParameters criteria = new EditStudyWorkQueueParameters(studyStorageKey, serverPartitionKey, type, updateItems, reason, user, editType);
            WorkQueue editEntry = broker.FindOne(criteria);

            if (editEntry == null)
            {
                throw new ApplicationException(string.Format("Unable to insert an Edit request of type {0} for study for user {1}", type.Description, user));
            }
            return(editEntry);
        }
Example #2
0
 /// <summary>
 /// Insert an EditStudy request.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="studyStorageKey"></param>
 /// <param name="serverPartitionKey"></param>
 /// <param name="type"></param>
 /// <param name="updateItems"></param>
 /// <param name="reason"></param>
 /// <param name="user"></param>
 /// <param name="editType"></param>
 /// <returns></returns>
 private static WorkQueue InsertEditStudyRequest(IUpdateContext context, ServerEntityKey studyStorageKey, ServerEntityKey serverPartitionKey, WorkQueueTypeEnum type, List<UpdateItem> updateItems, string reason, string user, EditType editType)
 {
 	var broker = context.GetBroker<IInsertWorkQueue>();
     InsertWorkQueueParameters criteria = new EditStudyWorkQueueParameters(studyStorageKey, serverPartitionKey, type, updateItems, reason, user, editType);
     WorkQueue editEntry = broker.FindOne(criteria);
     if (editEntry == null)
     {
         throw new ApplicationException(string.Format("Unable to insert an Edit request of type {0} for study for user {1}",type.Description, user));
     }
     return editEntry;
 }