Esempio n. 1
0
		public void UpdateDepartment(Department item, DepartmentDetail detail, IPersistenceContext context)
		{
			item.Id = detail.Id;
			item.Name = detail.Name;
			item.Description = detail.Description;
			item.Facility = context.Load<Facility>(detail.Facility.FacilityRef, EntityLoadFlags.Proxy);
			item.Deactivated = detail.Deactivated;
		}
Esempio n. 2
0
		public DepartmentSummary CreateSummary(Department item, IPersistenceContext context)
		{
			return new DepartmentSummary(item.GetRef(),
										 item.Id,
										 item.Name,
										 item.Facility.Code,
										 item.Facility.Name,
										 item.Deactivated);
		}
Esempio n. 3
0
		public DepartmentDetail CreateDetail(Department item, IPersistenceContext context)
		{
			var facilityAssembler = new FacilityAssembler();
			return new DepartmentDetail(item.GetRef(),
										 item.Id,
										 item.Name,
										 item.Description,
										 facilityAssembler.CreateFacilitySummary(item.Facility),
										 item.Deactivated);
		}
Esempio n. 4
0
		public AddDepartmentResponse AddDepartment(AddDepartmentRequest request)
		{
			Platform.CheckForNullReference(request, "request");
			Platform.CheckMemberIsSet(request.Department, "request.Department");

			var item = new Department();

			var assembler = new DepartmentAssembler();
			assembler.UpdateDepartment(item, request.Department, PersistenceContext);

			PersistenceContext.Lock(item, DirtyState.New);
			PersistenceContext.SynchState();

			return new AddDepartmentResponse(assembler.CreateSummary(item, PersistenceContext));
		}