Example #1
0
 public List<DC.Facility> GetFacilitiesNotForOffering(Guid offeringGuid)
 {
     try
     {
         BL.FacilityLogic facilityLogic = new BL.FacilityLogic();
         List<BE.Facility> facilities = facilityLogic.GetFacilitiesNotForOffering(offeringGuid);
         List<DC.Facility> response = facilities.ToDataContractList();
         return response;
     }
     catch (BE.OfferingNotFoundException)
     {
         FC.OfferingFault fault = new FC.OfferingFault();
         fault.OfferingGuid = offeringGuid;
         fault.ErrorMessage = String.Format("Unable to find facilities not for offering '{0}'.",
             offeringGuid);
         throw new FaultException<FC.OfferingFault>(fault,
             new FaultReason("Offering does not exist in database."));
     }
     catch (Exception ex)
     {
         FC.OfferingFault fault = new FC.OfferingFault();
         fault.OfferingGuid = offeringGuid;
         fault.ErrorMessage = String.Format("Unable to find facilities not for offering '{0}'.",
             offeringGuid);
         throw new FaultException<FC.OfferingFault>(fault,
             new FaultReason(ex.Message));
     }
 }
Example #2
0
 public DC.Offering GetOfferingByOfferingGuid(Guid offeringGuid)
 {
     try
     {
         BL.OfferingLogic offeringLogic = new BL.OfferingLogic();
         BE.Offering entity = offeringLogic.GetOfferingByOfferingGuid(offeringGuid);
         DC.Offering response = entity.ToDataContract();
         return response;
     }
     catch (BE.OfferingNotFoundException ex)
     {
         FC.OfferingFault fault = new FC.OfferingFault();
         fault.OfferingGuid = ex.OfferingGuid;
         fault.ErrorMessage = "Offering does not exsist in the database.";
         throw new FaultException<FC.OfferingFault>(fault,
             new FaultReason(ex.Message));
     }
     catch (Exception ex)
     {
         FC.OfferingFault fault = new FC.OfferingFault();
         fault.ErrorMessage = "Could not retrieve a specific Offering for unknown reasons.";
         throw new FaultException<FC.OfferingFault>(fault,
             new FaultReason(ex.Message));
     }
 }