Exemplo n.º 1
0
    /// <summary>
    /// Stores Activity form data to main Edit form.
    /// </summary>
    private void StoreActivityData()
    {
        editForm.Data["RuleValidity"]   = (int)validity.Validity;
        editForm.Data["RuleValidUntil"] = null;

        if (validity.Validity == ValidityEnum.Until)
        {
            if (validity.ValidUntil != DateTimeHelper.ZERO_TIME)
            {
                editForm.Data["RuleValidUntil"] = validity.ValidUntil;
            }
        }
        else
        {
            editForm.Data["RuleValidFor"] = validity.ValidFor;
        }

        // Store contact column for attribute rule
        editForm.Data["RuleParameter"] = ucActivityType.SelectedValue;

        // Store xml with Where condition
        activityFormCondition.SaveData(null);
        string whereCond = "ActivityType='" + SqlHelper.EscapeQuotes(ucActivityType.SelectedValue) + "'";

        whereCond = SqlHelper.AddWhereCondition(whereCond, activityFormCondition.GetWhereCondition());
        editForm.Data["RuleCondition"] = RuleHelper.GetActivityCondition(activityFormCondition.Data, whereCond, ucActivityType.SelectedValue);
    }