예제 #1
0
        public void DeleteClient(BE.Client entity)
        {
            // Delete the main record.
            DA.ClientGateway gateway = new DA.ClientGateway();
            gateway.Delete(entity.ClientGuid);

            //@@NEW
            // Create the audit record.
            ClientAuditLogic auditLogic = new ClientAuditLogic();
            auditLogic.InsertClientAudit(entity);
        }
예제 #2
0
 public List<DC.ClientAudit> GetAllClientAuditWithUndefined()
 {
     try
     {
         BL.ClientAuditLogic clientAuditLogic = new BL.ClientAuditLogic();
         List<BE.ClientAudit> entities = clientAuditLogic.GetAllClientAuditWithUndefined();
         List<DC.ClientAudit> response = entities.ToDataContractList();
         return response;
     }
     catch (Exception ex)
     {
         FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
         fault.ErrorMessage = "Unable to retrieve clientAudit data.";
         throw new FaultException<FC.DefaultFaultContract>(fault,
             new FaultReason(ex.Message));
     }
 }
예제 #3
0
        public void DeleteClientAudit(DC.ClientAudit request)
        {
            try
            {
                BL.ClientAuditLogic clientAuditLogic = new BL.ClientAuditLogic();
                BE.ClientAudit entity = request.ToBusinessEntity();
                clientAuditLogic.DeleteClientAudit(entity);
            }
            catch (BE.ClientAuditNotFoundException ex)
            {
                FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
                fault.ErrorMessage = String.Format(
                    "Unable to delete Client Audit data. Data: {0}",
                    request.ToBusinessEntity().ToString());

                throw new FaultException<FC.DefaultFaultContract>(fault,
                    new FaultReason(ex.Message));
            }
        }
예제 #4
0
        public void UpdateClient(BE.Client entity)
        {
            StripPhoneNumber(entity);
            // Update the main record.
            DA.ClientGateway gateway = new DA.ClientGateway();
            gateway.Update(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            ClientAuditLogic auditLogic = new ClientAuditLogic();
            auditLogic.InsertClientAudit(entity);
        }
예제 #5
0
        public BE.Client InsertClient(BE.Client entity)
        {
            StripPhoneNumber(entity);

            //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
            DA.ClientGateway gateway = new DA.ClientGateway();
            DA.Client result = gateway.Insert(entity.ToDataEntity());

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

            return result.ToBusinessEntity();
        }
예제 #6
0
 public DC.ClientAudit GetClientAuditByClientAuditGuid(Guid clientAuditGuid)
 {
     try
     {
         BL.ClientAuditLogic clientAuditLogic = new BL.ClientAuditLogic();
         BE.ClientAudit entity = clientAuditLogic.GetClientAuditByClientAuditGuid(clientAuditGuid);
         DC.ClientAudit response = entity.ToDataContract();
         return response;
     }
     catch (BE.ClientAuditNotFoundException ex)
     {
         FC.ClientAuditFault fault = new FC.ClientAuditFault();
         fault.ClientAuditGuid = ex.ClientAuditGuid;
         fault.ErrorMessage = "ClientAudit does not exsist in the database.";
         throw new FaultException<FC.ClientAuditFault>(fault,
             new FaultReason(ex.Message));
     }
     catch (Exception ex)
     {
         FC.ClientAuditFault fault = new FC.ClientAuditFault();
         fault.ErrorMessage = "Could not retrieve a specific ClientAudit for unknown reasons.";
         throw new FaultException<FC.ClientAuditFault>(fault,
             new FaultReason(ex.Message));
     }
 }
예제 #7
0
 public List<DC.ClientAudit> GetClientAuditsForPaymentInfoByPaymentInfoGuid(Guid paymentInfoGuid)
 {
     try
     {
         BL.ClientAuditLogic clientAuditLogic = new BL.ClientAuditLogic();
         List<BE.ClientAudit> entities = clientAuditLogic.GetClientAuditsForPaymentInfoByPaymentInfoGuid(paymentInfoGuid);
         List<DC.ClientAudit> response = entities.ToDataContractList();
         return response;
     }
     catch (BE.ClientAuditException ex)
     {
         FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
         fault.ErrorMessage = string.Format("Unable to find a ClientAudit with the given PaymentInfo");
         throw new FaultException<FC.DefaultFaultContract>(fault,
             new FaultReason(ex.Message));
     }
 }