コード例 #1
0
    protected void drpAction_SelectedIndexChanged(object sender, EventArgs e)
    {
        // Find selected action
        VariantActionEnum action = (VariantActionEnum)ValidationHelper.GetInteger(drpAction.SelectedValue, -1);

        // Display price input only for ChangePrice action
        pnlNewPrice.Visible = (action == VariantActionEnum.ChangePrice);
    }
コード例 #2
0
    /// <summary>
    /// Generates confirmation text.
    /// </summary>
    private string EnsureConfirmationMessage()
    {
        string message;

        // Find selected scope
        WhatEnum scope = (WhatEnum)ValidationHelper.GetInteger(drpWhat.SelectedValue, -1);

        // Find selected action
        VariantActionEnum action = (VariantActionEnum)ValidationHelper.GetInteger(drpAction.SelectedValue, -1);

        // Ensure correct confirmation message
        if (action == VariantActionEnum.Delete)
        {
            message = (scope == WhatEnum.AllVariants) ? "com.productvariant.deleteconfirmation" : "com.productvariant.deleteselectedconfirmation";
        }
        else
        {
            message = (scope == WhatEnum.AllVariants) ? "com.productvariant.updateprice" : "com.productvariant.updateselectedprice";
        }

        return(ScriptHelper.GetLocalizedString(message));
    }