public HttpResponseMessage RegisterLeadBySoloPage(HttpRequestMessage request, RegisterLeadBySoloPageDTO obj) { return(CreateHttpResponse(request, () => { HttpResponseMessage response; ResultDTO result = _service.RegisterLeadBySoloPage(obj); if (result.Details != null) { MailChimpResponse1DTO objOlala = (MailChimpResponse1DTO)result.Details; AddSubscribe(objOlala.APIKey, objOlala.DataCenter, objOlala.ListID, obj.Email, objOlala.PageName, obj.Name, obj.Phone, obj.SessionKey); } response = request.CreateResponse(HttpStatusCode.OK, result); return response; })); }
public HttpResponseMessage RegisterLeadBySoloPage(HttpRequestMessage request, RegisterLeadBySoloPageDTO obj) { if (string.IsNullOrEmpty(obj.Email)) { ResultDTO result = new ResultDTO(); result.StatusCode = Common.ConvertErrorCodeToInt(RetCode.ECS0034); result.SetContentMsg(); return(CreateHttpResponse(request, () => { var response = request.CreateResponse(HttpStatusCode.OK, result); return response; })); } return(CreateHttpResponse(request, () => { HttpResponseMessage response; ResultDTO result = _service.RegisterLeadBySoloPage(obj); if (result.Details != null) { GetResponseConfigDTO objOlala = (GetResponseConfigDTO)result.Details; try { AddContract(objOlala.APIKey, objOlala.CampaignName, obj.Name, obj.Email); } catch (Exception ex) { Business.Utilities.AppLog.WriteLog(GetResponseConfig.ContactsFunc, ActionType.Add, ex.Message, obj.SessionKey); } result.Details = string.Empty; } response = request.CreateResponse(HttpStatusCode.OK, result); return response; })); }