Example #1
0
    protected void EstimateEmailWithDataGeek(Contact c)
    {
        String UserID = Util.GetUserId();

        EstimatedEmail     = c.GetEstimatedEmailThroughDataGeek(UserID);
        IsDataGeekEstimate = true;

        if (EstimatedEmail.Contains("@"))
        {
            // Determine the ID of the entry to delete is the user cancels this estimation
            String qry            = "SELECT EmailHistoryID FROM db_contact_email_history WHERE EmailHistoryID=(SELECT MAX(EmailHistoryID) FROM db_contact_email_history WHERE ContactID=@ContactID AND DataGeekEstimate=1 AND Deleted=0 AND EstimatedByUserId=@EstimatedByUserId)";
            String EmailHistoryID = SQL.SelectString(qry, "EmailHistoryID", new String[] { "@ContactID", "@EstimatedByUserId" }, new Object[] { c.ContactID, UserID });
            if (!String.IsNullOrEmpty(EmailHistoryID))
            {
                String onok     = "var rb=$find('" + se.ClientID + "'); rb.click();";
                String oncancel = "var rb=$find('" + de.ClientID + "'); rb.click();";
                Util.PageMessagePrompt(this.Parent.Page, "Here's what DataGeek generated.. ", EstimatedEmail, onok, oncancel, "E-mail Address Generated");

                if (!String.IsNullOrEmpty(LeadID))
                {
                    LeadsUtil.AddLeadHistoryEntry(LeadID, "Estimated e-mail for this contact using DataGeek, generated e-mail: " + EstimatedEmail);
                }
            }
        }
        else
        {
            Util.PageMessageAlertify(this.Parent.Page, EstimatedEmail, "Estimation Results");
        }
    }
Example #2
0
    protected void EstimateEmailEmailHunter(Contact c)
    {
        int    Score;
        String Sources;

        EstimatedEmail      = c.GetEstimatedEmailThroughEmailHunter(out Score, out Sources);
        EstimatedEmailScore = Score;
        IsDataGeekEstimate  = false;

        if (EstimatedEmail.Contains("@"))
        {
            String onok = "var rb=$find('" + se.ClientID + "'); rb.click();";
            Util.PageMessagePrompt(this.Parent.Page, "Here's what we found.. (with a score of " + Score + ")" + Sources, EstimatedEmail, onok, String.Empty, "E-mail Address Found");

            if (!String.IsNullOrEmpty(LeadID))
            {
                LeadsUtil.AddLeadHistoryEntry(LeadID, "E-mail Hunter request returned e-mail: " + EstimatedEmail + " (" + Score + ")");
            }
        }
        else
        {
            Util.PageMessageAlertify(this.Parent.Page, EstimatedEmail, "Estimation Results");
        }
    }