Beispiel #1
0
        public void DeleteFacility(BE.Facility entity)
        {
            // Delete the main record.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            gateway.Delete(entity.FacilityGuid);

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(entity);
        }
Beispiel #2
0
 public List<DC.FacilityAudit> GetAllFacilityAuditWithUndefined()
 {
     try
     {
         BL.FacilityAuditLogic facilityAuditLogic = new BL.FacilityAuditLogic();
         List<BE.FacilityAudit> entities = facilityAuditLogic.GetAllFacilityAuditWithUndefined();
         List<DC.FacilityAudit> response = entities.ToDataContractList();
         return response;
     }
     catch (Exception ex)
     {
         FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
         fault.ErrorMessage = "Unable to retrieve facilityAudit data.";
         throw new FaultException<FC.DefaultFaultContract>(fault,
             new FaultReason(ex.Message));
     }
 }
Beispiel #3
0
        public void DeleteFacilityAudit(DC.FacilityAudit request)
        {
            try
            {
                BL.FacilityAuditLogic facilityAuditLogic = new BL.FacilityAuditLogic();
                BE.FacilityAudit entity = request.ToBusinessEntity();
                facilityAuditLogic.DeleteFacilityAudit(entity);
            }
            catch (BE.FacilityAuditNotFoundException ex)
            {
                FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
                fault.ErrorMessage = String.Format(
                    "Unable to delete Facility Audit data. Data: {0}",
                    request.ToBusinessEntity().ToString());

                throw new FaultException<FC.DefaultFaultContract>(fault,
                    new FaultReason(ex.Message));
            }
        }
Beispiel #4
0
        public void UpdateFacility(BE.Facility entity)
        {
            StripPhoneNumber(entity);
            // Update the main record.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            gateway.Update(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(entity);
        }
Beispiel #5
0
        public BE.Facility InsertFacility(BE.Facility entity)
        {
            StripPhoneNumber(entity);
            //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            DA.Facility result = gateway.Insert(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(result.ToBusinessEntity());

            return result.ToBusinessEntity();
        }
Beispiel #6
0
 public DC.FacilityAudit GetFacilityAuditByFacilityAuditGuid(Guid facilityAuditGuid)
 {
     try
     {
         BL.FacilityAuditLogic facilityAuditLogic = new BL.FacilityAuditLogic();
         BE.FacilityAudit entity = facilityAuditLogic.GetFacilityAuditByFacilityAuditGuid(facilityAuditGuid);
         DC.FacilityAudit response = entity.ToDataContract();
         return response;
     }
     catch (BE.FacilityAuditNotFoundException ex)
     {
         FC.FacilityAuditFault fault = new FC.FacilityAuditFault();
         fault.FacilityAuditGuid = ex.FacilityAuditGuid;
         fault.ErrorMessage = "FacilityAudit does not exsist in the database.";
         throw new FaultException<FC.FacilityAuditFault>(fault,
             new FaultReason(ex.Message));
     }
     catch (Exception ex)
     {
         FC.FacilityAuditFault fault = new FC.FacilityAuditFault();
         fault.ErrorMessage = "Could not retrieve a specific FacilityAudit for unknown reasons.";
         throw new FaultException<FC.FacilityAuditFault>(fault,
             new FaultReason(ex.Message));
     }
 }
Beispiel #7
0
 public List<DC.FacilityAudit> GetFacilityAuditsForListingTypeByListingTypeGuid(Guid listingTypeGuid)
 {
     try
     {
         BL.FacilityAuditLogic facilityAuditLogic = new BL.FacilityAuditLogic();
         List<BE.FacilityAudit> entities = facilityAuditLogic.GetFacilityAuditsForListingTypeByListingTypeGuid(listingTypeGuid);
         List<DC.FacilityAudit> response = entities.ToDataContractList();
         return response;
     }
     catch (BE.FacilityAuditException ex)
     {
         FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
         fault.ErrorMessage = string.Format("Unable to find a FacilityAudit with the given ListingType");
         throw new FaultException<FC.DefaultFaultContract>(fault,
             new FaultReason(ex.Message));
     }
 }