コード例 #1
0
		public LoadProtocolCodeForEditResponse LoadProtocolCodeForEdit(LoadProtocolCodeForEditRequest request)
		{
			var code = this.PersistenceContext.Load<ProtocolCode>(request.ProtocolCodeRef);

			var assembler = new ProtocolGroupAssembler();
			return new LoadProtocolCodeForEditResponse(assembler.GetProtocolCodeDetail(code));
		}
コード例 #2
0
ファイル: ProtocolAdminService.cs プロジェクト: nhannd/Xian
		public UpdateProtocolCodeResponse UpdateProtocolCode(UpdateProtocolCodeRequest request)
		{
			var code = this.PersistenceContext.Load<ProtocolCode>(request.ProtocolCode.ProtocolCodeRef);
			var assembler = new ProtocolGroupAssembler();
			assembler.UpdateProtocolCode(code, request.ProtocolCode);

			this.PersistenceContext.SynchState();

			return new UpdateProtocolCodeResponse(assembler.GetProtocolCodeSummary(code));
		}
コード例 #3
0
		public AddProtocolCodeResponse AddProtocolCode(AddProtocolCodeRequest request)
		{
			var assembler = new ProtocolGroupAssembler();
			var protocolCode = new ProtocolCode();
			assembler.UpdateProtocolCode(protocolCode, request.ProtocolCode);
			this.PersistenceContext.Lock(protocolCode, DirtyState.New);

			this.PersistenceContext.SynchState();

			return new AddProtocolCodeResponse(assembler.GetProtocolCodeSummary(protocolCode));
		}
コード例 #4
0
		public ListProtocolCodesResponse ListProtocolCodes(ListProtocolCodesRequest request)
		{
			var where = new ProtocolCodeSearchCriteria();
			where.Name.SortAsc(0);
			if (!request.IncludeDeactivated)
				where.Deactivated.EqualTo(false);

			var codes = this.PersistenceContext.GetBroker<IProtocolCodeBroker>().Find(where, request.Page);

			var assembler = new ProtocolGroupAssembler();
			return new ListProtocolCodesResponse(
				CollectionUtils.Map<ProtocolCode, ProtocolCodeSummary>(
					codes,
					code => assembler.GetProtocolCodeSummary(code)));
		}
コード例 #5
0
		public UpdateProtocolGroupResponse UpdateProtocolGroup(UpdateProtocolGroupRequest request)
		{
			var group = this.PersistenceContext.Load<ProtocolGroup>(request.ProtocolGroupRef);

			var assembler = new ProtocolGroupAssembler();
			assembler.UpdateProtocolGroup(group, request.Detail, this.PersistenceContext);

			this.PersistenceContext.SynchState();

			return new UpdateProtocolGroupResponse(assembler.GetProtocolGroupSummary(group));
		}
コード例 #6
0
		public AddProtocolGroupResponse AddProtocolGroup(AddProtocolGroupRequest request)
		{
			var assembler = new ProtocolGroupAssembler();

			var group = new ProtocolGroup();
			assembler.UpdateProtocolGroup(group, request.Detail, this.PersistenceContext);

			this.PersistenceContext.Lock(group, DirtyState.New);
			this.PersistenceContext.SynchState();

			return new AddProtocolGroupResponse(assembler.GetProtocolGroupSummary(group));
		}
コード例 #7
0
		public GetProtocolGroupEditFormDataResponse GetProtocolGroupEditFormData(
			GetProtocolGroupEditFormDataRequest request)
		{
			var protocolAssembler = new ProtocolGroupAssembler();
			var codes = CollectionUtils.Map<ProtocolCode, ProtocolCodeSummary>(
				this.PersistenceContext.GetBroker<IProtocolCodeBroker>().FindAll(false),
				code => protocolAssembler.GetProtocolCodeSummary(code));

			var procedureTypeGroupAssembler = new ProcedureTypeGroupAssembler();

			var readingGroups = CollectionUtils.Map<ProcedureTypeGroup, ProcedureTypeGroupSummary>(
				this.PersistenceContext.GetBroker<IReadingGroupBroker>().FindAll(),
				readingGroup => procedureTypeGroupAssembler.GetProcedureTypeGroupSummary(readingGroup, this.PersistenceContext));

			return new GetProtocolGroupEditFormDataResponse(codes, readingGroups);
		}
コード例 #8
0
		public LoadProtocolGroupForEditResponse LoadProtocolGroupForEdit(LoadProtocolGroupForEditRequest request)
		{
			var group = this.PersistenceContext.Load<ProtocolGroup>(request.ProtocolGroupRef);

			var assembler = new ProtocolGroupAssembler();
			return new LoadProtocolGroupForEditResponse(group.GetRef(), assembler.GetProtocolGroupDetail(group, this.PersistenceContext));
		}