Пример #1
0
        public HttpResponseMessage DeleteLeadadapter(int leadAdapterID)
        {
            DeleteLeadAdapterRequest  request  = new DeleteLeadAdapterRequest(leadAdapterID);
            DeleteLeadAdapterResponse response = leadAdapterService.DeleteLeadAdapter(request);

            return(Request.BuildResponse(response));
        }
Пример #2
0
        public DeleteLeadAdapterResponse DeleteLeadAdapter(DeleteLeadAdapterRequest request)
        {
            DeleteLeadAdapterResponse response = new DeleteLeadAdapterResponse();

            Logger.Current.Verbose("Request received to delete lead adapter with leadAdapterID " + request.Id);
            bool isLinkedToWorkflows = leadAdaptersRepository.isLinkedToWorkflows(request.Id);

            if (isLinkedToWorkflows)
            {
                throw new UnsupportedOperationException("[|The selected Lead Adapter is linked to Automation Workflow|]. [|You cannot delete the Lead Adapter|].");
            }
            leadAdaptersRepository.DeleteLeadAdapter(request.Id);
            unitOfWork.Commit();
            return(response);
        }