/// <summary>
    /// Returns true if contact came to specified landing page.
    /// </summary>
    /// <param name="parameters">Contact; Node ID or alias path of the page</param>
    public static object CameToLandingPage(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            int    nodeId  = ValidationHelper.GetInteger(parameters[1], 0);
            string nodeIds = null;
            if (nodeId <= 0)
            {
                string alias = ValidationHelper.GetString(parameters[1], "");
                if (!string.IsNullOrEmpty(alias))
                {
                    TreeNodeDataSet ds = new TreeProvider().SelectNodes(TreeProvider.ALL_SITES, alias, TreeProvider.ALL_CULTURES, true);
                    if (!DataHelper.DataSourceIsEmpty(ds))
                    {
                        nodeIds = TextHelper.Join(",", SystemDataHelper.GetStringValues(ds.Tables[0], "NodeID"));
                    }
                }
            }

            if (nodeId > 0)
            {
                return(OnlineMarketingFunctions.DidActivity(parameters[0], "landingpage", null, 0, "ActivityNodeID = " + nodeId));
            }
            else if (!string.IsNullOrEmpty(nodeIds))
            {
                return(OnlineMarketingFunctions.DidActivity(parameters[0], "landingpage", null, 0, "ActivityNodeID IN (" + nodeIds + ")"));
            }
            return(false);

        default:
            throw new NotSupportedException();
        }
    }
 /// <summary>
 /// Returns GUID of last newsletter that was sent to the user in scope of given automation state.
 /// </summary>
 /// <param name="parameters">Automation state</param>
 public static object GetLastNewsletterIssue(params object[] parameters)
 {
     if (parameters.Length != 1)
     {
         throw new NotSupportedException();
     }
     return(OnlineMarketingFunctions.GetLastNewsletterIssue(parameters[0] as AutomationStateInfo));
 }
    /// <summary>
    /// Returns TRUE if the contact is in specified contact group on current site.
    /// </summary>
    /// <param name="parameters">ID of current contact; Name of the contact group</param>
    public static object IsInContactGroup(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.IsInContactGroup(parameters[0], parameters[1]));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns e-mail domain name.
    /// </summary>
    /// <param name="parameters">E-mail address</param>
    public static object GetEmailDomain(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 1:
            return(OnlineMarketingFunctions.GetEmailDomain(parameters[0]));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns true if the contact logged in.
    /// </summary>
    /// <param name="parameters">
    /// Contact which should be checked;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// </param>
    public static object LoggedIn(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.LoggedIn(parameters[0], ValidationHelper.GetInteger(parameters[1], 0)));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns true if the contact's state matches one of the specified countries.
    /// </summary>
    /// <param name="parameters">Contact; List of states</param>
    public static object IsFromState(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.IsFromState(parameters[0], ValidationHelper.GetString(parameters[1], "")));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns true if contact belongs to specified account.
    /// </summary>
    /// <param name="parameters">Contact info object; Account name</param>
    public static object BelongsToAccount(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.BelongsToAccount(parameters[0], parameters[1]));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns if activity is linked to object of type given in parameter and codename given in second parameter.
    /// </summary>
    /// <param name="parameters">
    /// Activity which should be checked;
    /// Object type;
    /// Code name or GUID of object;
    /// </param>
    public static object ActivityLinkedToObject(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 3:
            return(OnlineMarketingFunctions.ActivityLinkedToObject(parameters[0] as ActivityInfo, parameters[1] as string, parameters[2] as string));

        default:
            throw new NotSupportedException();
        }
    }
    /// <summary>
    /// Returns contact's first activity of specified activity type.
    /// </summary>
    /// <param name="parameters">ID of current contact; Name of the activity type</param>
    public static object FirstActivityOfType(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 1:
            return(OnlineMarketingFunctions.FirstActivityOfType(parameters[0], null));

        case 2:
            return(OnlineMarketingFunctions.FirstActivityOfType(parameters[0], parameters[1]));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 10
0
    /// <summary>
    /// Returns true if the contact registered for specific event.
    /// </summary>
    /// <param name="parameters">
    /// Contact which should be checked;
    /// Node alias path of the document;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// </param>
    public static object RegisteredForEvent(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.RegisteredForEvent(parameters[0], ValidationHelper.GetString(parameters[1], ""), 0));

        case 3:
            return(OnlineMarketingFunctions.RegisteredForEvent(parameters[0], ValidationHelper.GetString(parameters[1], ""), ValidationHelper.GetInteger(parameters[2], 0)));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 11
0
    /// <summary>
    /// Returns true if the contact purchased specified number of products in last X days.
    /// </summary>
    /// <param name="parameters">
    /// Contact the activities of which should be checked;
    /// Inclusive lower bound of the number of products bought;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// </param>
    public static object PurchasedNumberOfProducts(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.PurchasedNumberOfProducts(parameters[0], ValidationHelper.GetInteger(parameters[1], 0), 0));

        case 3:
            return(OnlineMarketingFunctions.PurchasedNumberOfProducts(parameters[0], ValidationHelper.GetInteger(parameters[1], 0), ValidationHelper.GetInteger(parameters[2], 0)));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 12
0
    /// <summary>
    /// Returns true if the contact spent specified amount of money (counted by order total price in main currency) in last X days.
    /// </summary>
    /// <param name="parameters">
    /// Contact the activities of which should be checked;
    /// Inclusive lower bound of the amount of money (in main currency) spent by contact;
    /// Inclusive upper bound of the amount of money (in main currency) spent by contact;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// </param>
    public static object SpentMoney(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 3:
            return(OnlineMarketingFunctions.SpentMoney(parameters[0], ValidationHelper.GetDouble(parameters[1], 0), ValidationHelper.GetDouble(parameters[2], 0), 0));

        case 4:
            return(OnlineMarketingFunctions.SpentMoney(parameters[0], ValidationHelper.GetDouble(parameters[1], 0), ValidationHelper.GetDouble(parameters[2], 0), ValidationHelper.GetInteger(parameters[3], 0)));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 13
0
    /// <summary>
    /// Returns TRUE if the contact is in specified contact group on current site.
    /// </summary>
    /// <param name="parameters">
    /// ID of current contact;
    /// Name of the contact group(s) separated by semicolon;
    /// If true contact has to be in all specified groups, if false, it is sufficient if the contact is in any of the specified groups.
    /// </param>
    public static object IsInContactGroup(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.IsInContactGroup(parameters[0], parameters[1], false));

        case 3:
            return(OnlineMarketingFunctions.IsInContactGroup(parameters[0], parameters[1], ValidationHelper.GetBoolean(parameters[2], false)));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 14
0
    /// <summary>
    /// Returns true if the contact opened the specified newsletter issue
    /// </summary>
    /// <param name="parameters">
    /// Contact that should be checked;
    /// Newsletter issue GUID;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// </param>
    public static object OpenedNewsletterIssue(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.InteractedWithNewsletterIssue(parameters[0], ValidationHelper.GetGuid(parameters[1], Guid.Empty), false, 0));

        case 3:
            return(OnlineMarketingFunctions.InteractedWithNewsletterIssue(parameters[0], ValidationHelper.GetGuid(parameters[1], Guid.Empty), false, ValidationHelper.GetInteger(parameters[2], 0)));

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 15
0
    /// <summary>
    /// Returns true if the contact did any/all of the specified activities.
    /// </summary>
    /// <param name="parameters">
    /// Contact the activities of which should be checked;
    /// Name of the activity(ies) to check separated with semicolon;
    /// Constraint for last X days (if zero or negative value is given, no constraint is applied);
    /// If true, all specified types has to be found for the method to return true. If false, at least one of any specified types is sufficient to return true for the method;
    /// </param>
    public static object DidActivities(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            return(OnlineMarketingFunctions.DidActivities(parameters[0], ValidationHelper.GetString(parameters[1], ""), 0, false));

        case 3:
            return(OnlineMarketingFunctions.DidActivities(parameters[0], ValidationHelper.GetString(parameters[1], ""), ValidationHelper.GetInteger(parameters[2], 0), false));

        case 4:
            return(OnlineMarketingFunctions.DidActivities(parameters[0], ValidationHelper.GetString(parameters[1], ""), ValidationHelper.GetInteger(parameters[2], 0), ValidationHelper.GetBoolean(parameters[3], false)));

        default:
            throw new NotSupportedException();
        }
    }