Exemplo n.º 1
0
        public UpdateFacilityResponse UpdateFacility(UpdateFacilityRequest request)
        {
            var facility = PersistenceContext.Load <Facility>(request.FacilityDetail.FacilityRef, EntityLoadFlags.CheckVersion);

            var assembler = new FacilityAssembler();

            assembler.UpdateFacility(request.FacilityDetail, facility, this.PersistenceContext);

            CheckMultipleInformationAuthoritiesUsed();

            return(new UpdateFacilityResponse(assembler.CreateFacilitySummary(facility)));
        }
Exemplo n.º 2
0
		public AddFacilityResponse AddFacility(AddFacilityRequest request)
		{
			var facility = new Facility();
			var assembler = new FacilityAssembler();
			assembler.UpdateFacility(request.FacilityDetail, facility, this.PersistenceContext);

			PersistenceContext.Lock(facility, DirtyState.New);

			CheckMultipleInformationAuthoritiesUsed();

			// ensure the new facility is assigned an OID before using it in the return value
			PersistenceContext.SynchState();

			return new AddFacilityResponse(assembler.CreateFacilitySummary(facility));
		}
Exemplo n.º 3
0
        public AddFacilityResponse AddFacility(AddFacilityRequest request)
        {
            var facility  = new Facility();
            var assembler = new FacilityAssembler();

            assembler.UpdateFacility(request.FacilityDetail, facility, this.PersistenceContext);

            PersistenceContext.Lock(facility, DirtyState.New);

            CheckMultipleInformationAuthoritiesUsed();

            // ensure the new facility is assigned an OID before using it in the return value
            PersistenceContext.SynchState();

            return(new AddFacilityResponse(assembler.CreateFacilitySummary(facility)));
        }
Exemplo n.º 4
0
		public UpdateFacilityResponse UpdateFacility(UpdateFacilityRequest request)
		{
			var facility = PersistenceContext.Load<Facility>(request.FacilityDetail.FacilityRef, EntityLoadFlags.CheckVersion);

			var assembler = new FacilityAssembler();
			assembler.UpdateFacility(request.FacilityDetail, facility, this.PersistenceContext);

			CheckMultipleInformationAuthoritiesUsed();

			return new UpdateFacilityResponse(assembler.CreateFacilitySummary(facility));
		}