/// <summary> /// Posts the PostLeadRequest object to the PulseLead service /// </summary> /// <param name="req"></param> /// <param name="import_trans_id"></param> /// <returns></returns> internal static ResponseHdr PostPulseLeadRequest(PostLeadRequest req, string import_trans_id) { try { // Post var svc = new PostLead(); ResponseHdr response_hdr = svc.Post(req); // save the credit score if (response_hdr.Successful && req.CreditScore > 0) { svc.SaveCreditScore(response_hdr._postArgs.ContactId, req.CreditScore); } // log the event if (response_hdr.Successful) { NLogger.Info(MethodBase.GetCurrentMethod().DeclaringType.FullName, MethodBase.GetCurrentMethod().Name, "Lead posted to Pulse. Zillow.ImporTransId = " + import_trans_id + ", ContactId = " + response_hdr._postArgs.ContactId.ToString()); } else { NLogger.Info(MethodBase.GetCurrentMethod().DeclaringType.FullName, MethodBase.GetCurrentMethod().Name, "Could not post lead to Pulse."); } return(response_hdr); } catch (Exception ex) { NLogger.Error(MethodBase.GetCurrentMethod().DeclaringType.FullName, MethodBase.GetCurrentMethod().Name, ex.Message, ex); throw; } }
/// <summary> /// Returns the PostLeadRequest object populated with Zillow XML data /// </summary> /// <param name="zcol"></param> /// <returns></returns> internal static PostLeadRequest GetPulseLeadRequest(ZillowAttributeCollection zcol) { try { PostLeadRequest req = MapZillowToPulseLeadRequest(zcol); NLogger.Info(MethodBase.GetCurrentMethod().DeclaringType.FullName, MethodBase.GetCurrentMethod().Name, "ZillowImport (" + zcol.ImportTransId.ToString() + ") completed."); return(req); } catch (Exception ex) { NLogger.Error(MethodBase.GetCurrentMethod().DeclaringType.FullName, MethodBase.GetCurrentMethod().Name, ex.Message, ex); throw; } }